Skip to main content

Restoring division flowchart

Short answer

Initialize A=0, Q=dividend, M=divisor, SC=n. Loop n times: shift left A,Q; A = A − M. If A<0: Q0 = 0 and restore A = A + M; else Q0 = 1. Decrement SC. Quotient ends in Q, remainder in A.

Draw the flowchart for the restoring division method.

The flowchart of restoring division (A = remainder register, Q = dividend/quotient, M = divisor, SC = number of bits):

     +----------------------+
     | A=0, Q=dividend      |
     | M=divisor, SC=n      |
     +----------+-----------+
                v
     +----------------------+<--------------+
     | Shift left A,Q       |               |
     | A = A - M            |               |
     +----------+-----------+               |
                v                           |
            A < 0 ?                         |
        Yes /       \ No                    |
           v         v                      |
     +----------+ +----------+              |
     | Q0 = 0   | | Q0 = 1   |              |
     | A = A+M  | |          |              |
     +----+-----+ +-----+----+              |
          +------+------+                   |
                 v                          |
            SC = SC - 1                     |
                 v                          |
             SC = 0 ? ---- No --------------+
                 | Yes
                 v
     Quotient = Q, Remainder = A

Restoring means adding M back to A when A − M is negative, so that A again holds the previous partial remainder. Only after n cycles are the quotient (Q) and remainder (A) final.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 5 questions →