Skip to main content

Chapter 2 · 1 hour

Digital Logic

IOE past exam questions

Past questions and answers

27 questions set from this chapter, 5 of them more than once. Most asked first.

  • Asked 3 times
  • 2080 Bhadra · 2+3 marks
  • 2080 Baisakh · 5+3 marks
  • 2078 Bhadra · 2+4 marks

State and prove De-Morgan's theorems with necessary diagrams. Construct XOR gate using minimum number of NAND gates.

Answer

De Morgan's theorems

De Morgan's theorems tell how to complement a sum or a product of variables.

Theorem 1: The complement of a sum equals the product of the complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

So a NOR gate equals a bubbled AND gate (AND with inverted inputs).

Theorem 2: The complement of a product equals the sum of the complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

So a NAND gate equals a bubbled OR gate (OR with inverted inputs).

Proof by truth table

ABA+BA+BA+B‾\overline{A+B}AˉBˉ\bar A \bar BABABAB‾\overline{AB}Aˉ+Bˉ\bar A + \bar B
00011011
01100011
10100011
11100100

Column 4 = column 5 and column 7 = column 8 for every input, so both theorems are proved.

Algebraic proof of Theorem 1: if X=A+BX = A + B and Y=AˉBˉY = \bar A \bar B, then X+Y=A+B+AˉBˉ=A+B+Bˉ=1X + Y = A + B + \bar A \bar B = A + B + \bar B = 1 and X⋅Y=AAˉBˉ+BAˉBˉ=0X \cdot Y = A \bar A \bar B + B \bar A \bar B = 0. Since X+Y=1X + Y = 1 and XY=0XY = 0, Y is the complement of X. Theorem 2 follows by duality.

Diagrams

 Theorem 1: NOR = bubbled AND
 A --|‾‾‾\             A --o|‾‾‾\
     | OR  )o-- Y   =       | AND )-- Y
 B --|___/             B --o|___/

 Theorem 2: NAND = bubbled OR
 A --|‾‾‾\             A --o|‾‾‾\
     | AND )o-- Y   =       | OR  )-- Y
 B --|___/             B --o|___/

 (o = inversion bubble)

XOR using minimum NAND gates

Y=A⊕B=ABˉ+AˉBY = A \oplus B = A\bar B + \bar A B. It can be built with 4 two-input NAND gates:

G1=AB‾G2=A⋅G1‾=A⋅AB‾‾G3=B⋅G1‾=B⋅AB‾‾Y=G2⋅G3‾=A AB‾+B AB‾=A(Aˉ+Bˉ)+B(Aˉ+Bˉ)=ABˉ+AˉB=A⊕B\begin{aligned} G_1 &= \overline{AB} \\ G_2 &= \overline{A \cdot G_1} = \overline{A \cdot \overline{AB}} \\ G_3 &= \overline{B \cdot G_1} = \overline{B \cdot \overline{AB}} \\ Y &= \overline{G_2 \cdot G_3} = A\,\overline{AB} + B\,\overline{AB} \\ &= A(\bar A + \bar B) + B(\bar A + \bar B) \\ &= A\bar B + \bar A B = A \oplus B \end{aligned}
 A --+-------------[NAND G2]--+
     |              |         |
     +--[NAND G1]---+         +--[NAND G4]-- Y
     |              |         |
 B --+-------------[NAND G3]--+

G1 output feeds one input of both G2 and G3; A goes to G2, B goes to G3; G2 and G3 feed G4.

ABG1G2G3Y
001110
011101
101011
110110
  • Asked 2 times
  • 2079 Bhadra · 2+3 marks
  • 2079 Baisakh · 6 marks

Define positive and negative logic and prove that positive X-OR is equivalent to negative X-NOR.

Answer

Positive and negative logic

  • Positive logic: the higher voltage level represents logic 1 and the lower level represents logic 0. Example in TTL: +5 V = 1, 0 V = 0.
  • Negative logic: the higher voltage level represents logic 0 and the lower level represents logic 1. Example: +5 V = 0, 0 V = 1 (or in a –5 V system, –5 V = 1, 0 V = 0).

The same physical circuit gives a different logic function depending on which convention is used. Changing from positive to negative logic means complementing every input and output bit.

Proof: positive XOR = negative XNOR

Take a gate working as XOR in positive logic. Its voltage table (H = high, L = low):

ABY
LLL
LHH
HLH
HHL

Positive logic (H = 1, L = 0):

ABY
000
011
101
110

This is XOR: Y=A⊕BY = A \oplus B.

Negative logic (H = 0, L = 1) for the same circuit:

ABY
111
100
010
001

Output is 1 when both inputs are equal, which is XNOR: Y=A⊕B‾Y = \overline{A \oplus B}.

Algebraic proof: in negative logic the function becomes the complement of positive XOR with complemented inputs:

Yneg=Aˉ⊕Bˉ‾=AˉB+ABˉ‾=A⊕B‾=A⊙B\begin{aligned} Y_{neg} &= \overline{\bar A \oplus \bar B} \\ &= \overline{\bar A B + A \bar B} \\ &= \overline{A \oplus B} = A \odot B \end{aligned}

(since Aˉ⊕Bˉ=A⊕B\bar A \oplus \bar B = A \oplus B). Hence the positive-logic XOR gate is the same circuit as a negative-logic XNOR gate.

  • Asked 2 times
  • 2073 Shrawan · 5 marks
  • 2072 Chaitra · 4 marks

Construct two input XOR gate using minimum number of 2-input NAND gates only.

Answer

An XOR gate gives Y=A⊕B=ABˉ+AˉBY = A \oplus B = A\bar B + \bar A B. With NAND gates only, the minimum is four 2-input NAND gates.

Derivation

Y=ABˉ+AˉB=AAˉ+ABˉ+BAˉ+BBˉ(adding AAˉ=BBˉ=0)=A(Aˉ+Bˉ)+B(Aˉ+Bˉ)=A AB‾+B AB‾=A AB‾‾⋅B AB‾‾‾(De Morgan)\begin{aligned} Y &= A\bar B + \bar A B \\ &= A\bar A + A\bar B + B\bar A + B\bar B \quad (\text{adding } A\bar A = B\bar B = 0) \\ &= A(\bar A + \bar B) + B(\bar A + \bar B) \\ &= A\,\overline{AB} + B\,\overline{AB} \\ &= \overline{\overline{A\,\overline{AB}} \cdot \overline{B\,\overline{AB}}} \quad (\text{De Morgan}) \end{aligned}

