GATE / CS ARCHIVE

SIMILAR QUESTIONS / DIGITAL LOGIC

Map Boolean functions to restricted gates

7 questions solved the same way, newest first. Back to Digital Logic

How these are solved

Derive a suitable factored SOP/POS and apply De Morgan to map it to the allowed gate family; account for provided complements, fan-in and the permitted gate/inverter count. All require gate-family/resource-aware realization, not only an abstract minimal Boolean expression.

2 marks · NAT
Report issue

Minimum NOR realization of XNOR

Boolean Algebra & Logic Gates

Question 50, GATE 2019: For variable order a,b,c,d, implement f=Σ(0,2,5,7,8,10,13,15) using the fewest two-input NOR gates. All variables and their complements are already available. Find that gate count.
Tap to enlarge
Answer & solution

Official answer: 3

1. Write minterm indices in binary abcd. The four indices 0,2,8,10 all have b=d=0; 5,7,13,15 all have b=d=1. In each group a and c take every combination. Hence f depends only on b,d and equals b XNOR d.
2. Build the two mismatch terms using NOR: u=NOR(b,¬d)=¬b·d and v=NOR(¬b,d)=b·¬d. Each is one gate because complemented inputs are available free.
3. Feed these to a third NOR: NOR(u,v)=¬(¬b·d+b·¬d)=b XNOR d=f. This proves three gates are sufficient.
4. For minimality, consider any circuit with at most two gates. If a raw input literal feeds the final NOR, setting that literal true forces the output to zero regardless of all other variables. The target XNOR has no such literal: for either setting of b or d it can still be 1, and it does not depend on a or c.
5. Without a raw literal at the final gate, both final inputs must be the output of the only earlier NOR. This merely inverts that NOR and gives the OR of its two input literals. No OR of literals realizes XNOR, whose 1-values are the two separated equal-bit cases.
6. Thus one or two gates cannot suffice, while the explicit circuit uses three. The minimum is 3. Complement availability is essential to this count; generating inversions separately would change the implementation cost.

Original paper, page 15 · Answer key

1 mark · NAT
Report issue

Logic Minimization & Karnaugh Maps

Question 21, GATE 2017: A four-variable K-map has columns ba=00,01,11,10 and rows dc=00,01,11,10, both in Gray order. Row entries respectively are [0,X,X,0], [1,0,0,X], [1,0,0,1], [0,X,X,0], where X means don’t care. All inputs a,b,c,d and their complements are available. Using only 2-input NOR gates, find the minimum number of gates.
Tap to enlarge
Answer & solution

Official answer: 1.0

Our answer: 1

1. Use the stated column order ba, not ab. The three required ones are at (dc,ba)=(01,00),(11,00),(11,10).

2. Choose the don’t-care at (01,10) to be 1. With wraparound column adjacency, these four cells form a group: a stays 0 and c stays 1, while b and d vary. Thus f=¬a∧c.

3. De Morgan gives f=¬(a∨¬c). Since ¬c is supplied, feed a and ¬c to one NOR gate. A direct wire to any supplied literal fails some required cell, so zero gates cannot suffice. Minimum 1.

Original paper, page 11 · Answer key

1 mark · MCQ
Report issue

Minimum two-input NOR realization

Boolean Algebra & Logic Gates

Question 6, GATE 2009: Implement F=AB+C using only two-input NOR gates. Find the minimum gate count: A 2; B 3; C 4; D 5.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Factor AB+C=(A+C)(B+C). Compute u=NOR(A, C), v=NOR(B, C), then NOR(u, v)=(A+C)(B+C), using three gates. Two do not suffice: with at most two gates, the final NOR receives only primary inputs and the output of one preceding NOR; exhaustive truth-table enumeration of all such input choices finds no realization. Thus 3, B. The accompanying check script verifies the lower bound without assuming complementary inputs are supplied.

