How unit 2 is examined
Adders and subtractors, MUX/DEMUX, encoders/decoders and arithmetic circuits; the marks sit in the multiplexer, the encoder-decoder and the full adder, with the half adder, full subtractor and arithmetic circuits next.
Combinational Logic: Half adder
Medium weight
Definition. A combinational circuit is one whose output depends only on the present inputs (no memory), and a half adder is the combinational circuit that adds two 1-bit numbers and gives a Sum and a Carry.
Key points.
- A half adder has inputs A, B and outputs Sum and Carry.
- Sum is 1 when exactly one input is 1, so $S = A \oplus B$.
- Carry is 1 only when both inputs are 1, so $C = AB$.
- It has no carry input, so it cannot add a carry from a lower bit; hence the full adder.
- NAND-only, it takes five gates: $n_1=\overline{AB}$, $n_2=\overline{An_1}$, $n_3=\overline{Bn_1}$, $S=\overline{n_2n_3}$, $C=\overline{n_1n_1}$.
Truth table (A B -> Sum Carry): 00 -> 0 0; 01 -> 1 0; 10 -> 1 0; 11 -> 0 1.
Diagram.
Answer frame. Open with the definition; give the truth table and $S$, $C$; draw XOR + AND (or the NAND diagram); explain the four cases; close by noting it has no carry-in.
Asked: [7 marks] (Dec 2020) Design Half adder using NAND gates. Also draw the diagram. Asked: [7 marks] (Dec 2023) Design a Half adder circuit with truth table and logic diagrams.
Half subtractor
Not asked since 2022
Definition. A half subtractor subtracts one 1-bit number from another (A - B) and gives a Difference and a Borrow.
Key points.
- Difference is $D = A \oplus B$.
- Borrow is $Bo = \bar A B$, because a borrow is needed only when 0 is reduced by 1.
- Its truth table is 00 -> D0 Bo0; 01 -> D1 Bo1; 10 -> D1 Bo0; 11 -> D0 Bo0 (rows A B).
- It differs from the half adder only in the inverter on A in the borrow term.
Full adder
High weight
Definition. A full adder is a combinational circuit that adds three 1-bit inputs, A, B and the carry-in $C_{in}$, and produces a Sum and a carry-out $C_{out}$.
Design steps.
Step 1: Specify: add A, B, Cin to give Sum and Cout.
Step 2: Write the 8-row truth table.
Step 3: Simplify Sum and Cout with K-maps.
Step 4: Draw the gate circuit.
Truth table (A B Cin -> Sum Cout): 000 -> 0 0; 001 -> 1 0; 010 -> 1 0; 011 -> 0 1; 100 -> 1 0; 101 -> 0 1; 110 -> 0 1; 111 -> 1 1.
Formula. $$S = A \oplus B \oplus C_{in}, \qquad C_{out} = AB + C_{in}(A \oplus B)$$
Key points.
- Sum is 1 when an odd number of inputs are 1, which is the three-input XOR.
- Cout is 1 when at least two inputs are 1: $AB + BC_{in} + AC_{in} = AB + C_{in}(A\oplus B)$.
- Two half adders and an OR gate make a full adder: the first adds A and B, the second adds its sum to $C_{in}$, and the OR merges the two carries.
- It is required because every bit position except the first receives a carry, and only a full adder accepts it; n of them cascaded form a ripple-carry n-bit adder.
Diagram.
Example. Add $1010_2 + 1011_2$ (10 + 11), starting with carry 0 at the LSB.
| Bit | A | B | Cin | Sum | Cout |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 1 | 1 | 0 | 0 | 1 |
The last carry becomes bit 4, so the result is $10101_2 = 21$.
Answer frame. Open with the definition; give the truth table and derive Sum and Cout; draw two half adders plus OR; for the numerical go column by column as above; close with the need for cascading.
Pitfall: In the addition example, write the carry out of the last column as the fifth bit; dropping it gives 0101.
Asked: [7 marks] (Nov 2019, Jun 2023) Write steps of designing a full adder circuit; what is an adder circuit; design and implement a full adder using two half adders and an OR gate. Asked: [7 marks] (Dec 2020) Explain the addition of $1010_2$ to $1011_2$ using full adder step by step. Asked: [7 marks] (Dec 2025) Explain the working of a Full Adder with truth table and logic diagram. Why is it required in arithmetic circuits?
Full subtractor
Medium weight
Definition. A full subtractor is a combinational circuit that subtracts B and the borrow-in $B_{in}$ from A and produces a Difference and a borrow-out $B_{out}$.
Truth table (A B Bin -> D Bout): 000 -> 0 0; 001 -> 1 1; 010 -> 1 1; 011 -> 0 1; 100 -> 1 0; 101 -> 0 0; 110 -> 0 0; 111 -> 1 1.
Formula. $$D = A \oplus B \oplus B_{in}, \qquad B_{out} = \bar A B + B_{in}\,\overline{(A \oplus B)}$$
Key points.
- A combinational circuit has outputs that depend only on present inputs and has no memory.
- Difference is 1 when an odd number of inputs are 1, like the full-adder Sum.
- Borrow is 1 when A is smaller than B plus the incoming borrow: $\bar AB + \bar AB_{in} + BB_{in}$.
- It is built from two half subtractors and an OR gate.
- The NAND-only circuit has nine NAND gates: $n_1=\overline{AB}$, $n_2=\overline{An_1}$, $n_3=\overline{Bn_1}$, $x=\overline{n_2n_3}$, $n_5=\overline{xB_{in}}$, $n_6=\overline{xn_5}$, $n_7=\overline{B_{in}n_5}$, $D=\overline{n_6n_7}$, $B_{out}=\overline{n_3n_7}$.
Diagram.
Answer frame. Open with the definition; give the truth table; derive D and Bout; draw two half subtractors plus OR, or the nine NANDs above; close by comparing with the full adder.
Asked: [7 marks] (Dec 2024) Draw a full subtractor circuit using NAND gate. Asked: [7 marks] (May 2019) What is combinational circuit? Explain full subtractor.
Look-ahead carry generator
Not asked since 2022
Definition. A carry look-ahead generator computes all the carries of an adder directly from the inputs, without waiting for the carry to ripple through each stage.
Key points.
- Define generate $G_i = A_iB_i$ and propagate $P_i = A_i \oplus B_i$; then $C_{i+1} = G_i + P_iC_i$ and $S_i = P_i \oplus C_i$.
- Expanding gives $C_1 = G_0 + P_0C_0$ and $C_2 = G_1 + P_1G_0 + P_1P_0C_0$.
- Likewise $C_3 = G_2 + P_2G_1 + P_2P_1G_0 + P_2P_1P_0C_0$, and every carry is a two-level AND-OR function of the inputs.
- All carries appear after about three gate delays whatever the width, so it is much faster than ripple carry, at the cost of more gates.
BCD adder
Low weight
Definition. A BCD adder adds two BCD digits (0-9) and a carry-in and gives a BCD digit with a carry.
Key points.
- The first 4-bit binary adder adds the digits, giving sum $S_3S_2S_1S_0$ and carry K.
- The result is invalid if it exceeds 9 or K = 1, so $C_{out} = K + S_3S_2 + S_3S_1$.
- When $C_{out}$ = 1 the second adder adds $0110_2$ (6); otherwise it adds 0000.
- Example: 8 + 9 gives 10001 with K = 1; adding 0110 to 0001 gives 0111, so the answer is 0001 0111 = 17.
Diagram.
Asked: [7 marks] (Jun 2023) Draw and explain the BCD adder circuit.
Series and parallel addition
Low weight
Definition. A serial adder adds one bit pair per clock using a single full adder, while a parallel adder adds all bits at the same time with one full adder per bit.
Key points.
- A serial adder has shift registers, one full adder and a carry flip-flop, and needs n clocks for n bits; it is cheap but slow.
- Parallel adders are ripple carry, carry look-ahead, carry save and carry select.
- A ripple-carry adder chains full adders, so its delay grows with n.
- A carry look-ahead adder forms every carry from $G_i$ and $P_i$, so its delay is nearly independent of n.
- A carry save adder adds three numbers with independent full adders and outputs a sum word and a carry word without propagating; one ordinary adder combines them, which suits multi-operand addition and multipliers.
Asked: [7 marks] (Dec 2023) What are the different types of parallel adders? Explain carry save and carry look-ahead adders.
Multiplexer and demultiplexer
High weight
Definition. A multiplexer (data selector) is a combinational circuit that routes one of $2^n$ data inputs to a single output under the control of n select lines; a demultiplexer does the reverse, sending one input to one of $2^n$ outputs.
Key points.
- A $2^n\times1$ MUX has $2^n$ data inputs, n select lines, an optional enable and one output.
- Its roles are data routing, parallel-to-serial conversion and implementing Boolean functions.
- For 4:1, $Y = \bar S_1\bar S_0I_0 + \bar S_1S_0I_1 + S_1\bar S_0I_2 + S_1S_0I_3$.
- For 8:1, $Y = \sum_{k=0}^{7} m_kI_k$ with $m_k$ the minterm of $S_2S_1S_0$.
- Inside, a decoder picks one line, AND gates gate the data, and an OR gate merges them.
- An 8:1 MUX from two 4:1: both share $S_1S_0$ and $S_2$ drives a 2:1 MUX (or OR) that picks the group.
- A demultiplexer is a decoder whose enable is the data input; the selects choose the output.
- As a ROM, the selects are the address, the data inputs are tied to stored bits 0 or 1, and the output is the stored bit.
Truth table: for select code $S_2S_1S_0$ = 000, 001, ..., 111 the output Y equals $I_0, I_1, \dots, I_7$ respectively.
Diagram.
Steps (implementing a function).
Step 1: For n variables use a 2^(n-1):1 MUX; the first n-1 variables are selects, the last is data.
Step 2: List minterms in pairs (2r, 2r+1) under each select code.
Step 3: Input = 0 if none present, 1 if both, the data variable if only the odd one, its complement if only the even one.
Example. $f(A,B,C,D)=\sum(0,1,5,7,10,14,15)$ on an 8:1 MUX with A, B, C as selects and D as data.
| ABC | Minterms present | Input |
|---|---|---|
| 000 | 0, 1 | $I_0 = 1$ |
| 001 | none | $I_1 = 0$ |
| 010 | 5 (D=1) | $I_2 = D$ |
| 011 | 7 (D=1) | $I_3 = D$ |
| 100 | none | $I_4 = 0$ |
| 101 | 10 (D=0) | $I_5 = \bar D$ |
| 110 | none | $I_6 = 0$ |
| 111 | 14, 15 | $I_7 = 1$ |
So $I_0=1,\ I_1=0,\ I_2=D,\ I_3=D,\ I_4=0,\ I_5=\bar D,\ I_6=0,\ I_7=1$; connect these to the 8:1 MUX with A, B, C on $S_2S_1S_0$.
Variants: for $F=\sum m(1,3,6,7)$ on a 4:1 MUX (selects A, B): $I_0=C$, $I_1=C$, $I_2=0$, $I_3=1$. For $f=\pi(1,4,6,10,14)+d(0,8,11,15)$ the minterms are $\sum(2,3,5,7,9,12,13)+d(0,8,11,15)$; the 16:1 MUX inputs $I_0..I_{15}$ are $x,0,1,1,0,1,0,1,x,1,0,x,1,1,0,x$ (x = don't care, tie to 0 or 1); on an 8:1 MUX with A, B, C as selects, $I_0..I_7 = 0,1,D,D,1,D,1,D$.
Answer frame. For "explain 8:1": define, draw the block with $I_0$-$I_7$, $S_2S_1S_0$, enable and Y, give the truth table and expression, then the roles. For "design 8:1 from smaller": draw the diagram above and show which select drives which stage. For "implement a function": prepare the table, read off the data inputs, draw the connections. Close with one line on uses.
Pitfall: Pair the minterms by the last variable ($2r$ and $2r+1$) and never by the select code alone; mis-pairing gives wrong data inputs.
Asked: [7 marks] (Nov 2019, Nov 2022) How to design a $8\times 1$ MUX using two $4\times 1$ MUX (or one $4\times 1$ and four $2\times 1$ MUX)? Draw the circuit. Asked: [7 marks] (May 2019, Dec 2024) What is a Multiplexer? Explain 8:1 multiplexer with its truth table and expression; explain its role and how it selects one input. Asked: [7 marks] (Dec 2020) How a multiplexer can be used as ROM? Explain in brief. Asked: [7 marks] (Jun 2020, Jun 2023, Dec 2025) Implement $f(A,B,C,D)=\sum(0,1,5,7,10,14,15)$ using 8:1 MUX; realize $f=\pi(1,4,6,10,14)+d(0,8,11,15)$ using 16:1 and 8:1 MUX; implement $F(A,B,C)=\sum m(1,3,6,7)$ using 4:1 MUX.
Encoder and decoder
High weight
Definition. A decoder is a combinational circuit with n coded inputs and up to $2^n$ outputs of which exactly one is active for each input code; an encoder does the opposite, converting one active input line among many into a binary code on fewer outputs.
Key points.
- A 3-to-8 decoder has inputs A, B, C, enable E and outputs $Y_0..Y_7$, where $Y_i=m_i$ when E = 1.
- It uses three inverters and eight 3-input AND gates (NAND for active-low outputs): $Y_0=\bar A\bar B\bar C$, $Y_7=ABC$.
- With E inactive all outputs are off; enable lets small decoders combine into larger ones.
- For 1x2 + two 2x4: A drives the 1-to-2 decoder, its outputs enable the two 2-to-4 decoders, B and C go to both; the upper gives $Y_0$-$Y_3$ (A = 0), the lower $Y_4$-$Y_7$.
- A decoder plus OR gates realises any function: $F_1=\sum m(0,5,7)$ and $F_2=\sum m(1,3,6)$ give $F_1=Y_0+Y_5+Y_7$, $F_2=Y_1+Y_3+Y_6$.
- A BCD-to-decimal decoder has 4 inputs and 10 outputs, each a 4-input AND; codes 1010-1111 give no output.
- An encoder has one active input among many and n output bits; the decimal-to-BCD encoder uses OR gates: $A=D_8+D_9$, $B=D_4+D_5+D_6+D_7$, $C=D_2+D_3+D_6+D_7$, $D=D_1+D_3+D_5+D_7+D_9$.
- A priority encoder gives the highest-numbered active input priority when several are active.
- Decoders serve memory address decoding, data demultiplexing and seven-segment drivers.
Truth table: with E = 1, input code ABC = 000, 001, ..., 111 makes $Y_0, Y_1, \dots, Y_7$ = 1 respectively and all others 0; with E = 0 every output is 0.
Diagram.
Truth table (ABCD for the active input): D0 = 0000, D1 = 0001, D2 = 0010, D3 = 0011, D4 = 0100, D5 = 0101, D6 = 0110, D7 = 0111, D8 = 1000, D9 = 1001.
Answer frame. Decoder: define, draw the block (3 inputs, enable, 8 outputs), truth table, AND/NAND circuit, then enable and uses. 1x2 + 2x4: draw the diagram above with the combined truth table. Encoder: define, 10-to-4 table, four OR equations, OR-gate diagram. Two-function design: expand to minterms, decoder plus two OR gates.
Pitfall: In the decimal-to-BCD encoder, $D_0$ is not connected to any OR gate because all outputs are 0 for it.
Asked: [7 marks] (Nov 2019, Dec 2020) What is decoder? Design a $3\times 8$ decoder; design the binary to octal decoder and explain it with a block diagram. Asked: [7 marks] (May 2019, Dec 2025) What is Encoder? Explain decimal to BCD encoder; design a decimal-to-BCD encoder and explain its working. Asked: [7 marks] (Jun 2020) What is decoder? Explain BCD to decimal decoder. Asked: [7 marks] (Nov 2022) Design a $3\times 8$ decoder using one $1\times 2$ decoder and two $2\times 4$ decoders with Enable input. Asked: [7 marks] (Dec 2023) Design with a decoder and external gates: $F_1 = x'y'z' + xz$, $F_2 = xyz' + x'z$. Asked: [7 marks] (Dec 2024) Write a short note on decoder.
Arithmetic circuits
Medium weight
Definition. Arithmetic circuits are combinational circuits, such as adders, subtractors, the two's complementer and the adder-subtractor, that perform arithmetic on binary numbers.
Key points.
- Two's complement is $B=\bar A+1$: invert all bits and add 1.
- Bit by bit: $B_0=A_0$, $B_1=A_1\oplus A_0$, $B_2=A_2\oplus(A_1+A_0)$, $B_3=A_3\oplus(A_2+A_1+A_0)$.
- In NOR form each XNOR takes four NOR gates, and $n_1=\overline{A_1+A_0}$ is shared: $B_1$ = XOR of $A_1,A_0$ (four NOR from $n_1$), $B_2$ = XNOR($A_2,n_1$), and $B_3$ = XNOR($A_3,q$) with $q=\overline{A_2+A_1+A_0}$ = NOR($A_2$, NOR($n_1,n_1$)).
- $B_0$ is a wire, and the total is 15 NOR gates (checked for all 16 inputs).
- An adder-subtractor XORs B with a mode input M and uses M as carry-in: M = 1 gives A + B' + 1 = A - B.
Answer frame. Open with $B=\bar A+1$; write the four equations; convert each to NOR form sharing $n_1$; draw $A_3..A_0$ in, $B_3..B_0$ out; close with the gate count.
Asked: [7 marks] (Nov 2022) Draw a schematic for a minimal circuit that uses only NOR gates that performs the two's complement operation on a four bit input value. Let the input be $A_{3:0}$ and the output be $B_{3:0}$.
ALU
Not asked since 2022
Definition. An arithmetic logic unit is a combinational circuit that performs a selected arithmetic or logic operation on two n-bit operands.
Key points.
- Select lines choose the operation, such as add, subtract, AND, OR, XOR and NOT, and a mode input M separates arithmetic from logic operations.
- A 4-bit ALU such as the 74181 has 16 logic and 16 arithmetic functions, with a carry-in, carry-out and status flags.
- It combines an adder-subtractor, a logic unit and a multiplexer that picks the result, and it is the core of the CPU's data path.
Last-minute revision
- Half adder: $S = A\oplus B$, $C = AB$; 5 NAND gates.
- Full adder: $S = A\oplus B\oplus C_{in}$, $C_{out} = AB + C_{in}(A\oplus B)$; two half adders + OR.
- Full subtractor: $D = A\oplus B\oplus B_{in}$, $B_{out} = \bar AB + B_{in}\overline{(A\oplus B)}$; 9 NAND gates.
- $1010_2 + 1011_2 = 10101_2$ (21).
- CLA: $G_i = A_iB_i$, $P_i = A_i\oplus B_i$, $C_{i+1} = G_i + P_iC_i$.
- BCD adder: correct by adding 0110 when $K + S_3S_2 + S_3S_1 = 1$; 8 + 9 = 0001 0111.
- $2^n$:1 MUX has n selects; 8:1 from two 4:1 plus a 2:1 MUX driven by $S_2$.
- $f=\sum(0,1,5,7,10,14,15)$ on 8:1: $I_0..I_7 = 1,0,D,D,0,\bar D,0,1$ with ABC as selects and D as data.
- 3-to-8 decoder from 1-to-2 + two 2-to-4: A enables, BC common.
- Decimal-to-BCD: $A=D_8+D_9$, $B=D_4+D_5+D_6+D_7$, $C=D_2+D_3+D_6+D_7$, $D=D_1+D_3+D_5+D_7+D_9$.
- Two's complement: $B_1=A_1\oplus A_0$, $B_2=A_2\oplus(A_1+A_0)$, $B_3=A_3\oplus(A_2+A_1+A_0)$.
Memory hooks
- Half adder: XOR gives the sum, AND gives the carry; full adder = two halves + OR.
- Subtractor borrow: the inverter sits on A ($\bar A B$).
- MUX = many in, one out (selector); DEMUX and decoder = one in, many out.
- Encoder = OR gates, decoder = AND gates.
- BCD adder: "greater than 9, add 6".
Coverage checklist
- Combinational Logic: Half adder — Dec 2020 NAND half adder; Dec 2023 half adder design.
- Half subtractor — not asked recently; definition, D and Bo.
- Full adder — Nov 2019/Jun 2023 design steps and two-half-adder design; Dec 2020 1010+1011; Dec 2025 explain.
- Full subtractor — Dec 2024 NAND full subtractor; May 2019 combinational circuit and full subtractor.
- look- ahead carry generator — not asked recently; G, P and carry equations.
- BCD adder — Jun 2023 draw and explain.
- Series and parallel addition — Dec 2023 types of parallel adders, carry save, CLA.
- Multiplexer – demultiplexer — Nov 2019/Nov 2022 8:1 from smaller; May 2019/Dec 2024 explain 8:1; Dec 2020 MUX as ROM; Jun 2020/Jun 2023/Dec 2025 function implementations.
- encoder- decoder — Nov 2019/Dec 2020 3x8 decoder; May 2019/Dec 2025 decimal-to-BCD encoder; Jun 2020 BCD-to-decimal decoder; Nov 2022 1x2 + 2x4; Dec 2023 F1, F2; Dec 2024 short note.
- arithmetic circuits — Nov 2022 NOR two's complement.
- ALU — not asked recently; operations, select lines, 74181.