So the gates are:

  • G1=AB‾G_1 = \overline{AB}
  • G2=A⋅G1‾G_2 = \overline{A \cdot G_1}
  • G3=B⋅G1‾G_3 = \overline{B \cdot G_1}
  • Y=G2⋅G3‾Y = \overline{G_2 \cdot G_3}

Circuit

 A --+-----------------|‾‾\
     |                 |G2 |o--+
     |  |‾‾\      +----|__/    |   |‾‾\
     +--|G1 |o----+            +---|G4 |o-- Y
     +--|__/      +----|‾‾\    +---|__/
     |                 |G3 |o--+
 B --+-----------------|__/

Verification

ABG1G_1G2G_2G3G_3Y
001110
011101
101011
110110

Output Y is 1 only when the inputs differ, which is the XOR function. Total: 4 NAND gates.

  • Asked 2 times
  • 2082 Shrawan · 3 marks
  • 2081 Baisakh · 2 marks

Explain a positive logic and the negative logic with suitable examples.

Answer

In a digital circuit the two logic states are shown by two voltage levels. Which level is called 1 decides whether the system uses positive or negative logic.

  • Positive logic: HIGH voltage = logic 1, LOW voltage = logic 0. Example: in TTL, +5 V = 1 and 0 V = 0. Most systems use positive logic.
  • Negative logic: HIGH voltage = logic 0, LOW voltage = logic 1. Example: +5 V = 0 and 0 V = 1; or in an ECL / –5 V system, –5 V = 1 and 0 V = 0.
  Positive logic       Negative logic
  +5V ---- 1           +5V ---- 0
   0V ---- 0            0V ---- 1

Example: a circuit has this voltage table:

ABY
LLL
LHL
HLL
HHH
  • In positive logic (H = 1): Y = 1 only when A = B = 1, so it is an AND gate.
  • In negative logic (H = 0): Y = 0 only when A = B = 0, so it is an OR gate.

So positive AND = negative OR, and similarly positive OR = negative AND, positive NAND = negative NOR, positive XOR = negative XNOR. The physical gate is the same; only the meaning of the levels changes.

  • Asked 2 times
  • 2082 Shrawan · 2 marks
  • 2076 Chaitra · 2 marks

State and prove De-Morgan's laws.

Answer

First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

In words: "break the bar and change the sign".

Proof by truth table

ABA+B‾\overline{A+B}Aˉ⋅Bˉ\bar A \cdot \bar BAB‾\overline{AB}Aˉ+Bˉ\bar A + \bar B
001111
010011
100011
110000

For all four input combinations, column 3 equals column 4 and column 5 equals column 6, so both theorems are proved.

Algebraic proof (Theorem 1): let X=A+BX = A + B and Y=AˉBˉY = \bar A \bar B. Then X+Y=A+B+AˉBˉ=A+B+Bˉ=1X + Y = A + B + \bar A \bar B = A + B + \bar B = 1 and XY=AAˉBˉ+BAˉBˉ=0X Y = A\bar A \bar B + B \bar A \bar B = 0. A variable that ORs with X to give 1 and ANDs with X to give 0 is Xˉ\bar X, so A+B‾=AˉBˉ\overline{A+B} = \bar A \bar B. Theorem 2 follows by duality.

  • 2081 Baisakh · 2+3 marks

What is the importance of De-Morgan's laws? Show how a two-input XOR gate can be constructed from a two-input NAND gate with required expressions.

Answer

Importance of De Morgan's laws

De Morgan's laws, A+B‾=AˉBˉ\overline{A+B} = \bar A \bar B and AB‾=Aˉ+Bˉ\overline{AB} = \bar A + \bar B, are important because:

  1. They let us complement any Boolean expression (break the bar, change AND ↔ OR).
  2. They convert SOP forms to NAND-NAND and POS forms to NOR-NOR circuits, so any circuit can be built with one type of universal gate, which reduces IC types and cost.
  3. They show gate equivalences: NAND = bubbled OR, NOR = bubbled AND; useful for reading and drawing circuits with active-low signals.
  4. They help in simplifying expressions and in proving positive/negative logic equivalences.

XOR from 2-input NAND gates

Y=A⊕B=ABˉ+AˉBY = A \oplus B = A\bar B + \bar A B needs four 2-input NAND gates.

Y=ABˉ+AˉB=A(Aˉ+Bˉ)+B(Aˉ+Bˉ)(since AAˉ=BBˉ=0)=A AB‾+B AB‾=A AB‾‾⋅B AB‾‾‾(De Morgan)\begin{aligned} Y &= A\bar B + \bar A B \\ &= A(\bar A + \bar B) + B(\bar A + \bar B) \quad (\text{since } A\bar A = B\bar B = 0) \\ &= A\,\overline{AB} + B\,\overline{AB} \\ &= \overline{\overline{A\,\overline{AB}} \cdot \overline{B\,\overline{AB}}} \quad (\text{De Morgan}) \end{aligned}

Gates: G1=AB‾G_1 = \overline{AB}, G2=AG1‾G_2 = \overline{A G_1}, G3=BG1‾G_3 = \overline{B G_1}, Y=G2G3‾Y = \overline{G_2 G_3}.

 A --+---------------[NAND G2]--+
     |                 |        |
     +--[NAND G1]--G1--+        +--[NAND G4]-- Y
     |                 |        |
 B --+---------------[NAND G3]--+
ABG1G_1G2G_2G3G_3Y
001110
011101
101011
110110
  • 2080 Bhadra · 2+4 marks

Define positive and negative logic. Realize X-NOR gate using NAND gates only.

Answer

Positive and negative logic

  • Positive logic: HIGH voltage = logic 1, LOW voltage = logic 0 (e.g. TTL: +5 V = 1, 0 V = 0).
  • Negative logic: HIGH voltage = logic 0, LOW voltage = logic 1 (e.g. +5 V = 0, 0 V = 1).

The same physical gate performs a different logic function in the two systems, because changing the convention complements every input and output. Example: a gate whose output is HIGH only when both inputs are HIGH is an AND gate in positive logic but an OR gate in negative logic.

XNOR using NAND gates only

Y=A⊙B=A⊕B‾Y = A \odot B = \overline{A \oplus B}. First build XOR with 4 NAND gates, then invert it with a fifth NAND gate whose two inputs are tied together (X⋅X‾=Xˉ\overline{X \cdot X} = \bar X). Minimum: 5 NAND gates.

