GATE Computer ScienceHardGATE CS

A 4-bit non-restoring divider divides the unsigned dividend Q = 1101 (13) by the divisor M = 0011 (3). The accumulator A is 5 bits wide (two's complement) and starts at 0. In each of the 4 iterations: shift the pair (A, Q) left by one bit; then if A was negative before the shift add M to A, otherwise subtract M from A; finally set the new least significant bit of Q to 1 if A is now non-negative and to 0 if A is negative. After the third iteration (before any final correction), what is the signed value of A?

  1. A. −2
  2. B. −3
  3. C. 1
  4. D. 0

Correct answer: B. −3

Iteration 1: A = 1 − 3 = −2, Q0 = 0. Iteration 2: shift gives A = −3, add M gives 0, Q0 = 1. Iteration 3: shift gives A = 0, subtract M gives −3, Q0 = 0. Iteration 4 would leave A = −2, and the final correction A + M = 1 is the remainder with quotient 0100 = 4.

More Computer Organization and Architecture questions

Exams that ask this topic