All 22 questions UPSC has asked on combinational circuits in the Electrical Engineering Optional (Paper I, Digital Electronics) from 1996 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Digital Electronics topic-wise PYQs page. Circuit diagrams have been redrawn from the question papers.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the numbers were worked out again independently in code (SymPy and NumPy: circuit equations, power balance, matrices, integrals).
- ✓ Answer checked step by step for theory and descriptive questions, every point was checked against the standard theory.
Where a printed question is wrong, unclear or incomplete, we say so and solve the intended version.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 1d 2025 · 3a 2024 · 1d 2024 · 3c 2024 · 4c 2023 · 3a(ii) 2022 · 1e 2022 · 8a(ii) 2021 · 4b 2013 · 5e 2011 · 5a 2010 · 3a(ii) 2009 · 5b 2006 · 1b(iv) 2005 · 1b(i) 2005 · 3a(iii) 2003 · 8a(i) 2002 · 7a 2001 · 3a(i) 2000 · 5b(i) 1997 · 5b 1996 · 8c
A combinational logic circuit consisting of two numbers of 2 to 4 decoders is shown in the figure below: In this circuit, are the inputs and to are the outputs of the first decoder, while are the inputs and to are the outputs of the second decoder. Determine the logic expressions for and in terms of and .
Solution
Note. We take the first-named input of each decoder as the more significant bit (A1 for the first, A2 for the second), as is usual.
First decoder. Only one output is high at a time:
The gates. and are never 1 together, so and are always complements, so the second decoder only ever sees or .
Second decoder.
| X | Y | ||||
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
So (XOR) and (XNOR). and are always 0.
✓ Checked by computer We traced all four input combinations through both decoders in code.
Consider the Boolean function: Implement it with a 4-to-1 multiplexer and external gates. Connect inputs A and B to the selection lines. Input to the four data lines is a function of the variables C and D which are obtained by expressing F as a function of C and D for each of the four cases when AB = 00, 01, 10 and 11. Functions are to be implemented with external gates.
Solution
Split by AB. With A, B on the select lines, each data input is F as a function of C and D:
| AB | Minterms of F in this group | CD values with F = 1 | Data input |
|---|---|---|---|
| 00 | 1, 3 | 01, 11 | |
| 01 | 4 | 00 | |
| 10 | 11 | 11 | |
| 11 | 12, 13, 14, 15 | all |
Implementation. One NOR gate for and one AND gate for :
Check: , which gives exactly minterms 1, 3, 4, 11, 12–15.
✓ Checked by computer We split the minterms into the four AB groups in code.
A Binary Coded Decimal (BCD) code is to be transmitted to a remote receiver. Bits are arranged as . Design a circuit at the receiving end which has an error detector to check the legal BCD code and produce a HIGH for any error condition.
Solution
Illegal codes. A BCD digit runs from 0000 to 1001. The six codes 1010 to 1111 (10 to 15) are errors.
K-map simplification. The error output E is 1 for minterms 10–15. These are all the codes with and either (12–15) or (10, 11, 14, 15):
Circuit. One OR gate and one AND gate. E goes HIGH for any illegal code.
✓ Checked by computer We checked the detector against all 16 codes in code.
Find the logic equations for the outputs in the concise form and write the corresponding truth table for the circuit given below:
Solution
Gate outputs. Let be the output of .
Concise form. Simplifying each:
- , so .
- , so .
- .
- , so .
Truth table (outputs active LOW):
| 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 0 |
The circuit is a 2-to-4 line decoder with active-LOW outputs: goes LOW for input .
✓ Checked by computer We evaluated every gate output for the four input combinations in code.
A circuit using three 2-input multiplexers is shown below. Determine the function performed by this circuit:
Solution
Note. The figure does not say which data input each 2-input MUX passes for S = 0. We take the upper input as the one selected when S = 1 (consistent with and drawn on top).
First level (select ): and .
Second level (select ): .
Combining:
| Z | ||
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
The circuit is a 4-to-1 multiplexer, with as the more significant select bit and as the less significant one. (With the opposite input convention it is still a 4-to-1 multiplexer; only the order of the inputs changes.)
✓ Checked by computer We traced all select combinations through the three multiplexers in code.
Use multiplexer and logic gates to implement the function:
Solution
Split by AB (A, B on the select lines; C, D generate the data inputs):
| AB | Minterms in group | CD with F = 1 | Data input |
|---|---|---|---|
| 00 | 3 | 11 | |
| 01 | 4, 5, 6, 7 | all | |
| 10 | 9, 10 | 01, 10 | |
| 11 | 12, 14, 15 | 00, 10, 11 |
For AB = 11 the zero is only at CD = 01, so .
Gates needed: one AND, one XOR, one OR (with one inverter for ).
✓ Checked by computer We split the minterms into the four AB groups in code.
Explain the parity bit generator and parity bit checker. Realize the even parity bit generator and even parity bit checker using X-OR gate.
Solution
Parity. A parity bit P is added to a message so that the total number of 1s is even (even parity) or odd (odd parity). The receiver counts the 1s again; a single-bit error changes the count and is detected.
Even parity generator (3-bit message A, B, C). P must be 1 when the message has an odd number of 1s:
| A | B | C | P |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Even parity checker. The receiver XORs all four received bits: E = 0 when the received word has even parity (no error) and E = 1 when the parity is odd (error detected).
The same XOR tree serves both purposes. An odd parity generator or checker simply adds an inverter at the output.
✓ Answer checked step by step We checked the generator and checker truth tables step by step.
Draw the diagram of cascading BCD adders to add two three-digit decimal numbers. Also explain the function of this adder with suitable example.
Solution
One BCD adder. Each stage adds two BCD digits and the incoming carry with a 4-bit binary adder, giving a binary sum and carry . If the result exceeds 9 it is corrected by adding 6 (0110): K is the decimal carry to the next stage, and when K = 1 a second 4-bit adder adds 0110 to Z.
Cascading for three digits. Three such stages are chained, the carry of each going to the next more significant digit:
Example: 459 + 367.
| Digit | Binary sum (with carry) | > 9? | After correction | Digit, carry out |
|---|---|---|---|---|
| Units: 9 + 7 | 1 0000 (16) | yes ( = 1) | 0000 + 0110 = 0110 | 6, carry 1 |
| Tens: 5 + 6 + 1 | 1100 (12) | yes ( = 1) | 1100 + 0110 = 1 0010 | 2, carry 1 |
| Hundreds: 4 + 3 + 1 | 1000 (8) | no | 1000 | 8, carry 0 |
Result: 826, correct. The carry out of the hundreds stage would be the thousands digit.
✓ Checked by computer We worked the example digit by digit and checked the total in code.
(i) Verify by determining the logic equation for the output and by constructing the truth table for the logic circuit shown in Figure 4(b). (ii) Use an 8 to 1 multiplexer and logic gates to implement the following function:
Solution
Note. In part (i) we take each 2-to-1 MUX to pass its upper input (, , …) when , as the labels 0 and 1 in the figure show. In part (ii) we read “20, 21, …, 28, 29, 30, 31” as all minterms from 20 to 31.
(i) Each 2-to-1 MUX gives . The 4-to-1 MUX picks one of these by . So
| Y | |||
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 0 | 1 | |
| 0 | 1 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 1 | 1 | 1 |
This verifies that the circuit is an 8-to-1 multiplexer with select .
(ii) A, B, C go to the select lines. For each ABC, the data input is F as a function of D and E:
| ABC | Minterms | DE with F = 1 | Data input |
|---|---|---|---|
| 000 | 0, 1, 2 | 00, 01, 10 | |
| 001 | 4–7 | all | |
| 010 | none | — | |
| 011 | 13, 14 | 01, 10 | |
| 100 | none | — | |
| 101 | 20–23 | all | |
| 110 | 24–27 | all | |
| 111 | 28–31 | all |
One NAND gate and one XOR gate are needed.
✓ Checked by computer We checked the multiplexer tree and the 8-to-1 implementation against the truth tables in code.
Draw a block diagram to implement logic using a multiplexer.
Solution
Method. Connect A and B to the select lines. The output equals the data input chosen by AB, so we put F’s truth-table value on each input:
| A | B | Input selected | Value |
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 1 | 0 | |
| 1 | 0 | 0 | |
| 1 | 1 | 1 |
So (ground) and (), giving .
✓ Answer checked step by step We checked the four rows step by step.
Implement the following: (i) Half-adder using basic gates (ii) flip-flop using – flip-flop (iii) 2 to 4 decoder using 1×4 demultiplexers.
Solution
(i) Half adder using basic gates.
| A | B | Sum S | Carry C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
and .
(ii) T flip-flop from a JK flip-flop. Tie J and K together and call the common input T.
- T = 0: J = K = 0, so the flip-flop holds ().
- T = 1: J = K = 1, so it toggles ().
This is exactly the T flip-flop: .
(iii) 2-to-4 decoder from a 1×4 demultiplexer. A demultiplexer sends its data input to the output chosen by the select lines. Tie the data input to logic 1 (it acts as an enable) and use A, B as the select inputs. The selected output becomes 1 and the others stay 0, which is a 2-to-4 decoder: , , , .
✓ Answer checked step by step We checked each circuit against its truth table step by step.
Design a binary to Gray code converter.
Solution
Rule. The most significant Gray bit equals the binary bit; each other Gray bit is the XOR of the binary bit and the next more significant one.
Truth table (4 bits).
| Binary | Gray | Binary | Gray |
|---|---|---|---|
| 0000 | 0000 | 1000 | 1100 |
| 0001 | 0001 | 1001 | 1101 |
| 0010 | 0011 | 1010 | 1111 |
| 0011 | 0010 | 1011 | 1110 |
| 0100 | 0110 | 1100 | 1010 |
| 0101 | 0111 | 1101 | 1011 |
| 0110 | 0101 | 1110 | 1001 |
| 0111 | 0100 | 1111 | 1000 |
K-maps for each Gray bit give
Circuit. Three XOR gates:
✓ Checked by computer We checked the converter against all 16 codes in code.
Realize a half-adder circuit using only NOR gates.
Solution
Target. and .
Carry. By De Morgan, , a NOR of and . Each complement is a NOR gate with its inputs tied: .
Sum. . So S is a NOR of (one more NOR gate) and , which we already have.
Circuit: five NOR gates.
Here the NOR gate fed by the two inverters gives C; the output gate gives S.
| A | B | C | S | |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 |
✓ Checked by computer We checked the NOR circuit on all four inputs in code.
Design a 2-input, 3-output circuit which can be used as half adder or half subtractor by choosing output points.
Solution
Half adder and half subtractor side by side (subtractor computes A − B):
| A | B | Sum / Difference | Carry | Borrow |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 |
Sum and Difference are the same function, . So the circuit needs three outputs:
Using X and Y gives a half adder; using X and Z gives a half subtractor. The gates are one XOR, one AND, and one AND with an inverter on A:
✓ Answer checked step by step We checked both truth tables step by step.
Design a combinational circuit that accepts a three-bit number and generates an output binary number equal to the square of the input number.
Solution
Truth table. Input (A most significant) from 0 to 7; the square goes up to 49, so six output bits are needed.
| A B C | N | |||||||
|---|---|---|---|---|---|---|---|---|
| 0 0 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 0 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
| 0 1 0 | 2 | 4 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 1 1 | 3 | 9 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 0 0 | 4 | 16 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 0 1 | 5 | 25 | 0 | 1 | 1 | 0 | 0 | 1 |
| 1 1 0 | 6 | 36 | 1 | 0 | 0 | 1 | 0 | 0 |
| 1 1 1 | 7 | 49 | 1 | 1 | 0 | 0 | 0 | 1 |
Minimized outputs (from 3-variable K-maps):
Circuit. is a wire from C, is tied to 0, and the other four outputs need two AND gates (, ), one XOR and one AND (), and one OR and one AND with an inverter on B (). (An odd number squared always ends in binary 01, and an even one in 00, which is why is always 0.)
✓ Checked by computer We derived and minimized each output bit in code.
Implement the Boolean function with an multiplexer with A, B and D connected to selection lines , , , respectively.
Solution
Method. The minterm number is . With A, B, D on , each data input is F as a function of C alone (the two minterms in each pair differ only in C):
| A B D | Minterms (C = 0, C = 1) | F | Input |
|---|---|---|---|
| 0 0 0 | 0, 2 | 1, 0 | |
| 0 0 1 | 1, 3 | 1, 1 | |
| 0 1 0 | 4, 6 | 1, 0 | |
| 0 1 1 | 5, 7 | 0, 0 | |
| 1 0 0 | 8, 10 | 1, 0 | |
| 1 0 1 | 9, 11 | 1, 0 | |
| 1 1 0 | 12, 14 | 0, 0 | |
| 1 1 1 | 13, 15 | 0, 1 |
Only one inverter (for ) is needed besides the multiplexer.
✓ Checked by computer We split the minterms by A, B, D in code.
Using multiplexers, implement a full adder circuit.
Solution
Full adder. Inputs A, B, carry-in ; outputs and .
Two 4-to-1 multiplexers with A, B on the select lines:
| A B | S | |
|---|---|---|
| 0 0 | 0 | |
| 0 1 | ||
| 1 0 | ||
| 1 1 | 1 |
So the Sum MUX has inputs and the Carry MUX has inputs :
Only one inverter is needed. (Two 8-to-1 multiplexers with A, B, on the selects and constants on the data inputs would also work.)
✓ Checked by computer We checked both multiplexer outputs against the full-adder truth table in code.
Devise a 4-bit odd parity generator function using 3-level NOT-NOR-NOR logic.
Solution
Note. We read “odd parity generator” as the circuit that produces the parity bit P that makes the total number of 1s (four data bits plus P) odd.
Function. P = 1 when the data word has an even number of 1s: Its complement is 1 for the eight odd-weight words, minterms 1, 2, 4, 7, 8, 11, 13, 14. No two of these are adjacent on a K-map, so
Why NOT-NOR-NOR fits. A NOR gate fed with complemented literals is an AND gate: . A final NOR then gives the complement of the OR of these products, .
The three levels.
- Level 1 (NOT): four inverters give .
- Level 2 (eight 4-input NORs): each product term of is a NOR of the complements of its literals. For example, :
| Gate | Product term | NOR inputs |
|---|---|---|
| (1) | A, B, C, | |
| (2) | A, B, , D | |
| (4) | A, , C, D | |
| (7) | A, , , | |
| (8) | , B, C, D | |
| (11) | , B, , | |
| (13) | , , C, | |
| (14) | , , , D |
- Level 3 (one 8-input NOR): .
So P = 0 whenever the data has an odd number of 1s, and P = 1 otherwise, which makes the five-bit word always odd. (A two-level XOR tree is simpler in practice, but the question asks for NOT-NOR-NOR.)
✓ Checked by computer We listed the odd-weight minterms and checked the NOT-NOR-NOR circuit in code.
This question has two parts.
(i) Draw the truth table of an octal-to-binary encoder with the condition that the output F = 1 when at least one of the inputs is a 1. The octal input with highest number has the highest priority. What is the condition of binary outputs and F output, if the inputs ?
(ii) Design a combinational circuit using AND gates and half adders that can multiply two 2-bit numbers and to produce 4-bit number , , and .
Solution
(i) Octal-to-binary priority encoder ( has the highest priority; F = 1 when any input is 1).
| x | y | z | F | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | × | × | × | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | × | 0 | 0 | 1 | 1 |
| 0 | 0 | 0 | 0 | 0 | 1 | × | × | 0 | 1 | 0 | 1 |
| 0 | 0 | 0 | 0 | 1 | × | × | × | 0 | 1 | 1 | 1 |
| 0 | 0 | 0 | 1 | × | × | × | × | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | × | × | × | × | × | 1 | 0 | 1 | 1 |
| 0 | 1 | × | × | × | × | × | × | 1 | 1 | 0 | 1 |
| 1 | × | × | × | × | × | × | × | 1 | 1 | 1 | 1 |
(× = don’t care.) The output equations are
With : has the higher priority, so the output is xyz = 101 (octal 5) and F = 1.
(ii) 2-bit × 2-bit multiplier.
Writing out the multiplication, the partial products are , in the first row and , in the second row, shifted one place left. Adding the columns:
- (one AND gate).
- : a half adder adds and ; its carry moves on.
- , : a second half adder adds and ; its sum is and its carry is .
Four AND gates and two half adders in all. Example: ().
✓ Checked by computer We checked the encoder equations on all 256 input patterns and the multiplier on all 16 products in code.
This question has two parts.
(i) Design a combinational circuit having 3 inputs and 6 outputs with the condition that the output number is square of the input number.
(ii) A computer uses RAM chips of capacity 1024 × 1. How many chips are required and how their address and data bus be connected to provide a memory capacity of 1024 bytes? How chips would be connected to provide memory of 16 K bytes?
Solution
(i) Square of a 3-bit number. This is the same design as the 2005 question above. With input and output :
| N | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| 000000 | 000001 | 000100 | 001001 | 010000 | 011001 | 100100 | 110001 |
(ii) Building memory from 1024 × 1 chips.
1024 bytes (1024 × 8). Each chip stores 1 bit of 1024 words, so 8 chips are needed, one per data bit.
- Address bus: – (10 lines, since ) go to all 8 chips in parallel.
- Data bus: chip connects to data line ().
- The chip-select (and R/W) lines of all 8 chips are tied together, so they act as one 1 K × 8 memory.
16 K bytes (16384 × 8). Number of chips 128 chips, arranged as 16 rows (banks) of 8 chips.
- Each row is a 1 K × 8 block as above.
- Address lines – go to every chip.
- The four extra address lines – (since K) drive a 4-to-16 decoder. Each decoder output enables the chip-select of one row.
- Data line connects to chip of every row (the outputs are tri-state, so only the selected row drives the bus).
✓ Checked by computer We minimized the square circuit and counted the memory chips in code.
It is desired to add two one-bit binary words and produce the result as Sum and Carry. Prepare a truth table, Karnaugh map and Boolean expressions to design a Half-Adder using minimum number of NAND gates.
Solution
Truth table.
| A | B | Sum | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
K-maps. Sum has 1s at the two diagonal cells (01, 10), which cannot be grouped: . Carry has a single 1 at 11: .
Minimum NAND form. Let . Then because and . And So the shared gate serves both outputs: five NAND gates in all (four for the sum, one more as an inverter for the carry).
✓ Checked by computer We checked the five-NAND circuit on all four inputs in code.
Design a combinational logic circuit to generate the 2’s complement of a 2-bit number. You may use two full adders and other gates as required but keeping the number of other gates to a minimum.
Solution
Idea. The 2’s complement is “invert every bit and add 1”. So invert and with two NOT gates and add 1 using the two full adders.
Circuit. adds + 1 with carry-in 0; adds + 0 + the carry from . The final carry is ignored.
| Value | Inverted | +1 | Output | Check | |
|---|---|---|---|---|---|
| 00 | 0 | 11 | 1 00 | 00 | −0 = 0 |
| 01 | 1 | 10 | 11 | 11 | −1 ≡ 3 |
| 10 | 2 | 01 | 10 | 10 | −2 ≡ 2 |
| 11 | 3 | 00 | 01 | 01 | −3 ≡ 1 |
Only two extra gates (the inverters) are used. In fact the outputs simplify to and , which shows why the full-adder version works.
✓ Checked by computer We checked all four 2-bit inputs in code.
More on Digital Electronics
- All Electrical Engineering PYQ solutions, topic by topic
- Digital Electronics topic-wise PYQs (questions only, for practice)
- Electrical Engineering PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Electrical Engineering booklist
Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper I, 1996–2026. Solutions: Optional Province. Found an error? Tell us.