G1=AB‾G2=AG1‾G3=BG1‾G4=G2G3‾=A⊕BY=G4⋅G4‾=A⊕B‾=AB+AˉBˉ\begin{aligned} G_1 &= \overline{AB} \\ G_2 &= \overline{A G_1} \\ G_3 &= \overline{B G_1} \\ G_4 &= \overline{G_2 G_3} = A \oplus B \\ Y &= \overline{G_4 \cdot G_4} = \overline{A \oplus B} = AB + \bar A \bar B \end{aligned}
 A --+-----------[NAND G2]--+
     |              |       |
     +--[NAND G1]---+       +--[NAND G4]--+--[NAND G5]-- Y
     |              |       |             +--|
 B --+-----------[NAND G3]--+       (inputs tied: NOT)
ABG1G_1G2G_2G3G_3G4G_4Y
0011101
0111010
1010110
1101101

Y is 1 when both inputs are equal, which is XNOR.

  • 2079 Bhadra · 2+4 marks

State and prove De-Morgan's theorems with necessary diagrams and prove that positive NAND equivalent is equal to negative NOR.

Answer

De Morgan's theorems

First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

In words: "break the bar and change the sign".

Proof by truth table

ABA+B‾\overline{A+B}Aˉ⋅Bˉ\bar A \cdot \bar BAB‾\overline{AB}Aˉ+Bˉ\bar A + \bar B
001111
010011
100011
110000

For all four input combinations, column 3 equals column 4 and column 5 equals column 6, so both theorems are proved.

Diagrams

 Theorem 1: NOR = bubbled AND
 A --|‾‾‾\             A --o|‾‾‾\
     | OR  )o-- Y   =       | AND )-- Y
 B --|___/             B --o|___/

 Theorem 2: NAND = bubbled OR
 A --|‾‾‾\             A --o|‾‾‾\
     | AND )o-- Y   =       | OR  )-- Y
 B --|___/             B --o|___/

 (o = inversion bubble)

Positive NAND = negative NOR

Consider a gate whose voltage table is:

ABY
LLH
LHH
HLH
HHL

Positive logic (H = 1, L = 0):

ABY
001
011
101
110

Output is 0 only when both inputs are 1: a NAND gate.

Negative logic (H = 0, L = 1), same circuit:

ABY
110
100
010
001

Output is 1 only when both inputs are 0: a NOR gate.

Algebraically: going to negative logic complements all inputs and the output:

Yneg= Aˉ⋅Bˉ‾ ‾=Aˉ⋅Bˉ=A+B‾(De Morgan)\begin{aligned} Y_{neg} &= \overline{\,\overline{\bar A \cdot \bar B}\,} \\ &= \bar A \cdot \bar B \\ &= \overline{A + B} \quad (\text{De Morgan}) \end{aligned}

Hence positive-logic NAND is equivalent to negative-logic NOR.

  • 2076 Chaitra · 3+3 marks

State and prove the De-Morgan's theorem and perform the addition (-47+27) by using 2's complement method.

Answer

De Morgan's theorems

First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

In words: "break the bar and change the sign".

Proof by truth table

ABA+B‾\overline{A+B}Aˉ⋅Bˉ\bar A \cdot \bar BAB‾\overline{AB}Aˉ+Bˉ\bar A + \bar B
001111
010011
100011
110000

For all four input combinations, column 3 equals column 4 and column 5 equals column 6, so both theorems are proved.

(−47) + (27) using 2's complement

Use 8-bit signed numbers (range −128 to +127).

Step 1: +47 and +27 in binary

  • 47=32+8+4+2+1=0010 111147 = 32 + 8 + 4 + 2 + 1 = 0010\ 1111
  • 27=16+8+2+1=0001 101127 = 16 + 8 + 2 + 1 = 0001\ 1011

Step 2: 2's complement of 47 (to get −47)

 +47            = 0010 1111
 1's complement = 1101 0000
 add 1          = 1101 0001  (= -47)

Step 3: Add

   -47  =  1101 0001
 + +27  =  0001 1011
 -------------------
           1110 1100

No carry out of the MSB, and the sign bit is 1, so the result is negative and is in 2's complement form.