Use the product-of-sums identity AB+C=(A+C)(B+C). Gate 1 gives ¬(A+C); gate 2 gives ¬(B+C); their NOR yields ¬[¬(A+C)+¬(B+C)]=(A+C)(B+C). Thus three gates suffice. With only two NOR gates, the last gate can take raw inputs and at most one derived NOR signal; checking these structural possibilities cannot produce this three-variable function. The accompanying exhaustive small-circuit checker supplies the lower-bound check, so three is minimal.

Original paper, page 2

2 marks · MCQ
Report issue

BCD threshold detector gate count

Binary Codes & Error Detection

Question 58, GATE 2004: A decimal digit is encoded in four-bit BCD: 0=0000,…,9=1001. A combinational circuit must output 1 iff the digit is at least 5. Using only AND,OR,NOT gates, what is the minimum number of gates?
Options:
(A) 2
(B) 3
(C) 4
(D) 5
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Write the BCD inputs A,B,C,D with weights 8,4,2,1. For valid digits 0–9, the threshold predicate digit≥5 is A OR[B AND(C OR D)].

2. This uses three gates: one OR for C+D, one AND with B, and one OR with A. All four inputs are essential on valid BCD pairs (0/8,1/5,4/6,4/5 respectively), and a two-gate AND/OR/NOT network cannot express both the independent A case and the nested B∧(C∨D) case.

3. Invalid BCD encodings 10–15 are unspecified/don’t-care, as the source produces a digit.

4. Teaching check: Use digit weights 8,4,2,1. Digits 8 and 9 are detected by the 8-bit; digits 5,6,7 require the 4-bit and at least one low bit. Values 10–15 are not decimal digits supplied by this source, so they are don’t-care cases rather than additional truth-table requirements.

Original paper, page 8

Descriptive
Report issue

Implement a Boolean function using one complement

Boolean Algebra & Logic Gates

Question 7(a), GATE 2002: Rewrite f(x,y,z)=xy′+yz′ using only one complementation and one or more AND/OR operations. Draw a circuit for that expression using a single NOT gate and AND/OR gates.
Question 7(a), GATE 2002: Rewrite f(x,y,z)=xy′+yz′ using only one complementation and one or more AND/OR operations. Draw a circuit for that expression using a single NOT gate and AND/OR gates.
Tap to enlarge
Shared context

Part (a) implements f(x,y,z) = xy′ + yz′ with one complement. Part (b) independently converts a drawn three-AND/two-OR circuit to exactly six two-input NAND gates.

Answer & solution

Answer: f = (x + y) · (yz)′ (no official key was published)

1. Start from the given f(x,y,z) = xy′ + yz′. Complementing y and z separately would require two NOT operations, so that direct sum-of-products implementation does not satisfy the restriction.

2. Search for a single complemented compound expression. De Morgan’s law gives (yz)′ = y′ + z′, so one NOT gate applied after AND(y,z) can generate the required complemented combination.

3. Verify the proposed factorization algebraically:
(x+y)(yz)′ = (x+y)(y′+z′) = xy′ + xz′ + yy′ + yz′ = xy′ + xz′ + yz′.

4. Show that xz′ is redundant rather than dropping it without justification. Split it by y: xz′ = xz′(y+y′) = xyz′ + xy′z′. The first term is already covered by yz′; the second is covered by xy′. Absorption therefore leaves precisely xy′ + yz′.

5. Implement the verified expression f = (x+y)(yz)′. Use t1 = OR(x,y), t2 = AND(y,z), t3 = NOT(t2), then f = AND(t1,t3):

x,y ---> OR --------- t1 ---\
                              AND ---> f
y,z ---> AND ---> NOT -- t3 -/

6. Count the gates: one OR, two AND gates, and exactly one NOT. The complemented quantity is yz, not either individual input. An exhaustive check of all eight input combinations independently confirms the identity.

Original paper, page 7

Descriptive
Report issue

Transform the circuit into six NAND gates

Boolean Algebra & Logic Gates

