Menu Close

Combinational circuits: UPSC Electrical Engineering Optional PYQ Solutions (1996–2026)

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

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

A combinational logic circuit consisting of two numbers of 2 to 4 decoders is shown in the figure below: In this circuit, (A1,B1) are the inputs and (D0 to D3) are the outputs of the first decoder, while (A2,B2) are the inputs and (Y0 to Y3) are the outputs of the second decoder. Determine the logic expressions for Y1 and Y2 in terms of X and Y.

B1A1D3D2D1D02 to 4DecoderXYB2A2Y3Y2Y1Y02 to 4Decoder
Figure redrawn from the question paper.

2026 · Paper I · Q1d · 10 marks

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: D0=XY,D3=XY.

The gates. D0 and D3 are never 1 together, so A2=D0⊕D3=D0+D3=XY+XY=X⊙Y,B2=D0⊕D3=X⊕Y. A2 and B2 are always complements, so the second decoder only ever sees A2B2=10 or 01.

Second decoder. Y1=A2B2=(X⊕Y)(X⊕Y)=X⊕Y, Y2=A2B2=(X⊙Y)(X⊙Y)=X⊙Y=X⊕Y.

X Y A2 B2 Y1 Y2
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 Y1=X⊕Y (XOR) and Y2=X⊕Y (XNOR). Y0 and Y3 are always 0.

✓ Checked by computer We traced all four input combinations through both decoders in code.

↑ Back to the question list

Consider the Boolean function: F(A,B,C,D)=∑m(1,3,4,11,12,13,14,15) 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.

2025 · Paper I · Q3a · 20 marks

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 I0=D
01 4 00 I1=CD=C+D
10 11 11 I2=CD
11 12, 13, 14, 15 all I3=1

Implementation. One NOR gate for I1 and one AND gate for I2:

I3I2I1I0FAB4×1MUXDCDCD1ABF
F with a 4×1 MUX and two gates.

Check: F=ABD+ABCD+ABCD+AB, which gives exactly minterms 1, 3, 4, 11, 12–15.

✓ Checked by computer We split the minterms into the four AB groups in code.

↑ Back to the question list

A Binary Coded Decimal (BCD) code is to be transmitted to a remote receiver. Bits are arranged as A3A2A1A0. 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.

2024 · Paper I · Q1d · 10 marks

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 A3=1 and either A2=1 (12–15) or A1=1 (10, 11, 14, 15): E=A3A2+A3A1=A3(A2+A1).

Circuit. One OR gate and one AND gate. E goes HIGH for any illegal code.

EA3A2A1
BCD error detector.

✓ Checked by computer We checked the detector against all 16 codes in code.

↑ Back to the question list

Find the logic equations for the outputs in the concise form and write the corresponding truth table for the circuit given below:

D₀D₁G₁NG₂G₃G₄Y₁Y₂Y₀Y₃
Figure redrawn from the question paper.

2024 · Paper I · Q3c · 10 marks

Solution

Gate outputs. Let N be the output of G1. N=D0D1=Y3,Y1=D0N,Y2=ND1,Y0=NY1Y2.

Concise form. Simplifying each:

  • Y1=D0D0D1=D0D1, so Y1=D0D1.
  • Y2=D0D1, so Y2=D0D1.
  • Y3=D0D1.
  • Y0=NY1Y2, so Y0=NY1Y2=D0D1⋅D0D1⋅D0D1=D0D1.

Truth table (outputs active LOW):

D1 D0 Y0 Y1 Y2 Y3
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: Yn goes LOW for input n=2D1+D0.

✓ Checked by computer We evaluated every gate output for the four input combinations in code.

↑ Back to the question list

A circuit using three 2-input multiplexers is shown below. Determine the function performed by this circuit:

SMUXSMUXI₃I₂I₁I₀S₁SSSMUXZ₂Z₁S₀Z
Figure redrawn from the question paper.

2024 · Paper I · Q4c · 10 marks

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 I3 and I1 drawn on top).

First level (select S1): Z2=S1I3+S1I2 and Z1=S1I1+S1I0.

Second level (select S0): Z=S0Z2+S0Z1.

Combining: Z=S0S1I0+S0S1I1+S0S1I2+S0S1I3.

S0 S1 Z
0 0 I0
0 1 I1
1 0 I2
1 1 I3

The circuit is a 4-to-1 multiplexer, with S0 as the more significant select bit and S1 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.

↑ Back to the question list

Use 4:1 multiplexer and logic gates to implement the function: F(A,B,C,D)=Σm(3,4,5,6,7,9,10,12,14,15)

2023 · Paper I · Q3a(ii) · 10 marks

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 I0=CD
01 4, 5, 6, 7 all I1=1
10 9, 10 01, 10 I2=C⊕D
11 12, 14, 15 00, 10, 11 I3=C+D