Step 4: Find its magnitude (take 2's complement)

 result         = 1110 1100
 1's complement = 0001 0011
 add 1          = 0001 0100  = 20

Check: −47+27=−20-47 + 27 = -20.

Answer: (−47)+(27)=(1110 1100)2(-47) + (27) = (1110\ 1100)_2 in 2's complement =−2010= -20_{10}

  • 2076 Asoj · 2+3 marks

Describe De' Morgan's laws with examples. Construct XOR gate using only 3-inputs NAND gates.

Answer

De Morgan's laws

First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

In words: "break the bar and change the sign".

Examples

  • A+B+C‾=AˉBˉCˉ\overline{A + B + C} = \bar A \bar B \bar C and ABC‾=Aˉ+Bˉ+Cˉ\overline{ABC} = \bar A + \bar B + \bar C (extended to 3 variables).
  • (A+Bˉ)C‾=A+Bˉ‾+Cˉ=AˉB+Cˉ\overline{(A + \bar B)C} = \overline{A + \bar B} + \bar C = \bar A B + \bar C.
  • Check with A = 1, B = 0: 1+0‾=0\overline{1 + 0} = 0 and 1ˉ⋅0ˉ=0⋅1=0\bar 1 \cdot \bar 0 = 0 \cdot 1 = 0.

XOR gate using only 3-input NAND gates

A 3-input NAND gives XYZ‾\overline{XYZ}. If one input is tied to logic 1 (HIGH, e.g. +5 V through a resistor), it behaves as a 2-input NAND: X⋅Y⋅1‾=XY‾\overline{X \cdot Y \cdot 1} = \overline{XY}. (Tying the unused input to one of the used inputs also works, since XX=XXX = X.) So the 4-NAND XOR circuit is built with four 3-input NAND gates:

G1=A⋅B⋅1‾=AB‾G2=A⋅G1⋅1‾G3=B⋅G1⋅1‾Y=G2⋅G3⋅1‾=ABˉ+AˉB=A⊕B\begin{aligned} G_1 &= \overline{A \cdot B \cdot 1} = \overline{AB} \\ G_2 &= \overline{A \cdot G_1 \cdot 1} \\ G_3 &= \overline{B \cdot G_1 \cdot 1} \\ Y &= \overline{G_2 \cdot G_3 \cdot 1} = A\bar B + \bar A B = A \oplus B \end{aligned}
 A --+-------------[NAND3 G2]--+
     |               |    1 -->|
     +--[NAND3 G1]---+         +--[NAND3 G4]-- Y
     |   1 -->|      |         |    1 -->|
 B --+-------------[NAND3 G3]--+
                          1 -->|
 (1 --> : third input tied to logic HIGH)
ABG1G_1G2G_2G3G_3Y
001110
011101
101011
110110
  • 2075 Asoj · 4 marks

Design half subtractor circuit using HDL.

Answer

A half subtractor subtracts one bit B from another bit A and gives a Difference (D) and a Borrow (Bo).

ABDBo
0000
0111
1010
1100
D=A⊕B,Bo=AˉBD = A \oplus B, \qquad B_o = \bar A B
 A --+--[XOR]------------ D
 B --+--|
 A --[NOT]--[AND]-------- Bo
 B ---------|

Verilog HDL description

// Half subtractor: gate-level (structural) model
module half_sub_gate (input A, B, output D, Bo);
  wire An;              // complement of A
  xor g1 (D, A, B);     // D  = A XOR B
  not g2 (An, A);       // An = A'
  and g3 (Bo, An, B);   // Bo = A'B
endmodule

// Same circuit: dataflow model
module half_sub_df (input A, B, output D, Bo);
  assign D  = A ^ B;    // difference
  assign Bo = ~A & B;   // borrow
endmodule

Test bench (simulation)

module tb;
  reg A, B; wire D, Bo;
  half_sub_df uut (A, B, D, Bo);
  initial begin
    $monitor("A=%b B=%b D=%b Bo=%b", A, B, D, Bo);
    {A,B} = 2'b00; #10 {A,B} = 2'b01;
    #10 {A,B} = 2'b10; #10 {A,B} = 2'b11;
    #10 $finish;
  end
endmodule

Simulation output matches the truth table, e.g. A=0 B=1 D=1 Bo=1 and A=1 B=1 D=0 Bo=0.

  • 2074 Chaitra · 4+2 marks

State and prove De-Morgan's theorems with necessary diagrams. Prove that negative logic OR Gate is equivalent to positive logic AND Gate.

Answer

De Morgan's theorems

First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

In words: "break the bar and change the sign".

Proof by truth table

ABA+B‾\overline{A+B}Aˉ⋅Bˉ\bar A \cdot \bar BAB‾\overline{AB}Aˉ+Bˉ\bar A + \bar B
001111
010011
100011
110000

For all four input combinations, column 3 equals column 4 and column 5 equals column 6, so both theorems are proved.

Algebraic proof (Theorem 1): let X=A+BX = A + B, Y=AˉBˉY = \bar A \bar B. Then X+Y=A+B+AˉBˉ=A+B+Bˉ=1X + Y = A + B + \bar A\bar B = A + B + \bar B = 1 and XY=AAˉBˉ+BAˉBˉ=0XY = A\bar A\bar B + B\bar A\bar B = 0, so Y=XˉY = \bar X. Theorem 2 follows by duality.

Diagrams

 Theorem 1: NOR = bubbled AND
 A --|‾‾‾\             A --o|‾‾‾\
     | OR  )o-- Y   =       | AND )-- Y
 B --|___/             B --o|___/

 Theorem 2: NAND = bubbled OR
 A --|‾‾‾\             A --o|‾‾‾\
     | AND )o-- Y   =       | OR  )-- Y
 B --|___/             B --o|___/

 (o = inversion bubble)

Negative-logic OR = positive-logic AND

Take a gate whose output is HIGH only when both inputs are HIGH:

ABY
LLL
LHL
HLL
HHH

Positive logic (H = 1): Y = 1 only for A = B = 1 → AND.

Negative logic (H = 0, L = 1):

ABY
111
101
011
000

Y = 0 only when both inputs are 0 → OR.

Algebraically: a negative-logic OR, seen in positive logic, has all inputs and the output complemented:

Y=Aˉ+Bˉ‾=Aˉˉ⋅Bˉˉ(De Morgan)=A⋅B\begin{aligned} Y &= \overline{\bar A + \bar B} \\ &= \bar{\bar A} \cdot \bar{\bar B} \quad (\text{De Morgan}) \\ &= A \cdot B \end{aligned}

So the negative-logic OR gate is the same circuit as the positive-logic AND gate.

  • 2074 Asoj · 4 marks

What is the importance of De-morgan's laws? Show how a two-input NOR gate can be constructed from a two-input NAND gate.

Answer

Importance of De Morgan's laws

De Morgan's laws (A+B‾=AˉBˉ\overline{A+B} = \bar A\bar B, AB‾=Aˉ+Bˉ\overline{AB} = \bar A + \bar B) are used to:

  • complement Boolean expressions easily;
  • convert AND-OR (SOP) circuits to NAND-NAND and OR-AND (POS) circuits to NOR-NOR;
  • build every gate from one universal gate (NAND or NOR), reducing chip types and cost;
  • show gate equivalences such as NAND = bubbled OR and NOR = bubbled AND.

NOR gate from 2-input NAND gates

Required: Y=A+B‾Y = \overline{A + B}. By De Morgan, A+B=Aˉ⋅Bˉ‾A + B = \overline{\bar A \cdot \bar B}, so:

G1=A⋅A‾=AˉG2=B⋅B‾=BˉG3=Aˉ⋅Bˉ‾=A+BY=G3⋅G3‾=A+B‾\begin{aligned} G_1 &= \overline{A \cdot A} = \bar A \\ G_2 &= \overline{B \cdot B} = \bar B \\ G_3 &= \overline{\bar A \cdot \bar B} = A + B \\ Y &= \overline{G_3 \cdot G_3} = \overline{A + B} \end{aligned}

Four NAND gates are needed: two as input inverters, one to make OR, and one as the output inverter.

 A --[NAND G1]-- A' --+
   (inputs tied)      +--[NAND G3]-- A+B --[NAND G4]-- Y
 B --[NAND G2]-- B' --+                  (inputs tied)
ABAˉ\bar ABˉ\bar BA+BA+BY
001101
011010
100110
110010
  • 2072 Chaitra · 2+2 marks

Describe commutative and associative laws of Boolean algebra with examples and simplify A+A'B = A+B.

