





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth analysis of the divide algorithm and its hardware implementations (version 1, 2, and 3). It also covers observations on each version, floating-point arithmetic, and the pentium bug. Examples and observations on wasted space, divide algorithm, and the consequences of combining quotient and remainder registers.
Typology: Slides
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















1001 Quotient
Divisor 1000 1001010 Dividend
10 Remainder (or Modulo result)
See how big a number can be subtracted, creating quotient bit on each step Binary => 1 * divisor or 0 * divisor
Dividend = Quotient x Divisor + Remainder => | Dividend | = | Quotient | + | Divisor |
3 versions of divide, successive refinement
2b. Restore the original value by adding the Divisor register to the Remainder register, & place the sum in the Remainder register. Also shift the Quotient register to the left, setting the new least significant bit to 0.
Takes n+1 steps for n-bit Quotient & Rem.
Remainder Quotient Divisor 0000 0111 0000 0010 0000
Test Remainder
Remainder ≥ 0 Remainder < 0
2a. Shift the Quotient register to the left setting the new rightmost bit to 1.
Done
Yes: n+1 repetitions (n = 4 here)
Start: Place Dividend in Remainder
n+ repetition?
No: < n+1 repetitions
01010 Quotient
Divisor 0001 00001010 Dividend 00001
3b. Restore the original value by adding the Divisor register to the left half of the Remainder register, &place the sum in the left half of the Remainder register. Also shift the Quotient register to the left, setting the new least significant bit to 0.
Test Remainder
Remainder ≥ (^0) Remainder < 0
3a. Shift the Quotient register to the left setting the new rightmost bit to 1.
Done
Yes: n repetitions (n = 4 here)
nth repetition?
No: < n repetitions
Start: Place Dividend in Remainder
3b. Restore the original value by adding the Divisor register to the left half of the Remainder register, &place the sum in the left half of the Remainder register. Also shift the Remainder register to the left, setting the new least significant bit to 0.
Test Remainder
Remainder ≥ 0 Remainder < 0
3a. Shift the Remainder register to the left setting the new rightmost bit to 1.
Done. Shift left half of Remainder right 1 bit.
Yes: n repetitions (n = 4 here)
nth repetition?
No: < n repetitions
Start: Place Dividend in Remainder
6.02 x 10 1.673 x 10
Sign, magnitude
Sign, magnitude
IEEE F.P. ± 1.M x 2
e - 127
Representation of floating point numbers in IEEE 754 standard:
single precision
excess 127 binary integer
sign + magnitude, normalized binary significand w/ hidden integer bit: 1.M
actual exponent is e = E - 127
Magnitude of numbers that can be represented is in the range:
(1.0) (^) to 2
which is approximately:
1.8 x 10
to 3.40 x 10
1.xxxxx 1.xxxxx 1.xxxxx
1x.xxxxy 1.xxxxxyyy 1x.xxxxyyy
post-normalization pre-normalization pre and post
Guard Digits: digits to the right of the first p digits of
Normalized result, but some non-zero digits to the right of the significand --> the number should be rounded
E.g., B = 10, p = 3: 0 2 1.
0 0 7.
0 2 1.
2-bias
2-bias
2-bias
one round digit must be carried to the right of the guard digit so that after a normalizing left shift, the result can be rounded, according to the value of the round digit
four rounding modes: round to nearest even (default) round towards plus infinity round towards minus infinity round towards 0 round to nearest: round digit < B/2 then truncate
B/2 then round up (add 1 to ULP: unit in last place) = B/2 then round to nearest even digit