For AB = 11 the zero is only at CD = 01, so I3=CD=C+D.

I3I2I1I0FAB4×1MUXCD1CDCD’ABF
F with a 4×1 MUX.

Gates needed: one AND, one XOR, one OR (with one inverter for D).

✓ Checked by computer We split the minterms into the four AB groups in code.

↑ Back to the question list

Explain the parity bit generator and parity bit checker. Realize the even parity bit generator and even parity bit checker using X-OR gate.

2022 · Paper I · Q1e · 10 marks

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

P=A⊕B⊕C.

PABC
Even parity generator.

Even parity checker. The receiver XORs all four received bits: E=A⊕B⊕C⊕P. E = 0 when the received word has even parity (no error) and E = 1 when the parity is odd (error detected).

EABCP
Even parity checker.

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.

↑ Back to the question list

Draw the diagram of cascading BCD adders to add two three-digit decimal numbers. Also explain the function of this adder with suitable example.

2022 · Paper I · Q8a(ii) · 10 marks

Solution

One BCD adder. Each stage adds two BCD digits and the incoming carry with a 4-bit binary adder, giving a binary sum Z and carry C4. If the result exceeds 9 it is corrected by adding 6 (0110): K=C4+Z8Z4+Z8Z2. 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:

BCD adder(hundreds)A₂B₂S₂carrycarry out(thousands)BCD adder(tens)A₁B₁S₁carryBCD adder(units)A₀B₀S₀0
Cascaded BCD adders for three-digit numbers (each A, B, S is a 4-bit BCD digit).

Example: 459 + 367.