Answer

Commutative laws

The order of variables in an OR or AND operation does not change the result.

  • A+B=B+AA + B = B + A
  • A⋅B=B⋅AA \cdot B = B \cdot A

Example: Aˉ+C=C+Aˉ\bar A + C = C + \bar A; with A = 1, B = 0: 1⋅0=0⋅1=01 \cdot 0 = 0 \cdot 1 = 0. In hardware, swapping the inputs of an AND or OR gate does not change its output.

Associative laws

The grouping of variables in an OR or AND operation does not change the result.

  • A+(B+C)=(A+B)+CA + (B + C) = (A + B) + C
  • A⋅(B⋅C)=(A⋅B)⋅CA \cdot (B \cdot C) = (A \cdot B) \cdot C

Example: with A = 1, B = 0, C = 1: 1⋅(0⋅1)=01 \cdot (0 \cdot 1) = 0 and (1⋅0)⋅1=0(1 \cdot 0) \cdot 1 = 0. So a 3-input AND can be built from two 2-input AND gates in any order.

Proof of A+AˉB=A+BA + \bar A B = A + B

Using the distributive law X+YZ=(X+Y)(X+Z)X + YZ = (X + Y)(X + Z):

A+AˉB=(A+Aˉ)(A+B)=1⋅(A+B)=A+B\begin{aligned} A + \bar A B &= (A + \bar A)(A + B) \\ &= 1 \cdot (A + B) \\ &= A + B \end{aligned}

Truth-table check:

ABAˉB\bar A BA+AˉBA + \bar A BA+BA + B
00000
01111
10011
11011
  • 2070 Chaitra · 5 marks

Prove that positive X-OR is equivalent to negative X-NOR.

Answer

In positive logic HIGH = 1 and LOW = 0; in negative logic HIGH = 0 and LOW = 1. Changing the convention complements every input and output bit of the same physical gate.

Take a gate that acts as XOR in positive logic. Its voltage table:

ABY
LLL
LHH
HLH
HHL

Positive logic (H = 1, L = 0):

ABY
000
011
101
110

Y = 1 when inputs differ: XOR, Y=A⊕BY = A \oplus B.

Negative logic (H = 0, L = 1), same circuit:

ABY
111
100
010
001

Rearranged in normal order (00, 01, 10, 11) the output is 1, 0, 0, 1: Y = 1 when inputs are equal: XNOR.

Algebraic proof: complement inputs and output of the positive-logic XOR:

Yneg=Aˉ⊕Bˉ‾=AˉBˉˉ+AˉˉBˉ‾=AˉB+ABˉ‾=A⊕B‾=AB+AˉBˉ=A⊙B\begin{aligned} Y_{neg} &= \overline{\bar A \oplus \bar B} \\ &= \overline{\bar A \bar{\bar B} + \bar{\bar A} \bar B} \\ &= \overline{\bar A B + A \bar B} \\ &= \overline{A \oplus B} = AB + \bar A \bar B = A \odot B \end{aligned}

Hence positive-logic XOR is equivalent to negative-logic XNOR.

  • 2069 Chaitra · 4 marks

Construct the given Boolean function: F = (A+B)(C+D)E using NOR gates only.

Answer

F=(A+B)(C+D)EF = (A+B)(C+D)E is a product of sums (POS). A POS form maps directly to a NOR-NOR circuit, using double inversion and De Morgan's law.

F=(A+B)(C+D)E=(A+B)(C+D)E‾‾=A+B‾+C+D‾+Eˉ‾(De Morgan)\begin{aligned} F &= (A+B)(C+D)E \\ &= \overline{\overline{(A+B)(C+D)E}} \\ &= \overline{\overline{A+B} + \overline{C+D} + \bar E} \quad (\text{De Morgan}) \end{aligned}

So:

  • G1=A+B‾G_1 = \overline{A + B} (2-input NOR)
  • G2=C+D‾G_2 = \overline{C + D} (2-input NOR)
  • G3=E+E‾=EˉG_3 = \overline{E + E} = \bar E (NOR used as inverter)
  • F=G1+G2+G3‾F = \overline{G_1 + G_2 + G_3} (3-input NOR)
 A --[NOR G1]--(A+B)'--+
 B --|                 |
 C --[NOR G2]--(C+D)'--+--[NOR G4]-- F
 D --|                 |   (3-input)
 E --[NOR G3]-- E' ----+
   (inputs tied)

Total: 4 NOR gates (three 2-input, one 3-input). If only 2-input NORs are allowed, G4 can be replaced by: G4′=G1+G2‾G_4' = \overline{G_1 + G_2}, G5=G4′+G4′‾G_5 = \overline{G_4' + G_4'} (= G1+G2G_1 + G_2), F=G5+G3‾F = \overline{G_5 + G_3}, giving 6 gates.

Check: A = 1, B = 0, C = 0, D = 1, E = 1 → G1=0G_1 = 0, G2=0G_2 = 0, G3=0G_3 = 0, F = 1; and (1)(1)(1)=1(1)(1)(1) = 1.

  • 2068 Chaitra · 2+2 marks

List out the name of universal gates and why they are called universal gate? Realise Ex-OR Gate using only NAND gates.

Answer

Universal gates

The universal gates are NAND and NOR. They are called universal because any Boolean function, and every other gate (NOT, AND, OR, XOR, XNOR), can be built using only NAND gates or only NOR gates. For example, with NAND only: NOT A = AA‾\overline{A A}, AND = NAND followed by NOT, OR = AˉBˉ‾\overline{\bar A \bar B}. This lets a whole circuit be made from one type of IC (e.g. 7400), which simplifies manufacture and reduces cost.

XOR using only NAND gates

Y=A⊕B=ABˉ+AˉBY = A \oplus B = A\bar B + \bar A B needs four 2-input NAND gates.

Y=ABˉ+AˉB=A(Aˉ+Bˉ)+B(Aˉ+Bˉ)(since AAˉ=BBˉ=0)=A AB‾+B AB‾=A AB‾‾⋅B AB‾‾‾(De Morgan)\begin{aligned} Y &= A\bar B + \bar A B \\ &= A(\bar A + \bar B) + B(\bar A + \bar B) \quad (\text{since } A\bar A = B\bar B = 0) \\ &= A\,\overline{AB} + B\,\overline{AB} \\ &= \overline{\overline{A\,\overline{AB}} \cdot \overline{B\,\overline{AB}}} \quad (\text{De Morgan}) \end{aligned}

