- Asked 4/22
- 2073 Chaitra · 4 marks
- 2072 Chaitra · 4 marks
- 2071 Chaitra · 4 marks
- 2068 Chaitra · 6 marks
Floating point division algorithm
Short answer
Sign = sx xor sy. Exponent e = ex - ey + bias. If dividend mantissa ≥ divisor mantissa, shift dividend right and increment e. Divide mantissas, normalize and round. Example: 0.1111×2⁴ ÷ 0.1100×2² = 0.101×2³ = 5.
Draw the flowchart and explain the algorithm for division of floating point numbers.
For floating-point numbers X = mx × 2^ex and Y = my × 2^ey, the quotient is X / Y = (mx / my) × 2^(ex - ey). The mantissas are divided (as in fixed-point division) and the exponents are subtracted.
Algorithm
- Check for zeros: if the dividend X is 0, the result is 0. If the divisor Y is 0, signal a divide-by-zero error.
- Initialise the registers and find the sign: result sign = sign(X) xor sign(Y).
- Subtract the exponents: e = ex - ey, then add the bias back (for biased exponents: e = ex - ey + bias).
- Align the dividend: with fractional mantissas (0.1xxx form, as in Mano), if the mantissa of the dividend is greater than or equal to that of the divisor, shift the dividend right and increase the exponent by 1, so that the quotient mantissa is less than 1 and does not overflow.
- Divide the mantissas (restoring or non-restoring division) to get the quotient mantissa.
- Normalise the quotient and round it. Check for exponent overflow or underflow.
Start
|
X = 0? --yes--> result 0
| no
Y = 0? --yes--> divide error
| no
sign = sx xor sy
e = ex - ey + bias
|
mx >= my? --yes--> shift mx right, e = e + 1
| no
Divide mantissas (q = mx / my)
|
Normalise, round
|
Exponent overflow/underflow? --yes--> error
| no
Stop
Example
X = 0.1111 × 2⁴ (15), Y = 0.1100 × 2² (3), with fractional mantissas.
- Exponent: e = 4 - 2 = 2.
- Align: mx = 0.1111 ≥ my = 0.1100, so shift mx right: 0.01111 × 2⁵, and e = 2 + 1 = 3.
- Mantissas: 0.01111 ÷ 0.1100 = 0.46875 ÷ 0.75 = 0.625 = 0.101 (already normalised).
- Result = 0.101 × 2³ = 0.625 × 8 = 5 ✓ (15 ÷ 3 = 5).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Non-restoring division with flowchart · Computer Organization and Architecture, chapter 5 · asked 3×
- Floating point addition and subtraction · Computer Organization and Architecture, chapter 5 · asked 6×
- Floating point multiplication · Computer Organization and Architecture, chapter 5 · asked 3×
- Restoring division flowchart · Computer Organization and Architecture, chapter 5
- Restoring division algorithm and hardware · Computer Organization and Architecture, chapter 5 · asked 2×
- Signed division and non-restoring division · Computer Organization and Architecture, chapter 5
- Algorithm and flowchart for largest · Computer Programming, chapter 2
- Algorithm for numbers divisible by 9 not 6 · Computer Programming, chapter 2
- Algorithm and flowchart: quadratic roots · Computer Programming, chapter 2
- Algorithm and flowchart: distance between points · Computer Programming, chapter 2
All Computer Organization and Architecture chapter 5 questions →