Design of arithmetic and logic unit (ALU)
GATE CS50 min read
ALU role and datapath signals
Definition. An arithmetic and logic unit performs selected operations on input operands and produces a result plus status information. Control signals select operations such as add, subtract, AND, OR, XOR, compare, or shift. The ALU is part of a datapath; registers, buses, multiplexers, and control logic supply operands and use its result.
Example. An ALU may choose when opcode is 000 and when opcode is 010.
Exam point. Operation code determines function; operand width and signedness determine interpretation.
Bitwise logic operations
Definition. Bitwise AND, OR, XOR, and NOT apply Boolean operations independently at each bit position. They do not propagate carries. For an -bit word, each output has the same width, with any unused high bits governed by the operation's definition.
Example. .
Exam point. Distinguish bitwise logic from logical truth-value operations on an entire word.
Solved calculation. Compute AND, OR, and XOR of and .
- AND each bit: 100001.
- OR each bit: 111111.
- XOR each bit: 011110.
- The results are six bits because both operands are six bits. Answer. AND=100001, OR=111111, XOR=011110.
Binary addition in an ALU
Definition. An -bit adder adds two bit vectors and a carry-in. Each bit uses propagate/generate behavior; sum is XOR of the operands and carry-in. The low result bits are retained, while carry-out and signed overflow are separate status conditions.
Example. Four-bit , yielding result 0000 and carry-out 1.
Exam point. Report the result width and flags independently.
Solved calculation. Add unsigned 8-bit values 01101101 and 00111011.
- From the least significant end: 1+1=0, carry 1.
- Next bit: 0+1+1=0, carry 1.
- Continue full addition: .
- The operands sum to 168, which fits in 8 unsigned bits, so carry-out is 0. Answer. 10101000, carry-out 0.
Full-adder equations
Definition. A full adder computes and . Equivalently, carry-out is the majority of . Cascading full adders forms a ripple-carry adder.
Example. For inputs 1,0,1, sum is 0 and carry is 1.
Exam point. Carry is generated by both operand bits or propagated from the prior position.
Solved calculation. Find sum and carry for bit inputs .
- .
- .
- .
- . Answer. Sum 0, carry-out 1.
Ripple-carry adder
Definition. A ripple-carry adder connects each stage's carry-out to the next stage's carry-in. Its area is approximately linear in bit width for a fixed gate implementation, but the worst-case carry delay also grows with width. It is simple and appropriate when timing requirements allow the propagation delay.
Example. A 4-bit ripple adder uses four carry stages to form a 4-bit sum and final carry.
Exam point. The longest carry chain determines the worst-case delay, not a typical input pattern.
Solved calculation. An 8-bit ripple adder has 2 ns carry delay per stage. Estimate worst-case carry-out delay when eight stages are serial.
- Carry must pass through eight stages in the simplified model.
- Delay is ns.
- This omits input arrival and sum-generation delay, which are not specified. Answer. 16 ns under the stated model.
Carry propagate and generate
Definition. Define and . Then . A group of bits can compute whether it generates a carry independently of the input carry and whether it propagates a carry through the group, enabling faster lookahead structures.
Example. forces carry-out to 1 even when carry-in is 0.
Exam point. Some texts define propagate as ; state the convention and use it consistently.
Solved calculation. For two low bits, let and with .
- .
- .
- The high bit generates carry regardless of C1. Answer. .
You have read the free 28% of this note
Sign in with Google to keep reading. It is free, takes one tap, and you also get:
- 6 practice questions from this note
- Every note in full, plus the PDF library
- Official past papers as timed tests, with explanations
- An AI tutor for doubts, in Hindi or English
- Your progress, mistakes and study plan saved on every device