Gates: G1=AB‾G_1 = \overline{AB}, G2=AG1‾G_2 = \overline{A G_1}, G3=BG1‾G_3 = \overline{B G_1}, Y=G2G3‾Y = \overline{G_2 G_3}.

 A --+---------------[NAND G2]--+
     |                 |        |
     +--[NAND G1]--G1--+        +--[NAND G4]-- Y
     |                 |        |
 B --+---------------[NAND G3]--+
ABG1G_1G2G_2G3G_3Y
001110
011101
101011
110110
  • 2068 Baisakh · 4 marks

Why NAND and NOR gates are called Universal gates? Illustrate with examples.

Answer

NAND and NOR gates are called universal gates because each of them alone can realise the three basic operations NOT, AND and OR, and therefore any Boolean function. A complete circuit can thus be made using only one type of gate (e.g. 7400 quad NAND or 7402 quad NOR), which reduces inventory, cost and design effort.

Using NAND only

GateRealisationGates
NOTA⋅A‾=Aˉ\overline{A \cdot A} = \bar A1
ANDAB‾⋅AB‾‾=AB\overline{\overline{AB} \cdot \overline{AB}} = AB2
ORAˉ⋅Bˉ‾=A+B\overline{\bar A \cdot \bar B} = A + B3
 NOT: A --[NAND]-- A'      (inputs tied)
 AND: A,B --[NAND]--[NAND]-- AB
 OR : A --[NAND]-- A' --+
      B --[NAND]-- B' --+--[NAND]-- A+B

Using NOR only

GateRealisationGates
NOTA+A‾=Aˉ\overline{A + A} = \bar A1
ORA+B‾+A+B‾‾=A+B\overline{\overline{A+B} + \overline{A+B}} = A + B2
ANDAˉ+Bˉ‾=AB\overline{\bar A + \bar B} = AB3
 NOT: A --[NOR]-- A'
 OR : A,B --[NOR]--[NOR]-- A+B
 AND: A --[NOR]-- A' --+
      B --[NOR]-- B' --+--[NOR]-- AB

Example: Y=AB+CDY = AB + CD can be done with three NAND gates: Y=AB‾⋅CD‾‾Y = \overline{\overline{AB} \cdot \overline{CD}} (NAND-NAND form of an SOP).

  • 2068 Baisakh · 2+3 marks

What do you mean by HDL? Design a 2 to 4 line decoder circuit using HDL.

Answer

HDL

A Hardware Description Language (HDL) is a computer language used to describe the structure and behaviour of digital circuits in text form. The description can be simulated to check the design and synthesised into gates for an FPGA, CPLD or ASIC. Common HDLs are Verilog and VHDL. A design can be written at gate level (structural), dataflow (assign equations) or behavioural (always blocks) level.

2-to-4 line decoder

Inputs A1 A0 and enable E; exactly one output goes HIGH for each input code when E = 1.

EA1A0D3D2D1D0
0xx0000
1000001
1010010
1100100
1111000

D0=EAˉ1Aˉ0D_0 = E\bar A_1 \bar A_0, D1=EAˉ1A0D_1 = E\bar A_1 A_0, D2=EA1Aˉ0D_2 = E A_1 \bar A_0, D3=EA1A0D_3 = E A_1 A_0

Verilog (dataflow model)

module decoder2to4 (input A1, A0, E,
                   output D0, D1, D2, D3);
  assign D0 = E & ~A1 & ~A0; // 00
  assign D1 = E & ~A1 &  A0; // 01
  assign D2 = E &  A1 & ~A0; // 10
  assign D3 = E &  A1 &  A0; // 11
endmodule

Verilog (gate-level model)

module decoder2to4_g (input A1, A0, E,
                     output D0, D1, D2, D3);
  wire n1, n0;
  not (n1, A1);           // A1'
  not (n0, A0);           // A0'
  and (D0, E, n1, n0);
  and (D1, E, n1, A0);
  and (D2, E, A1, n0);
  and (D3, E, A1, A0);
endmodule

With E = 1 and A1A0 = 10, simulation gives D3D2D1D0 = 0100.

  • 2082 Shrawan · 3 marks

Realize 2 inputs XOR gates using NOR gates only.

Answer

Y=A⊕BY = A \oplus B. Build XNOR with 4 NOR gates and invert it with a fifth NOR (inputs tied). Minimum: 5 NOR gates.

G1=A+B‾G2=A+G1‾=AˉBG3=B+G1‾=ABˉG4=G2+G3‾=A⊕B‾Y=G4+G4‾=A⊕B\begin{aligned} G_1 &= \overline{A + B} \\ G_2 &= \overline{A + G_1} = \bar A B \\ G_3 &= \overline{B + G_1} = A \bar B \\ G_4 &= \overline{G_2 + G_3} = \overline{A \oplus B} \\ Y &= \overline{G_4 + G_4} = A \oplus B \end{aligned}
 A --+-----------[NOR G2]--+
     |              |      |
     +--[NOR G1]----+      +--[NOR G4]--[NOR G5]-- Y
     |              |      |          (inputs tied)
 B --+-----------[NOR G3]--+
ABG1G_1G2G_2G3G_3G4G_4Y
0010010
0101001
1000101
1100010
  • 2082 Baisakh · 2+4 marks

Define the positive and negative logic. State and verify 3-bits De Morgan's theorem.

Answer

Positive and negative logic

  • Positive logic: HIGH voltage = logic 1, LOW voltage = logic 0 (e.g. TTL: +5 V = 1, 0 V = 0).
  • Negative logic: HIGH voltage = logic 0, LOW voltage = logic 1 (e.g. +5 V = 0, 0 V = 1).

The same physical gate performs a different logic function in the two systems, because changing the convention complements every input and output. Example: a gate whose output is HIGH only when both inputs are HIGH is an AND gate in positive logic but an OR gate in negative logic.

De Morgan's theorem for 3 variables

Theorem 1: A+B+C‾=Aˉ⋅Bˉ⋅Cˉ\overline{A + B + C} = \bar A \cdot \bar B \cdot \bar C

Theorem 2: A⋅B⋅C‾=Aˉ+Bˉ+Cˉ\overline{A \cdot B \cdot C} = \bar A + \bar B + \bar C

Verification by truth table

