36. Restoring Divider Iteration

Loading simulator…

  1. Create the combined shift

    Form the 5-bit shifted partial remainder:

    R_SHIFT = {R[3:0], Q[3]}
    

    Connect:

    Q[3] -> SUB_FA0
    R[0] -> SUB_FA1
    R[1] -> SUB_FA2
    R[2] -> SUB_FA3
    R[3] -> SUB_FA4
    
  2. Perform the trial subtraction

    The supplied Full Adders implement:

    TRIAL = R_SHIFT + NOT(D_EXT) + 1
          = R_SHIFT - D_EXT
    

    D[3:0] passes through the supplied NOT gates.
    SUB_FA0.Ci = 1 provides the +1 for two's-complement subtraction.
    The fifth divisor bit is 0, so its complemented value is 1 at SUB_FA4.

  3. Detect the trial-result sign

    The MSB of the 5-bit trial result is:

    NEG = TRIAL[4]
    

    Connect the SUB_FA4 sum output to the predefined NEG distribution network.
    This signal drives the restore-MUX selection and the quotient-bit inverter.

    SUB_FA4.Co is intentionally unused because the restore decision uses TRIAL[4].

  4. Select the next remainder

    Connect R_SHIFT[3:0] to the restore inputs of the four MUXes.

    The other MUX inputs already receive TRIAL[3:0], so:

    NEG = 0 -> R_NEXT = TRIAL[3:0]
    NEG = 1 -> R_NEXT = R_SHIFT[3:0]
    

    A negative trial therefore restores the shifted remainder.

  5. Generate the next quotient

    Complete the quotient routing:

    Q_NEXT[3] = Q[2]
    Q_NEXT[2] = Q[1]
    Q_NEXT[1] = Q[0]
    Q_NEXT[0] = NOT(NEG)
    

    A successful subtraction inserts 1; a restored subtraction inserts 0.