---
title: "Signed division and non-restoring division"
subject: "Computer Organization and Architecture"
chapter: 5
key: "semester_5/computer_organization_and_architecture:nonrestoring-division"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/nonrestoring-division
site: BCT Engineering
---

# Signed division and non-restoring division

Computer Organization and Architecture · Chapter 5: Computer Arithmetic

- Asked in: 2073 Shrawan, 8 marks
- Video: [Non Restoring Division Algorithm: Flowchart and Example | COA](https://www.youtube.com/watch?v=je7RSR6w37c) — Engineering Funda
- 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/nonrestoring-division
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-5

## Question

Explain the signed binary division algorithm. Use the non-restoring division algorithm to divide 15 by 4.

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

## Answer

#### Signed binary division

Division of signed integers is done on the magnitudes (sign-magnitude method), and the signs are handled separately:

1. Store the sign of the dividend (Sd) and of the divisor (Sv), and take the absolute values.
2. Divide the magnitudes with the restoring or non-restoring algorithm to get the quotient Q and remainder R.
3. **Quotient sign** = Sd XOR Sv (negative if the signs differ).
4. **Remainder sign** = sign of the dividend, so that dividend = divisor × quotient + remainder.
5. 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.
6. Check for divide overflow: the divisor must not be 0, and the quotient must fit in the register.

#### Non-restoring algorithm

1. Load A = 0, Q = dividend, M = divisor, SC = n.
2. 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.
3. If the new A is non-negative, set Q0 = 1; otherwise set Q0 = 0.
4. SC = SC − 1. Repeat from step 2 until SC = 0.
5. If A < 0 at the end, correct the remainder: A = A + M.
6. 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.

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

## Check yourself

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

1. In sign-magnitude signed division, the quotient sign is:
   A. Sign of dividend XOR sign of divisor
   B. Sign of divisor
   C. Always positive
   D. Sign of dividend AND divisor
   Answer: A. The quotient is negative when the signs differ. (Key point: Signed division sign rules)

2. The remainder takes the sign of:
   A. The dividend
   B. The divisor
   C. The quotient
   D. Always positive
   Answer: A. So that dividend = divisor x quotient + remainder. (Key point: Remainder sign)

3. What divide-overflow checks are made?
   A. Divisor not 0 and quotient fits in the register
   B. Dividend not 0
   C. Both operands equal
   D. Remainder is zero
   Answer: A. Divide by zero or a too-large quotient must be flagged. (Key point: Overflow check)

4. If A >= 0 before the shift in non-restoring division:
   A. Shift left then A = A - M
   B. Shift left then A = A + M
   C. Restore
   D. Add M without shift
   Answer: A. Negative A uses A + M. (Key point: Non-restoring rule)

5. 15 / 4 gives:
   A. Quotient 3, remainder 3
   B. Quotient 4, remainder 0
   C. Quotient 3, remainder 1
   D. Quotient 2, remainder 7
   Answer: A. 4 x 3 + 3 = 15; final A = 3 is positive. (Key point: Result 15 / 4)

## Related in Computer Organization and Architecture

- [Non-restoring division of 10 by 5](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Anonrestoring-10-5) — Computer Organization and Architecture, chapter 5
- [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×
- [Restoring vs non-restoring division](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Arestoring-vs-nonrestoring) — Computer Organization and Architecture, chapter 5, asked 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×
- [Restoring division of 31 by 13](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Arestoring-31-13) — Computer Organization and Architecture, chapter 5
- [Restoring division of 10 by 3](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Arestoring-10-3) — Computer Organization and Architecture, chapter 5

## Related in other subjects

- [Signed 1's complement addition of (-65)+(+15)](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aones-complement-addition-8bit) — Digital Logic, chapter 5
- [Binary search with algorithm and example](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Abinary-search-algorithm-example) — Data Structure and Algorithm, chapter 8, asked 4×
- [Need for non-uniform quantization; one algorithm](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Anonuniform-quantization-algorithm) — Communication Systems, chapter 4