ABCA+B+C‾\overline{A+B+C}AˉBˉCˉ\bar A \bar B \bar CABC‾\overline{ABC}Aˉ+Bˉ+Cˉ\bar A + \bar B + \bar C
0001111
0010011
0100011
0110011
1000011
1010011
1100011
1110000

Columns 4 and 5 are identical, and columns 6 and 7 are identical for all 8 combinations, so both theorems hold for 3 variables.

Algebraic check (using the 2-variable law with X=B+CX = B + C):

A+B+C‾=A+X‾=Aˉ⋅Xˉ=Aˉ⋅B+C‾=AˉBˉCˉ\begin{aligned} \overline{A + B + C} &= \overline{A + X} = \bar A \cdot \bar X \\ &= \bar A \cdot \overline{B + C} = \bar A \bar B \bar C \end{aligned}

Similarly, A(BC)‾=Aˉ+BC‾=Aˉ+Bˉ+Cˉ\overline{A(BC)} = \bar A + \overline{BC} = \bar A + \bar B + \bar C.

 3-input NOR = bubbled 3-input AND
 3-input NAND = bubbled 3-input OR
  • 2081 Bhadra · 2+3 marks

State De Morgan's Laws. Construct 2 input XNOR gate using only NOR gates.

Answer

De Morgan's laws

First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.

A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}

Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

In words: "break the bar and change the sign".

Example: Aˉ+B‾=ABˉ\overline{\bar A + B} = A \bar B and ACˉ‾=Aˉ+C\overline{A \bar C} = \bar A + C.

2-input XNOR using only NOR gates

Y=A⊙B=AB+AˉBˉ=ABˉ+AˉB‾Y = A \odot B = AB + \bar A \bar B = \overline{A\bar B + \bar A B} needs four 2-input NOR gates (the dual of the 4-NAND XOR).

G1=A+B‾G2=A+G1‾=Aˉ(A+B)=AˉBG3=B+G1‾=Bˉ(A+B)=ABˉY=G2+G3‾=AˉB+ABˉ‾=A⊙B\begin{aligned} G_1 &= \overline{A + B} \\ G_2 &= \overline{A + G_1} = \bar A (A + B) = \bar A B \\ G_3 &= \overline{B + G_1} = \bar B (A + B) = A \bar B \\ Y &= \overline{G_2 + G_3} = \overline{\bar A B + A \bar B} = A \odot B \end{aligned}
 A --+---------------[NOR G2]--+
     |                 |       |
     +--[NOR G1]---G1--+       +--[NOR G4]-- Y
     |                 |       |
 B --+---------------[NOR G3]--+
ABG1G_1G2G_2G3G_3Y
001001
010100
100010
110001

Y = 1 only when A = B, which is the XNOR function.

  • 2080 Baisakh · 2+3 marks

Describe positive and negative logic with an example. Construct Ex-NOR gate using only NOR gates.

Answer

Positive and negative logic

  • Positive logic: HIGH voltage = 1, LOW voltage = 0. Example: TTL with +5 V = 1, 0 V = 0.
  • Negative logic: HIGH voltage = 0, LOW voltage = 1. Example: +5 V = 0, 0 V = 1.

Example: a gate gives a HIGH output only when both inputs are HIGH (L L → L, L H → L, H L → L, H H → H).

  • In positive logic this is 00→0, 01→0, 10→0, 11→1: an AND gate.
  • In negative logic this is 11→1, 10→1, 01→1, 00→0: an OR gate.

So positive AND = negative OR (and positive NAND = negative NOR, positive XOR = negative XNOR).

Ex-NOR gate using only NOR gates

Y=A⊙B=AB+AˉBˉ=ABˉ+AˉB‾Y = A \odot B = AB + \bar A \bar B = \overline{A\bar B + \bar A B} needs four 2-input NOR gates (the dual of the 4-NAND XOR).

G1=A+B‾G2=A+G1‾=Aˉ(A+B)=AˉBG3=B+G1‾=Bˉ(A+B)=ABˉY=G2+G3‾=AˉB+ABˉ‾=A⊙B\begin{aligned} G_1 &= \overline{A + B} \\ G_2 &= \overline{A + G_1} = \bar A (A + B) = \bar A B \\ G_3 &= \overline{B + G_1} = \bar B (A + B) = A \bar B \\ Y &= \overline{G_2 + G_3} = \overline{\bar A B + A \bar B} = A \odot B \end{aligned}
 A --+---------------[NOR G2]--+
     |                 |       |
     +--[NOR G1]---G1--+       +--[NOR G4]-- Y
     |                 |       |
 B --+---------------[NOR G3]--+
ABG1G_1G2G_2G3G_3Y
001001
010100
100010
110001
  • 2078 Kartik · 2+2 marks

Define universal gates with example. Explain positive and negative logic.

Answer

Universal gates

A universal gate is a gate that alone can implement NOT, AND and OR, and hence any Boolean function. NAND and NOR are universal gates.

Examples with NAND only:

  • NOT: A⋅A‾=Aˉ\overline{A \cdot A} = \bar A
  • AND: NAND followed by a NAND inverter, AB‾‾=AB\overline{\overline{AB}} = AB
  • OR: Aˉ⋅Bˉ‾=A+B\overline{\bar A \cdot \bar B} = A + B

Examples with NOR only:

  • NOT: A+A‾=Aˉ\overline{A + A} = \bar A
  • OR: NOR followed by a NOR inverter
  • AND: Aˉ+Bˉ‾=AB\overline{\bar A + \bar B} = AB
 OR from NAND:
 A --[NAND]-- A' --+
 B --[NAND]-- B' --+--[NAND]-- A+B

Positive and negative logic

  • Positive logic: HIGH level = logic 1 and LOW level = logic 0 (e.g. +5 V = 1, 0 V = 0).
  • Negative logic: HIGH level = logic 0 and LOW level = logic 1.

The same circuit changes its logic name when the convention changes. A gate with output HIGH only when both inputs are HIGH is AND in positive logic but OR in negative logic; similarly positive NAND = negative NOR.

  • 2078 Kartik · 3 marks

Design three input exclusive NOR gate using NOR gates only.

Answer

A 3-input XNOR gives Y=A⊕B⊕C‾Y = \overline{A \oplus B \oplus C}. Use the 4-NOR XNOR block twice and one NOR inverter.

Since A⊕B‾⊙C=A⊕B‾⊕C‾=A⊕B⊕C\overline{A \oplus B} \odot C = \overline{\overline{A \oplus B} \oplus C} = A \oplus B \oplus C, two XNOR blocks give XOR, and a final NOR inverter gives XNOR:

