How an ALU adds, subtracts, multiplies and shifts: ripple-carry and carry-lookahead adders and their delays, the adder-subtractor, overflow and status flags, and Booth's multiplication.
An -bit ripple-carry adder (RCA) chains full adders; each carry-out feeds the next carry-in. It is cheap ( full adders) but slow, because bit cannot settle until has rippled through all lower stages.
Delay model. Let one FA produce its carry after its inputs are ready and its sum after. All and are ready at time 0. Then
is ready at , so the final carry at ;
the last sum is ready at .
The addition is complete at the later of the two. Delay grows linearly in .
When the FA is drawn as two half adders plus an OR gate, is often 2 gate delays and 2 or 3, depending on how XOR is counted. Always use the delays the question gives.
4-bit ripple-carry adder: the carry passes through every stage, right to left
2. Carry-lookahead adder
A carry-lookahead adder (CLA) computes every carry directly from the inputs. Define for each bit
generate (this bit makes a carry by itself),
propagate (this bit passes an incoming carry on).
Then . Expanding,
Each carry is a two-level AND–OR expression, and .
Standard delay model (one gate = 1 unit, unlimited fan-in): at 1; every carry at ; every sum at 4. This is constant, independent of .
The catch is fan-in and gate count: needs an AND gate with inputs. So real designs use 4-bit CLA blocks. If the blocks are joined by rippling carries, block 's carry-out appears 2 units after its carry-in. A second lookahead level (block generate and block propagate ) removes even that ripple.
Adder
Delay
Hardware
Ripple carry
full adders
Full CLA
levels, large fan-in
grows quickly with
CLA blocks, rippled
moderate
Multi-level CLA
moderate
3. Adder-subtractor, overflow and flags
Subtraction uses . An adder-subtractor feeds each through an XOR gate with a control line , and also sets :
: XOR passes , , result ;
: XOR inverts , , result .
Signed overflow (two's complement) happens when two operands of the same sign give a result of the other sign. In hardware,
the carry into the sign bit XOR the carry out of it. Adding numbers of opposite signs never overflows.
Unsigned results: on addition, carry-out means the true sum did not fit. On subtraction , carry-out means (no borrow).
Status flags set by the ALU:
Flag
Set when
Z (zero)
result is all zeros
N or S (sign)
result's MSB is 1
C (carry)
carry out of the MSB
V (overflow)
signed overflow,
Shifts. A logical right shift brings in 0; an arithmetic right shift copies the sign bit, so it divides a signed number by 2 rounding towards . A left shift by one multiplies by 2 (overflow if the sign bit changes).
4. Multiplication and Booth's algorithm
Shift-and-add multiplication adds the shifted multiplicand once for every 1 bit of the multiplier. It handles unsigned numbers directly.
Booth's algorithm multiplies two's complement numbers and skips over runs of 1s. Append to the right of the multiplier . Scan pairs from the LSB:
Action
Recoded digit
0 0
shift only
0
1 1
shift only
0
1 0
subtract multiplicand, shift
0 1
add multiplicand, shift
All shifts are arithmetic right shifts of the combined accumulator and multiplier register.
A run of 1s from bit up to bit equals , so it costs one subtraction and one addition however long it is. For example recodes to , that is .
Best case: long runs of 0s or 1s, very few operations.
Worst case: alternating bits such as , where every position is an add or subtract, so operations for an -bit multiplier (worse than shift-and-add's count of 1 bits).
Count of add/subtract operations = number of nonzero digits in the Booth recoding = number of positions where .
Formulas to remember
Full adder sum
Full adder carry
Generate and propagate
Ripple-carry delay
Signed overflow
Subtraction
Common mistakes
Taking the final carry time as the total delay of a ripple adder; the last sum bit can finish later.
Treating carry-out 1 as signed overflow; signed overflow is .
Forgetting that Booth's worst case is alternating bits, not all 1s.
Assuming a CLA has constant delay for any width; fan-in limits force blocks, and rippled blocks add 2 delays each.
Doing a logical right shift on a signed number when the question says arithmetic shift.
Worked examples
Try each step yourself, then reveal the working.
Example 1: Delay of a 16-bit ripple-carry adder
numerical
Each full adder produces its carry-out and its sum after its inputs are stable. All operand bits and are ready at time 0. When is a 16-bit ripple-carry addition complete?
Step 1: When does carry c_i become stable?
Try it on paper first.
Example 2: 16-bit adder from 4-bit CLA blocks
numerical
A 16-bit adder uses four 4-bit carry-lookahead blocks; the carry-out of each block ripples into the next. Inside a block, take 1 gate delay, a carry takes 2 more gate delays after its inputs are ready, and a sum takes 1 more after its carry. How many gate delays until all sum bits are ready?
Step 1: Find the carry-out of the first block.
Try it on paper first.
Example 3: Booth recoding saves operations
numerical
The multiplier is the 8-bit number 00111100. How many additions and subtractions does Booth's algorithm perform, and how many additions does plain shift-and-add perform?
Step 1: Append a 0 to the right of the LSB and list the pairs.
Try it on paper first.
Example 4: Detecting overflow from the carries
conceptual
In 4-bit two's complement, add (i) and (ii) . Which one overflows, and how does the hardware know?
Step 1: Add (i) bit by bit and note the last two carries.
Try it on paper first.
Previous year questions
2 official GATE CSE questions on this topic, newest first.
10 questions: up to 2 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.
Mark as mastered
Loading your progress…
My revision notes
Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.