Digit Binary sum (with carry) > 9? After correction Digit, carry out
Units: 9 + 7 1 0000 (16) yes (C4 = 1) 0000 + 0110 = 0110 6, carry 1
Tens: 5 + 6 + 1 1100 (12) yes (Z8Z4 = 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.

↑ Back to the question list

(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: F(A,B,C,D,E)=∑m(0,1,2,4,5,6,7,13,14,20,21,…,28,29,30,31)

I3I2I1I0YS2S14-to-1MUXI1I0OS02-to-1D₀D₁I1I0OS02-to-1D₂D₃I1I0OS02-to-1D₄D₅I1I0OS02-to-1D₆D₇S₀S₂S₁Y
Figure redrawn from the question paper.

2021 · Paper I · Q4b · 20 marks

Solution

Note. In part (i) we take each 2-to-1 MUX to pass its upper input (D0, D2, …) when S0=0, 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 S0D2k+S0D2k+1. The 4-to-1 MUX picks one of these by S2S1. So Y=S2S1S0D0+S2S1S0D1+S2S1S0D2+S2S1S0D3+S2S1S0D4+S2S1S0D5+S2S1S0D6+S2S1S0D7.

S2 S1 S0 Y
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 0 0 D4
1 0 1 D5
1 1 0 D6
1 1 1 D7

This verifies that the circuit is an 8-to-1 multiplexer with select S2S1S0.

(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 I0=DE
001 4–7 all I1=1
010 none — I2=0
011 13, 14 01, 10 I3=D⊕E
100 none — I4=0
101 20–23 all I5=1
110 24–27 all I6=1
111 28–31 all I7=1
I7I6I5I4I3I2I1I0FABC8×1MUXDE10DE0111ABCF
F with an 8×1 MUX.

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.

↑ Back to the question list

Draw a block diagram to implement logic F=A⋅B using a 4×1 multiplexer.

2013 · Paper I · Q5e · 10 marks

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 I0 0
0 1 I1 0
1 0 I2 0
1 1 I3 1
I3I2I1I0FAB4×1MUX0001ABF = AB
F = AB with a 4×1 MUX.

So I0=I1=I2=0 (ground) and I3=1 (VCC), giving F=AB.

✓ Answer checked step by step We checked the four rows step by step.

↑ Back to the question list

Implement the following: (i) Half-adder using basic gates (ii) T flip-flop using J–K flip-flop (iii) 2 to 4 decoder using 1×4 demultiplexers.

2011 · Paper I · Q5a · 15 marks

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

S=A⊕B=AB+AB and C=AB.

ABS = A ⊕ BC = AB
Half adder.

(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 (Qn+1=Qn).
  • T = 1: J = K = 1, so it toggles (Qn+1=Qn).

This is exactly the T flip-flop: Qn+1=TQn+TQn.

KJQ’QCLKJKflip-flopTClock
T flip-flop from a JK 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: D0=AB, D1=AB, D2=AB, D3=AB.

DY3Y2Y1Y0S1S01×4DEMUX1 (enable)ABD₀D₁D₂D₃
2-to-4 decoder from a 1×4 DEMUX.

✓ Answer checked step by step We checked each circuit against its truth table step by step.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Design a binary to Gray code converter.

2010 · Paper I · Q3a(ii) · 10 marks

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 B3B2B1B0 Gray G3G2G1G0 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 G3=B3,G2=B3⊕B2,G1=B2⊕B1,G0=B1⊕B0.

Circuit. Three XOR gates:

B₃B₂B₁B₀G₃G₂G₁G₀
4-bit binary-to-Gray converter.

✓ Checked by computer We checked the converter against all 16 codes in code.

↑ Back to the question list

Realize a half-adder circuit using only NOR gates.

2009 · Paper I · Q5b · 15 marks

Solution

Target. S=A⊕B and C=AB.

Carry. By De Morgan, C=AB=A+B, a NOR of A and B. Each complement is a NOR gate with its inputs tied: A=A+A.

Sum. A⊕B=(A+B)AB=A+B+AB. So S is a NOR of A+B (one more NOR gate) and C, which we already have.

Circuit: five NOR gates.

SABAABB
Half adder with NOR gates only.

Here the NOR gate fed by the two inverters gives C; the output gate gives S.

A B 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.

↑ Back to the question list

Design a 2-input, 3-output circuit which can be used as half adder or half subtractor by choosing output points.

2006 · Paper I · Q1b(iv) · 5 marks

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, A⊕B. So the circuit needs three outputs: X=A⊕B,Y=AB(carry),Z=AB(borrow).

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:

ABS = A ⊕ BC = AB
Half adder.
BorrowBA
Borrow output for the half subtractor.

✓ Answer checked step by step We checked both truth tables step by step.

↑ Back to the question list

Design a combinational circuit that accepts a three-bit number and generates an output binary number equal to the square of the input number.

2005 · Paper I · Q1b(i) · 10 marks

Solution

Truth table. Input ABC (A most significant) from 0 to 7; the square goes up to 49, so six output bits B5…B0 are needed.

A B C N N2 B5 B4 B3 B2 B1 B0
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): B0=C,B1=0,B2=BC, B3=ABC+ABC=C(A⊕B),B4=AB+AC=A(B+C),B5=AB.

Circuit. B0 is a wire from C, B1 is tied to 0, and the other four outputs need two AND gates (B2, B5), one XOR and one AND (B3), and one OR and one AND with an inverter on B (B4). (An odd number squared always ends in binary 01, and an even one in 00, which is why B1 is always 0.)

✓ Checked by computer We derived and minimized each output bit in code.

↑ Back to the question list

Implement the Boolean function F(A,B,C,D)Σ(0,1,3,4,8,9,15) with an 8×1 multiplexer with A, B and D connected to selection lines s2, s1, s0, respectively.

2005 · Paper I · Q3a(iii) · 5 marks

Solution

Method. The minterm number is m=8A+4B+2C+D. With A, B, D on s2,s1,s0, each data input IABD 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 I0=C
0 0 1 1, 3 1, 1 I1=1
0 1 0 4, 6 1, 0 I2=C
0 1 1 5, 7 0, 0 I3=0
1 0 0 8, 10 1, 0 I4=C
1 0 1 9, 11 1, 0 I5=C
1 1 0 12, 14 0, 0 I6=0
1 1 1 13, 15 0, 1 I7=C
I7I6I5I4I3I2I1I0FABD8×1MUXC’1C’0C’C’0CABDF
F with an 8×1 MUX (A, B, D on the selects).

Only one inverter (for C) is needed besides the multiplexer.

✓ Checked by computer We split the minterms by A, B, D in code.

↑ Back to the question list

Using multiplexers, implement a full adder circuit.

2003 · Paper I · Q8a(i) · 10 marks

Solution

Full adder. Inputs A, B, carry-in Cin; outputs S=A⊕B⊕Cin and Cout=AB+Cin(A⊕B).

Two 4-to-1 multiplexers with A, B on the select lines:

A B S Cout
0 0 Cin 0
0 1 Cin Cin
1 0 Cin Cin
1 1 Cin 1

So the Sum MUX has inputs (Cin,Cin,Cin,Cin) and the Carry MUX has inputs (0,Cin,Cin,1):

I3I2I1I0YAB4×1MUXCinCinCinCinABSI3I2I1I0YAB4×1MUX0CinCin1ABCout
Full adder from two 4×1 multiplexers.

Only one inverter is needed. (Two 8-to-1 multiplexers with A, B, Cin 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.

↑ Back to the question list

Devise a 4-bit odd parity generator function using 3-level NOT-NOR-NOR logic.

2002 · Paper I · Q7a · 20 marks

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: P=A⊕B⊕C⊕D. Its complement P 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 P=ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD.

Why NOT-NOR-NOR fits. A NOR gate fed with complemented literals is an AND gate: x+y+…=xy…. A final NOR then gives the complement of the OR of these products, P=P.

The three levels.

  • Level 1 (NOT): four inverters give A,B,C,D.
  • Level 2 (eight 4-input NORs): each product term of P is a NOR of the complements of its literals. For example, ABCD=A+B+C+D:
Gate Product term NOR inputs
N1 ABCD (1) A, B, C, D
N2 ABCD (2) A, B, C, D
N3 ABCD (4) A, B, C, D
N4 ABCD (7) A, B, C, D
N5 ABCD (8) A, B, C, D
N6 ABCD (11) A, B, C, D
N7 ABCD (13) A, B, C, D
N8 ABCD (14) A, B, C, D
  • Level 3 (one 8-input NOR): P=N1+N2+…+N8.

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.

↑ Back to the question list

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 D5=D3=1?

(ii) Design a combinational circuit using AND gates and half adders that can multiply two 2-bit numbers a1a0 and b1b0 to produce 4-bit number S3, S2, S1 and S0.

2001 · Paper I · Q3a(i) · 10 marks · also asked 2001 (Q3a(ii))

Solution

(i) Octal-to-binary priority encoder (D7 has the highest priority; F = 1 when any input is 1).

D7 D6 D5 D4 D3 D2 D1 D0 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 x=D4+D5+D6+D7,y=D7+D6+D5D4(D3+D2), z=D7+D6(D5+D4(D3+D2D1)),F=D0+D1+…+D7.

With D5=D3=1: D5 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 a1b0, a0b0 in the first row and a1b1, a0b1 in the second row, shifted one place left. Adding the columns:

  • S0=a0b0 (one AND gate).
  • S1: a half adder adds a1b0 and a0b1; its carry c1 moves on.
  • S2, S3: a second half adder adds a1b1 and c1; its sum is S2 and its carry is S3.
a₀b₀a₁b₀a₀b₁a₁b₁S₀yxCSHAS₁yxCSHAS₂S₃
2-bit binary multiplier.

Four AND gates and two half adders in all. Example: 11×11=1001 (3×3=9).

✓ Checked by computer We checked the encoder equations on all 256 input patterns and the multiplier on all 16 products in code.

↑ Back to the question list

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?

2000 · Paper I · Q5b(i) · 10 marks · also asked 2000 (Q5b(ii))

Solution

(i) Square of a 3-bit number. This is the same design as the 2005 question above. With input ABC and output B5…B0: B0=C,B1=0,B2=BC,B3=C(A⊕B),B4=A(B+C),B5=AB.

N 0 1 2 3 4 5 6 7
N2 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: A0–A9 (10 lines, since 210=1024) go to all 8 chips in parallel.
  • Data bus: chip k connects to data line Dk (k=0…7).
  • 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 =16384×81024×1= 128 chips, arranged as 16 rows (banks) of 8 chips.

  • Each row is a 1 K × 8 block as above.
  • Address lines A0–A9 go to every chip.
  • The four extra address lines A10–A13 (since 214=16 K) drive a 4-to-16 decoder. Each decoder output enables the chip-select of one row.
  • Data line Dk connects to chip k 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.

↑ Back to the question list

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.

1997 · Paper I · Q5b · 20 marks

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: S=AB+AB=A⊕B. Carry has a single 1 at 11: C=AB.

Minimum NAND form. Let N1=AB. Then S=AN1⋅BN1 because AN1=A(A+B)=AB and BN1=AB. And C=N1=N1⋅N1. So the shared gate N1 serves both outputs: five NAND gates in all (four for the sum, one more as an inverter for the carry).

ABSC
Half adder with five NAND gates.

✓ Checked by computer We checked the five-NAND circuit on all four inputs in code.

↑ Back to the question list

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.

1996 · Paper I · Q8c · 20 marks

Solution

Idea. The 2’s complement is “invert every bit and add 1”. So invert b1 and b0 with two NOT gates and add 1 using the two full adders.

Circuit. FA0 adds b0 + 1 with carry-in 0; FA1 adds b1 + 0 + the carry from FA0. The final carry is ignored.

Fulladderb₁0x₁Fulladderb₀1x₀carryCin = 0carry (ignored)
2’s complement of a 2-bit number.
b1b0 Value Inverted +1 Output x1x0 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 x0=b0 and x1=b1⊕b0, which shows why the full-adder version works.

✓ Checked by computer We checked all four 2-bit inputs in code.

↑ Back to the question list

More on Digital Electronics

Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper I, 1996–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted