Coa Unit 2 Notes
Coa Unit 2 Notes
si = xi ⊕ yi ⊕ ci
and
ci+1 = Gi + Pici
where
Gi = xiyi and Pi = xi + yi
The expressions Gi and Pi are called the generate and propagate functions for stage i.
If the generate function for stage i is equal to 1, then ci+1 = 1, independent of the input carry ci .
This occurs when both xi and yi are 1.
The propagate function means that an input carry will produce an output carry when either xi is
1 or yi is 1.
All Gi and Pi functions can be formed independently and in parallel in one logic-gate delay
after the X and Y operands are applied to the inputs of an n-bit adder.
Each bit stage contains an AND gate to form Gi , an OR gate to form Pi , and a three-input XOR
gate to form si .
A simpler circuit can be derived by observing that an adequate propagate function can be realized as
Pi = xi ⊕ yi , which differs from Pi = xi + yi only when xi = yi = 1. But, in this case Gi = 1, so it does
not matter whether Pi is 0 or 1. Then, using a cascade of two 2-input XOR gates to realize the 3-input
XOR function for si , the basic B cell in Figure-6 can be used in each bit stage.
Thus, all carries can be obtained three gate delays after the input operands X , Y , and c0 are applied
because only one gate delay is needed to develop all Pi and Gi signals, followed by two gate delays in
the AND-OR circuit for ci+1. After a further XOR gate delay, all sum bits are available. In total, the n-
bit addition process requires only four gate delays, independent of n.
The complete 4-bit adder is shown in Figure-7. The carries are produced in the block labelled carry-
lookahead logic. An adder implemented in this form is called a carry-lookahead adder. Delay through
the adder is 3 gate delays for all carry bits and 4 gate delays for all sum bits. In comparison, a 4-bit
ripple-carry adder requires 7 gate delays for s3 and 8 gate delays for c4.
An n-bit positive divisor is loaded into register M and an n-bit positive dividend is loaded into register
Q at the start of the operation. Register A is set to 0. After the division is complete, the n-bit quotient
is in register Q and the remainder is in register A.
The required subtractions are facilitated by using 2’s-complement arithmetic. The extra bit position at
the left end of both A and M accommodates the sign bit during subtractions. The following algorithm
performs restoring division.
Do the following three steps n times:
1. Shift A and Q left one-bit position.
2. Subtract M from A, and place the answer back in A.
3. If the sign of A is 1, set q0 to 0 and add M back to A (that is, restore A); otherwise, set q0 to 1.