Вы находитесь на странице: 1из 32

Computer Arithmetic Circuit Design

Chapter 14

High-Radix Dividers

Basics of High-Radix Division Radix-2 SRT Division Using Carry-Save Adders Choosing the Quotient Digits Radix-4 SRT Division General High-Radix divider

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

Basics of High-Radix Division

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

Radix-4 Division in Dot Notation

Interesting dividers have radix r = 2b Reduces the number of cycles of by a factor of b


Ch 14. High-Radix Dividers 3

Computer Arithmetic Circuit Design

Difficulty of High-Radix Division


Guessing the correct quotient digit is more difficult. Division is naturally a sequential process:
Guess a quotient digit qk-j Compute term qk-j(rkd) Compute partial remainder

s(j) = rs(j-1) qk-1(rkd)


Ch 14. High-Radix Dividers 4

Computer Arithmetic Circuit Design

Carry-Save Remainders
More important for speed than high-radix. Lead to large performance increases by replacing carry-propagate adder with carry-save adder. Key to keeping remainder in carry-save form is: Redundancy in the representation of q.
Allows less precise guessing of quotient digit based on approximate magnitude of partial remainder. More redundancy less precision required.

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

Review of Non-Restoring Division (fractional operands)

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

Using q-j in {-1,0,1}

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

A Big Problem
Q: How can you tell if shifted partial remainder is in [-d,d) ? A: You have to perform trial subtractions. Q: Can you avoid trial subtractions ? A: Sweeny, Robertson, and Tocher-- SRT division.

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

Radix-2 SRT Division


Assume d 1/2 (normalized) Restrict partial remainder to constant range [-1/2, 1/2) instead of [-d, d )
May require shifting dividend = initial partial remainder so that: 1/2 s (0) -1/2

Once in the proper range, subsequent partial remainders will stay in the range

Ch 14. High-Radix Dividers

Computer Arithmetic Circuit Design

Radix-2 SRT Division

Ch 14. High-Radix Dividers

10

Computer Arithmetic Circuit Design

Simplified Digit Selection

Ch 14. High-Radix Dividers

11

Computer Arithmetic Circuit Design

Final Steps
{-1,1}-quotient conversion algorithm will not work to convert [-1, 1]-quotient to twos-complement.
On-the-fly algorithm by Ercedovac 1987, or Subtract negative digits from positive digits.

Still requires a final correction step to make remainder positive.

Ch 14. High-Radix Dividers

12

Computer Arithmetic Circuit Design

Using Carry-Save Adders

Ch 14. High-Radix Dividers

13

Computer Arithmetic Circuit Design

Carry-Save Partial Remainders


Two numbers sum to the actual partial remainder. To perform exact comparison, a full CPA would be required. Overlaps in the selection regions allow us to perform approximate comparisons without risk of choosing a wrong digit.

Ch 14. High-Radix Dividers

14

Computer Arithmetic Circuit Design

Carry-Save Partial Remainders

Ch 14. High-Radix Dividers

15

Computer Arithmetic Circuit Design

Tolerating Truncation Error

Ch 14. High-Radix Dividers

16

Computer Arithmetic Circuit Design

Digit Selection

Ch 14. High-Radix Dividers

17

Computer Arithmetic Circuit Design

Radix-2 Divider with CSA

Ch 14. High-Radix Dividers

18

Computer Arithmetic Circuit Design

Select Logic
Fast 4-bit CPA, plus decode logic, or 256 2 Lookup table, or 8 input, 2 output PLA

Ch 14. High-Radix Dividers

19

Computer Arithmetic Circuit Design

CLA with SRT Division?

Ch 14. High-Radix Dividers

20

Computer Arithmetic Circuit Design

Choosing Quotient Digits Using a P-D Plot

Ch 14. High-Radix Dividers

21

Computer Arithmetic Circuit Design

Putting Both Charts Together

Ch 14. High-Radix Dividers

22

Computer Arithmetic Circuit Design

Radix-4 SRT Division


Radix r = 2 b , b > 1 Partial remainder kept in stored-carry form. Requires a redundant digit set. Example:
radix 4 digit set [-3, 3]

Ch 14. High-Radix Dividers

23

Computer Arithmetic Circuit Design

New vs. Shifted Old Partial Remainder


Radix = 4 Digit Set = [ -3, 3 ]

Ch 14. High-Radix Dividers

24

Computer Arithmetic Circuit Design

p-d Plot for Radix-4, [-3, 3 ] SRT Division

Ch 14. High-Radix Dividers

25

Computer Arithmetic Circuit Design

Radix-4 Digit Set [ -2, 2 ]


Avoids having to compute 3d as in digit set [-3, 3]. Fewer comparisons (fewer selection regions). Less redundancy means less overlap in selection regions. Partial remainder must be restricted to ensure convergence.
Ch 14. High-Radix Dividers 26

Computer Arithmetic Circuit Design

Restricting the Range of s

Ch 14. High-Radix Dividers

27

Computer Arithmetic Circuit Design

p-d Plot for Radix-4, [-2, 2 ] SRT Division

Ch 14. High-Radix Dividers

28

Computer Arithmetic Circuit Design

Observations
Restricting digit set to [-2, 2 ] results in less overlap in selection regions. Must examine p and d in greater detail to correctly choose the quotient digit. Staircase boundaries: 4 bits of p and 4 bits of d are required to make the selection.

Ch 14. High-Radix Dividers

29

Computer Arithmetic Circuit Design

Block Diagram

Ch 14. High-Radix Dividers

30

Computer Arithmetic Circuit Design

Intels Pentium Division Bug


Intel used the Radix-4 SRT division algorithm. Quotient selection was implemented as a PLA. The p-d plot was numerically generated. Script to download entries into the PLA inadvertently removed a few table entries from the table. When hit, these missing entries resulted in digit 0, instead of the intended digits 2. These entries are consulted very rarely, and thus the bug was very subtle and difficult to detect.
Ch 14. High-Radix Dividers 31

Computer Arithmetic Circuit Design

General High-Radix Dividers


Radix-8 is possible.
Minimal quotient digit set [-4, 4] Partial remainder restricted to [-4d/7, 4d/7) Requires a 3d multiple

Digit sets with greater redundancy (such as [-7, 7] ) lead to:


Wider overlap regions More comparisons but simpler digit selection More difficult multiples (5, 7)

Ch 14. High-Radix Dividers

32

Вам также может понравиться