- Asked 3/22
- 2078 Bhadra · 5 marks
- 2075 Chaitra · 3 marks
- 2070 Chaitra · 8 marks
Non-restoring division with flowchart
Short answer
Non-restoring division avoids restoring negative partial remainders by adding the divisor after a shift if the remainder is negative. It repeats n times: shift left, then add or subtract divisor based on sign of partial remainder. In the example 11÷3, quotient = 3, remainder = 2.
Explain the non-restoring division along with its algorithm, flowchart and example.
Non-restoring division is a division method that avoids the restore step of restoring division. When a subtraction gives a negative remainder, it is not restored; instead the next step adds the divisor. This is because restoring (A + M), shifting (× 2) and subtracting M gives 2(A + M) - M = 2A + M, which is one addition after shifting.
Registers
A (n + 1 bits, initially 0): partial remainder. Q (n bits): dividend, then quotient. M (n bits): divisor. Counter = n.
Algorithm
- A = 0, Q = dividend, M = divisor, count = n.
- Repeat n times:
- If the sign of A is 0 (positive): shift A:Q left one bit, then A = A - M.
- If the sign of A is 1 (negative): shift A:Q left one bit, then A = A + M.
- If the new sign of A is 0, set Q0 = 1; else Q0 = 0.
- Decrement count.
- After n steps: if A is negative, A = A + M (correct the remainder).
- Quotient is in Q, remainder is in A.
Flowchart
Start: A=0, count=n
|
v
A >= 0? --yes--> shift AQ left ; A = A - M
| no |
+--> shift AQ left ; A = A + M --+
v
A >= 0 ? --yes--> Q0 = 1
--no --> Q0 = 0
v
count = count - 1
v
count = 0? --no--> (repeat)
| yes
A < 0 ? --yes--> A = A + M
v
Stop
Example: 11 ÷ 3 (n = 4)
Dividend Q = 1011, M = 0011, A = 00000 (negative values are shown with a minus sign).
| Step | Shift AQ left: A | Q | Operation | A (new) | Q0 set | Q |
|---|---|---|---|---|---|---|
| init | 00000 | 1011 | ||||
| 1 | 00001 | 0110 | A = A - M | -00010 | 0 | 0110 |
| 2 | -00100 | 1100 | A = A + M | -00001 | 0 | 1100 |
| 3 | -00001 | 1000 | A = A + M | 00010 | 1 | 1001 |
| 4 | 00101 | 0010 | A = A - M | 00010 | 1 | 0011 |
Final A is positive (2), so no correction is needed.
Quotient = 0011 = 3, remainder = 2. Check: 3 × 3 + 2 = 11. ✓
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- 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
- Restoring vs non-restoring division · Computer Organization and Architecture, chapter 5 · asked 5×
- Non-restoring division of 10 by 5 · Computer Organization and Architecture, chapter 5
- Restoring division of 31 by 13 · Computer Organization and Architecture, chapter 5
- Algorithm and flowchart for largest · Computer Programming, chapter 2
- Algorithm and flowchart: quadratic roots · Computer Programming, chapter 2
- Algorithm and flowchart: distance between points · Computer Programming, chapter 2
- Algorithm and flowchart help; Armstrong flowchart · Computer Programming, chapter 2
All Computer Organization and Architecture chapter 5 questions →