- 2073 Shrawan · 8 marks
Signed division and non-restoring division
Short answer
Signed division: signs are handled separately; quotient sign = Sd XOR Sv, remainder sign = sign of dividend. Magnitudes are divided non-restoringly. For 15÷4, with n=4, Q=1111, M=00100, the non-restoring algorithm yields quotient=3 (0011), remainder=3 (00011).
Explain the signed binary division algorithm. Use the non-restoring division algorithm to divide 15 by 4.
Signed binary division
Division of signed integers is done on the magnitudes (sign-magnitude method), and the signs are handled separately:
- Store the sign of the dividend (Sd) and of the divisor (Sv), and take the absolute values.
- Divide the magnitudes with the restoring or non-restoring algorithm to get the quotient Q and remainder R.
- Quotient sign = Sd XOR Sv (negative if the signs differ).
- Remainder sign = sign of the dividend, so that dividend = divisor × quotient + remainder.
- If the dividend and divisor are in 2's complement, convert negative values to positive before step 2 and convert the results back at the end.
- Check for divide overflow: the divisor must not be 0, and the quotient must fit in the register.
Non-restoring algorithm
- Load A = 0, Q = dividend, M = divisor, SC = n.
- If the sign of A is 0 (A ≥ 0): shift A,Q left, then A = A − M. If the sign of A is 1 (A < 0): shift A,Q left, then A = A + M.
- If the new A is non-negative, set Q0 = 1; otherwise set Q0 = 0.
- SC = SC − 1. Repeat from step 2 until SC = 0.
- If A < 0 at the end, correct the remainder: A = A + M.
- Q is the quotient and A is the remainder.
15 ÷ 4
Both numbers are positive, so no sign handling is needed. Q = 15 = 1111, M = 4 = 00100 (A and M have n + 1 = 5 bits), n = 4.
Step Action A Q
- Initial 00000 1111
1 Shift left A,Q 00001 1110
A>=0 before shift: A = A - M (=-3) 11101 1110 (Q0=0)
2 Shift left A,Q 11011 1100
A<0 before shift: A = A + M (=-1) 11111 1100 (Q0=0)
3 Shift left A,Q 11111 1000
A<0 before shift: A = A + M (=3) 00011 1001 (Q0=1)
4 Shift left A,Q 00111 0010
A>=0 before shift: A = A - M (=3) 00011 0011 (Q0=1)
The final A is positive, so no remainder correction is needed.
Answer: 15 ÷ 4: quotient = 3 (0011), remainder = 3 (00011)
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Non-restoring division of 10 by 5 · Computer Organization and Architecture, chapter 5
- Non-restoring division with flowchart · Computer Organization and Architecture, chapter 5 · asked 3×
- Restoring vs non-restoring division · Computer Organization and Architecture, chapter 5 · asked 5×
- Restoring division algorithm and hardware · Computer Organization and Architecture, chapter 5 · asked 2×
- Restoring division of 31 by 13 · Computer Organization and Architecture, chapter 5
- Restoring division of 10 by 3 · Computer Organization and Architecture, chapter 5
- Signed 1's complement addition of (-65)+(+15) · Digital Logic, chapter 5
- Binary search with algorithm and example · Data Structure and Algorithm, chapter 8 · asked 4×
- Need for non-uniform quantization; one algorithm · Communication Systems, chapter 4
All Computer Organization and Architecture chapter 5 questions →