Question 7(b), GATE 2002: Convert the given circuit directly, without first expressing its switching function, into an equivalent circuit containing exactly six two-input NAND gates. Textual description of the given diagram: three separate two-input AND gates receive six input wires (two per gate). The first and second AND outputs feed a two-input OR gate. That OR output and the third AND output feed a final two-input OR gate, which produces the circuit output. The input wires are unlabeled in the reproduction.
Question 7(b), GATE 2002: Convert the given circuit directly, without first expressing its switching function, into an equivalent circuit containing exactly six two-input NAND gates. Textual description of the given diagram: three separate two-input AND gates receive six input wires (two per gate). The first and second AND outputs feed a two-input OR gate. That OR output and the third AND output feed a final two-input OR gate, which produces the circuit output. The input wires are unlabeled in the reproduction.
Tap to enlarge
Shared context

Part (a) implements f(x,y,z) = xy′ + yz′ with one complement. Part (b) independently converts a drawn three-AND/two-OR circuit to exactly six two-input NAND gates.

Answer & solution

Answer: Six two-input NAND gates with netlist N1…N6 below (no official key was published)

1. Identify the source circuit by its connections. The top, middle, and bottom two-input AND gates feed a cascade of two OR gates: the first OR combines the top two branches, and the second combines that result with the bottom branch. Label the six external wires a,b,c,d,e,f from top to bottom. These are local wire labels, not extra assumptions about their values.

2. Transform the first AND–OR section by bubble-pushing. A NAND is an AND with a complemented output. Replace the top and middle AND gates with NAND gates N1 and N2. Replace the OR they feed with NAND N4, whose effective input complements cancel those two output complements. Thus N4 has the same output as that original OR.

3. Transform the final OR in the same way. Its bottom input is supplied in complemented form by replacing the bottom AND with NAND N3. Its other input must be the complement of N4’s output, which is produced by NAND N5 with both input pins tied to N4. NAND N6 then implements the final OR through De Morgan’s law.

4. Draw and connect the complete six-gate replacement:

N1 = NAND(a,b)
N2 = NAND(c,d)
N3 = NAND(e,f)
N4 = NAND(N1,N2)
N5 = NAND(N4,N4)
Y  = N6 = NAND(N5,N3)

a,b ---> N1 --\
               N4 ---> N5 (both inputs tied) --\
c,d ---> N2 --/                                  N6 ---> Y
e,f ---> N3 -----------------------------------/

5. Check the physical restrictions. Gates N1–N6 are all two-input NAND gates. Tying the two inputs of N5 together implements an inverter and still uses one allowed two-input NAND gate. There are exactly six gates, no hidden NOT gates and no three-input gates. This is a local circuit transformation, without first expressing the original switching function. A separate exhaustive simulation over the 64 external input assignments confirms equivalence.

Original paper, page 7

Descriptive
Report issue

Implement complemented inputs with NAND

Boolean Algebra & Logic Gates

Question 15(a), GATE 1995: Implement Z=¬A+¬B+C using an inverter and a NAND gate. Here + means OR; both A and B carry complement bars.
Tap to enlarge
Answer & solution

Answer: Invert C; feed A,B,¬C to a three-input NAND. (no official key was published)

De Morgan’s law gives ¬(A·B·¬C)=¬A+¬B+¬¬C=¬A+¬B+C. Therefore make the intermediate wire N=NOT(C) with the inverter, and connect A, B and N to a three-input NAND whose output is Z.

An exact circuit netlist is N := NOT C; Z := NAND3(A,B,N). The inverter is on C, even though the displayed formula has bars on A and B: the NAND’s output inversion supplies those two complements and changes the complement of its third input back into C.

As a truth-table check, the required OR expression is zero only when A=1, B=1 and C=0. Then N=1, all three NAND inputs are 1, and the output is 0. For every other assignment at least one NAND input is 0 and the output is 1. This uses a three-input NAND; restricting the available NAND to two inputs would require a different multi-gate implementation, which the statement does not specify.

Original paper, page 7