---
title: "Floating point division algorithm"
subject: "Computer Organization and Architecture"
chapter: 5
key: "semester_5/computer_organization_and_architecture:fp-division"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/fp-division
site: BCT Engineering
---

# Floating point division algorithm

Computer Organization and Architecture · Chapter 5: Computer Arithmetic

- Asked in: 2073 Chaitra, 4 marks; 2072 Chaitra, 4 marks; 2071 Chaitra, 4 marks; 2068 Chaitra, 6 marks (asked 4 times)
- Video: [Floating Point Division Algorithm - Floating Point Arithmetic - Computer Organization Architecture](https://www.youtube.com/watch?v=Lr8fVFdUG1g) — Sudhakar Atchala
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/fp-division
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-5

## Question

Draw the flowchart and explain the algorithm for division of floating point numbers.

## 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.

## Answer

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
1. **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.
2. **Initialise the registers** and find the sign: result sign = sign(X) xor sign(Y).
3. **Subtract the exponents:** e = ex - ey, then add the bias back (for biased exponents: e = ex - ey + bias).
4. **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.
5. **Divide the mantissas** (restoring or non-restoring division) to get the quotient mantissa.
6. **Normalise** the quotient and **round** it. Check for exponent overflow or underflow.

```text
 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).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. For X / Y, what is done to mantissas and exponents?
   A. Mantissas divided, exponents subtracted
   B. Mantissas multiplied, exponents added
   C. Mantissas subtracted, exponents divided
   D. Both added
   Answer: A. X/Y = (mx/my) x 2^(ex - ey). (Key point: Exponent and mantissa operations)

2. What happens if the divisor is 0 or the dividend is 0?
   A. Dividend 0: result 0; divisor 0: divide-by-zero error
   B. Both give result 0
   C. Both give error
   D. Both give 1
   Answer: A. Zero dividend gives zero; zero divisor signals error. (Key point: Zero checks)

3. If mx >= my, what is done?
   A. Shift the dividend right and increase the exponent by 1 to avoid quotient overflow
   B. Shift left and decrease exponent
   C. Swap operands
   D. Report error
   Answer: A. The requirement is mx < my so that the quotient fits. (Key point: Alignment of dividend)

4. With biased exponents the result exponent is:
   A. ex - ey + bias
   B. ex + ey - bias
   C. ex - ey - bias
   D. ex + ey + bias
   Answer: A. Subtraction cancels the bias, so it is added back once. (Key point: Biased exponent)

## Related in Computer Organization and Architecture

- [Non-restoring division with flowchart](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Anonrestoring-explain) — Computer Organization and Architecture, chapter 5, asked 3×
- [Floating point addition and subtraction](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Afp-add-sub) — Computer Organization and Architecture, chapter 5, asked 6×
- [Floating point multiplication](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Afp-multiplication) — Computer Organization and Architecture, chapter 5, asked 3×
- [Restoring division flowchart](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Arestoring-flowchart) — Computer Organization and Architecture, chapter 5
- [Restoring division algorithm and hardware](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Arestoring-division) — Computer Organization and Architecture, chapter 5, asked 2×
- [Signed division and non-restoring division](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Anonrestoring-division) — Computer Organization and Architecture, chapter 5

## Related in other subjects

- [Algorithm and flowchart for largest](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgorithm-flowchart-largest-n) — Computer Programming, chapter 2
- [Algorithm for numbers divisible by 9 not 6](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgo-flowchart-divisible-9-not-6) — Computer Programming, chapter 2
- [Algorithm and flowchart: quadratic roots](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgo-flowchart-quadratic) — Computer Programming, chapter 2
- [Algorithm and flowchart: distance between points](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgo-flowchart-distance) — Computer Programming, chapter 2