P=A⊙B=A⊕B‾(4 NOR)Q=P⊙C=A⊕B⊕C(4 NOR)Y=Q+Q‾=A⊕B⊕C‾(1 NOR)\begin{aligned} P &= A \odot B = \overline{A \oplus B} \quad (4 \text{ NOR}) \\ Q &= P \odot C = A \oplus B \oplus C \quad (4 \text{ NOR}) \\ Y &= \overline{Q + Q} = \overline{A \oplus B \oplus C} \quad (1 \text{ NOR}) \end{aligned}

Each XNOR block: G1=X+Z‾G_1 = \overline{X+Z}, G2=X+G1‾G_2 = \overline{X+G_1}, G3=Z+G1‾G_3 = \overline{Z+G_1}, out =G2+G3‾= \overline{G_2+G_3}.

 A --+
     +--[XNOR: 4 NOR]-- P --+
 B --+                      +--[XNOR: 4 NOR]-- Q
                       C ---+                  |
                 Y --[NOR, inputs tied]--------+

Total: 9 NOR gates.

ABCPQY
000101
001110
010010
011001
100010
101001
110101
111110

Y = 1 when an even number of inputs are 1.

  • 2076 Chaitra · 3 marks

Realize 3 inputs XOR gates using NAND gates only.

Answer

A 3-input XOR gives Y=A⊕B⊕C=(A⊕B)⊕CY = A \oplus B \oplus C = (A \oplus B) \oplus C. Each 2-input XOR needs 4 NAND gates, so cascade two 4-NAND XOR blocks: 8 NAND gates.

Block 1: P=A⊕BP = A \oplus B G1=AB‾G_1 = \overline{AB}, G2=AG1‾G_2 = \overline{A G_1}, G3=BG1‾G_3 = \overline{B G_1}, P=G2G3‾P = \overline{G_2 G_3}

Block 2: Y=P⊕CY = P \oplus C G5=PC‾G_5 = \overline{PC}, G6=PG5‾G_6 = \overline{P G_5}, G7=CG5‾G_7 = \overline{C G_5}, Y=G6G7‾Y = \overline{G_6 G_7}

 A --+-------[G2]--+
     +--[G1]--+    +--[G4]--P--+-------[G6]--+
 B --+-------[G3]--+           +--[G5]--+    +--[G8]-- Y
                           C --+-------[G7]--+
 (all gates are 2-input NAND)
ABCP = A⊕BY
00000
00101
01011
01110
10011
10110
11000
11101

Y = 1 when an odd number of inputs are 1.

  • 2075 Chaitra · 4+2 marks

State and prove De Morgan's theorem. Design X-NOR gate using anyone of universal gate.

Answer

De Morgan's theorems

De Morgan's theorems tell us how to complement a sum or a product of variables.

Theorem 1: The complement of a sum equals the product of the complements.

A+B‾=A‾⋅B‾\overline{A+B} = \overline{A}\cdot\overline{B}

Theorem 2: The complement of a product equals the sum of the complements.

A⋅B‾=A‾+B‾\overline{A\cdot B} = \overline{A}+\overline{B}

In words: to complement an expression, change every OR into AND (and every AND into OR) and complement each variable. So a NOR gate is the same as an AND gate with inverted inputs ("bubbled AND"), and a NAND gate is the same as an OR gate with inverted inputs ("bubbled OR").

Proof by truth table

ABA+BA+BA+B‾\overline{A+B}A‾ B‾\overline{A}\,\overline{B}ABABAB‾\overline{AB}A‾+B‾\overline{A}+\overline{B}
00011011
01100011
10100011
11100100

Column 4 equals column 5 for all inputs, which proves Theorem 1. Column 7 equals column 8, which proves Theorem 2.

Algebraic proof of Theorem 1: if X=A+BX = A+B and Y=A‾ B‾Y = \overline{A}\,\overline{B}, then YY is the complement of XX only if X+Y=1X+Y=1 and X⋅Y=0X\cdot Y=0.

X+Y=A+B+A‾ B‾=A+B+A‾=1X⋅Y=(A+B)A‾ B‾=AA‾ B‾+BA‾ B‾=0+0=0\begin{aligned} X+Y &= A+B+\overline{A}\,\overline{B} = A + B + \overline{A} = 1 \\ X\cdot Y &= (A+B)\overline{A}\,\overline{B} = A\overline{A}\,\overline{B} + B\overline{A}\,\overline{B} = 0+0 = 0 \end{aligned}

So A+B‾=A‾ B‾\overline{A+B} = \overline{A}\,\overline{B}. Theorem 2 follows by duality.

X-NOR gate using NOR gates only

Y=A⊙B=AB+A‾ B‾Y = A \odot B = AB + \overline{A}\,\overline{B}

Four NOR gates are enough:

  1. G1=A+B‾G_1 = \overline{A+B}
  2. G2=A+G1‾=A‾ (A+B)=A‾BG_2 = \overline{A + G_1} = \overline{A}\,(A+B) = \overline{A}B
  3. G3=B+G1‾=B‾ (A+B)=AB‾G_3 = \overline{B + G_1} = \overline{B}\,(A+B) = A\overline{B}
  4. Y=G2+G3‾=A‾B+AB‾‾=AB+A‾ B‾Y = \overline{G_2 + G_3} = \overline{\overline{A}B + A\overline{B}} = AB + \overline{A}\,\overline{B}
A ──┬──────────────┐
    │              [NOR]── G2 ──┐
    ├──[NOR]── G1 ─┤            [NOR]── Y = A XNOR B
    │              [NOR]── G3 ──┘
B ──┴──────────────┘

(G1 = NOR(A,B); G2 = NOR(A,G1); G3 = NOR(B,G1); Y = NOR(G2,G3).)

ABG1G2G3Y
001001
010100
100010
110001

The output is 1 only when A = B, so the circuit is an X-NOR gate. (With NAND gates, four NANDs give X-OR and a fifth NAND used as an inverter gives X-NOR.)

Questions from Old Question Collection (EX 502) (IOE EX 502 exam papers (BEL/BEX/BCT II/I) from 2068 to 2081) and Old Question Collection (BEI, EX 401) (IOE EX 401 exam papers (BEI I/I) from 2075 to 2082). Answers are written for this site; check them against your class notes.

Chapter titles and hours from the IOE syllabus ↗