Skip to main content

Chapter 4 · 5 hours

Data Processing Circuits

IOE past exam questions

Past questions and answers

70 questions set from this chapter, 9 of them more than once. Most asked first.

  • Asked 4 times
  • 2081 Bhadra · 5 marks
  • 2070 Chaitra · 5 marks
  • 2069 Chaitra · 4 marks
  • 2068 Baisakh · 6 marks

Explain the operation of two bit magnitude comparator with truth table and circuit diagram.

Answer

A magnitude comparator is a combinational circuit that compares two binary numbers A and B and gives three outputs: A>BA>B, A=BA=B and A<BA<B. Exactly one output is 1 at a time.

A 2-bit comparator compares A=A1A0A = A_1A_0 with B=B1B0B = B_1B_0 (4 inputs, 3 outputs).

Operation

  1. Compare the most significant bits first. If A1=1A_1 = 1 and B1=0B_1 = 0, then A>BA>B; if A1=0A_1 = 0 and B1=1B_1 = 1, then A<BA<B.
  2. Only if A1=B1A_1 = B_1 are the LSBs A0A_0, B0B_0 compared in the same way.
  3. A=BA=B only when both bit pairs are equal.

Equality of bit ii is given by an X-NOR gate:

xi=AiBi+Ai‾ Bi‾=Ai⊕Bi‾x_i = A_iB_i + \overline{A_i}\,\overline{B_i} = \overline{A_i \oplus B_i}

Truth table

A1A0A_1A_0B1B0B_1B_0A>BA>BA=BA=BA<BA<B
0 00 0010
0 00 1001
0 01 0001
0 01 1001
0 10 0100
0 10 1010
0 11 0001
0 11 1001
1 00 0100
1 00 1100
1 01 0010
1 01 1001
1 10 0100
1 10 1100
1 11 0100
1 11 1010

Output expressions

(A=B)=x1x0(A>B)=A1B1‾+x1A0B0‾(A<B)=A1‾B1+x1A0‾B0\begin{aligned} (A=B) &= x_1x_0 \\ (A>B) &= A_1\overline{B_1} + x_1A_0\overline{B_0} \\ (A<B) &= \overline{A_1}B_1 + x_1\overline{A_0}B_0 \end{aligned}

(The same results come from 4-variable K-maps of the table, e.g. A>B=A1B1‾+A0B1‾ B0‾+A1A0B0‾A>B = A_1\overline{B_1} + A_0\overline{B_1}\,\overline{B_0} + A_1A_0\overline{B_0}.)

Circuit diagram

A1,B1 ─[XNOR]── x1        A0,B0 ─[XNOR]── x0

x1, x0 ───────────[AND]────────────── A=B

A1, B1' ──────────[AND]──┐
                         ├─[OR]────── A>B
x1, A0, B0' ──────[AND]──┘

A1', B1 ──────────[AND]──┐
                         ├─[OR]────── A<B
x1, A0', B0 ──────[AND]──┘

Gates: 2 X-NOR gates for x1x_1, x0x_0; one AND for A=BA=B; two ANDs and an OR for each of A>BA>B and A<BA<B (inverters give the complemented bits).

Example: A=10A = 10, B=11B = 11: A1=B1A_1 = B_1 so x1=1x_1 = 1; A0‾B0=1\overline{A_0}B_0 = 1, so A<B=1A<B = 1, and the other outputs are 0.

  • Asked 3 times
  • 2082 Baisakh · 5 marks
  • 2081 Baisakh · 5 marks
  • 2078 Bhadra · 5 marks

Design 5×32 line decoder using 3×8 line decoders and necessary logic gates.

Answer

A 5×32 decoder has 5 inputs A4A3A2A1A0A_4A_3A_2A_1A_0 and 32 outputs D0D_0–D31D_{31}; exactly one output is active for each input code. A 3×8 decoder (e.g. 74138) has 3 inputs, 8 outputs and an enable input E. Since 32/8=432/8 = 4, four 3×8 decoders are needed.

Design idea

  • The three low bits A2A1A0A_2A_1A_0 go to the inputs of all four decoders in parallel.
  • The two high bits A4A3A_4A_3 select which one decoder is enabled. This is done with two NOT gates and four AND gates (a 2×4 decoding of A4A3A_4A_3):
A4A_4A3A_3Enable signalDecoder enabledOutputs active
00E0=A4‾ A3‾E_0 = \overline{A_4}\,\overline{A_3}DEC 0D0D_0–D7D_7
01E1=A4‾A3E_1 = \overline{A_4}A_3DEC 1D8D_8–D15D_{15}
10E2=A4A3‾E_2 = A_4\overline{A_3}DEC 2D16D_{16}–D23D_{23}
11E3=A4A3E_3 = A_4A_3DEC 3D24D_{24}–D31D_{31}

Circuit

A4 ──┬────────[NOT]── A4'
A3 ──┼──┬─────[NOT]── A3'
     │  │
  E0 = A4'·A3'  (AND)
  E1 = A4'·A3   (AND)
  E2 = A4 ·A3'  (AND)
  E3 = A4 ·A3   (AND)

A2 A1 A0 (common to all four decoders)
     │
     ├──>+-----------+
     │   | 3x8  DEC0 |── D0 ... D7
     │   +-----------+
     │       E ── E0
     ├──>+-----------+
     │   | 3x8  DEC1 |── D8 ... D15
     │   +-----------+
     │       E ── E1
     ├──>+-----------+
     │   | 3x8  DEC2 |── D16 ... D23
     │   +-----------+
     │       E ── E2
     └──>+-----------+
         | 3x8  DEC3 |── D24 ... D31
         +-----------+
             E ── E3

Operation

For an input A4A3A2A1A0A_4A_3A_2A_1A_0, only one enable is 1, so only one decoder works; the others keep all outputs inactive. Inside that decoder, A2A1A0A_2A_1A_0 selects one of its 8 outputs. Output number = 8×(A4A3)10+(A2A1A0)108 \times (A_4A_3)_{10} + (A_2A_1A_0)_{10}.

Example: input 10110 (22): A4A3=10A_4A_3 = 10 enables DEC2 (outputs 16–23); A2A1A0=110=6A_2A_1A_0 = 110 = 6 selects its output 6, i.e. D16+6=D22D_{16+6} = D_{22}.

(With 74138 chips, the enable can instead be done using its three enable pins G1,G2A‾,G2B‾G_1, \overline{G_{2A}}, \overline{G_{2B}}, but the AND-gate method above works with any 3×8 decoder having one active-high enable.)

  • Asked 3 times
  • 2079 Bhadra · 5 marks
  • 2076 Chaitra · 5 marks
  • 2072 Chaitra · 6 marks

Realize a full-subtractor logic circuit using a single 1:4 demultiplexer and necessary logic gates.

Answer

A full subtractor subtracts BB and a borrow-in BinB_{in} from AA, giving difference DD and borrow-out BoB_o.

Truth table

ABBinB_{in}DBoB_o
00000
00111
01011
01101
10010
10100
11000
11111
D=Σm(1,2,4,7)=A⊕B⊕Bin,Bo=Σm(1,2,3,7)D = \Sigma m(1,2,4,7) = A \oplus B \oplus B_{in}, \qquad B_o = \Sigma m(1,2,3,7)

Using a 1:4 DEMUX as a 2-to-4 decoder

Connect the data input of the 1:4 demultiplexer to logic 1 and use A, B as its select lines S1S0S_1S_0. Each output is then one minterm of A and B:

Y0=A‾ B‾,Y1=A‾B,Y2=AB‾,Y3=ABY_0 = \overline{A}\,\overline{B},\quad Y_1 = \overline{A}B,\quad Y_2 = A\overline{B},\quad Y_3 = AB

Group the truth table by A, B and see how D and BoB_o depend on BinB_{in}:

ABActive outputDBoB_o
00Y0Y_0BinB_{in}BinB_{in}
01Y1Y_1Bin‾\overline{B_{in}}1
10Y2Y_2Bin‾\overline{B_{in}}0
11Y3Y_3BinB_{in}BinB_{in}

So:

D=Bin(Y0+Y3)+Bin‾(Y1+Y2)=Bin⊕(Y1+Y2)Bo=Y1+Bin(Y0+Y3)\begin{aligned} D &= B_{in}(Y_0+Y_3) + \overline{B_{in}}(Y_1+Y_2) = B_{in} \oplus (Y_1+Y_2) \\ B_o &= Y_1 + B_{in}(Y_0+Y_3) \end{aligned}

(Since exactly one Y is 1, Y0+Y3=Y1+Y2‾Y_0+Y_3 = \overline{Y_1+Y_2}.)

Circuit

        +------------+
 1 ────>| Din    Y0  |── Y0
        |        Y1  |── Y1
        |  1:4   Y2  |── Y2
        | DEMUX  Y3  |── Y3
        +------------+
          S1    S0
          A     B

Y1, Y2 ─────[OR]── Q
Q, Bin ─────[XOR]─────────────── D

Y0, Y3 ─────[OR]── P
P, Bin ─────[AND]── Bin·P ──┐
                            ├─[OR]── Bo
Y1 ─────────────────────────┘

Gates needed: one 1:4 DEMUX, three 2-input OR gates, one AND gate and one XOR gate.

Check: A=0, B=1, BinB_{in}=1 (row 3): Y1=1Y_1 = 1, so Q=1Q = 1, D=1⊕1=0D = 1 \oplus 1 = 0 and Bo=Y1=1B_o = Y_1 = 1. This matches the truth table.

  • Asked 2 times
  • 2080 Baisakh · 8 marks
  • 2078 Bhadra · 4 marks

Realize Full Adder Circuit using a 2×4 decoder and using logic gates.

Answer

A full adder adds three bits A, B and carry-in CinC_{in} and gives sum S and carry-out CoC_o.

Truth table

ABCinC_{in}SCoC_o
00000
00110
01010
01101
10010
10101
11001
11111
S=Σm(1,2,4,7),Co=Σm(3,5,6,7)S = \Sigma m(1,2,4,7), \qquad C_o = \Sigma m(3,5,6,7)

Realization with logic gates

From K-maps / algebra:

S=A⊕B⊕CinCo=AB+BCin+ACin=AB+Cin(A⊕B)\begin{aligned} S &= A \oplus B \oplus C_{in} \\ C_o &= AB + BC_{in} + AC_{in} = AB + C_{in}(A \oplus B) \end{aligned}
A, B ────────[XOR]── P = A⊕B
P, Cin ──────[XOR]──────────────── S

P, Cin ──────[AND]── Cin·P ──┐
                             ├─[OR]── Co
A, B ────────[AND]── AB ─────┘

(Two XOR, two AND and one OR gate.)

Realization with a 2×4 decoder

A 2×4 decoder has only two inputs, so it cannot generate all 8 minterms. Feed A and B to the decoder; its outputs are the minterms of A, B:

Y0=A‾ B‾,Y1=A‾B,Y2=AB‾,Y3=ABY_0 = \overline{A}\,\overline{B},\quad Y_1 = \overline{A}B,\quad Y_2 = A\overline{B},\quad Y_3 = AB

Write S and CoC_o for each AB combination in terms of CinC_{in}:

ABDecoder outputSCoC_o
00Y0Y_0CinC_{in}0
01Y1Y_1Cin‾\overline{C_{in}}CinC_{in}
10Y2Y_2Cin‾\overline{C_{in}}CinC_{in}
11Y3Y_3CinC_{in}1
S=Cin(Y0+Y3)+Cin‾(Y1+Y2)=Cin⊕(Y1+Y2)Co=Y3+Cin(Y1+Y2)\begin{aligned} S &= C_{in}(Y_0+Y_3) + \overline{C_{in}}(Y_1+Y_2) = C_{in} \oplus (Y_1+Y_2) \\ C_o &= Y_3 + C_{in}(Y_1+Y_2) \end{aligned}

(Y1+Y2=A⊕BY_1 + Y_2 = A \oplus B, so these are the same equations as the gate realization.)

          +----------+
 A ──────>| I1    Y0 |── (not used)
 B ──────>| I0    Y1 |── Y1
          |  2x4  Y2 |── Y2
          |  DEC  Y3 |── Y3
          +----------+

Y1, Y2 ──────[OR]── P (= A⊕B)
P, Cin ──────[XOR]─────────────── S

P, Cin ──────[AND]── Cin·P ──┐
                             ├─[OR]── Co
Y3 ──────────────────────────┘

Gates needed besides the decoder: two OR gates, one XOR gate and one AND gate.

Check: A=1, B=1, CinC_{in}=0: Y3=1Y_3 = 1, P=0P = 0, so S=0⊕0=0S = 0 \oplus 0 = 0 and Co=Y3=1C_o = Y_3 = 1; correct (1+1=1021+1 = 10_2).

(With a 3×8 decoder, the usual method S=Y1+Y2+Y4+Y7S = Y_1+Y_2+Y_4+Y_7, Co=Y3+Y5+Y6+Y7C_o = Y_3+Y_5+Y_6+Y_7 would need no XOR gate.)

  • Asked 2 times
  • 2078 Kartik · 2+6 marks
  • 2069 Chaitra · 2+4 marks

What is a priority encoder? Design an octal priority encoder.

Answer

A priority encoder is an encoder that, when more than one input is active at the same time, outputs the code of the input with the highest priority and ignores the others. It also has a valid output V that is 1 when at least one input is active, to separate "input D0D_0 active" from "no input active" (both give code 000).

Octal (8-to-3) priority encoder

Inputs D0D_0–D7D_7 (active high), D7D_7 has the highest priority. Outputs A2A1A0A_2A_1A_0 (binary code) and V. X = don't care.

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0A2A_2A1A_1A0A_0V
00000000XXX0
000000010001
0000001X0011
000001XX0101
00001XXX0111
0001XXXX1001
001XXXXX1011
01XXXXXX1101
1XXXXXXX1111

Output equations

Each output is 1 for the rows where the highest active input has that bit set. For example, A0=1A_0 = 1 for highest input 7, 5, 3 or 1. Input 5 counts only if 6 and 7 are 0, and so on. After simplification (a term like D7‾D6\overline{D_7}D_6 reduces to D6D_6 because D7+D7‾D6=D7+D6D_7 + \overline{D_7}D_6 = D_7 + D_6):

A2=D4+D5+D6+D7A1=D7+D6+D3D4‾ D5‾+D2D4‾ D5‾A0=D7+D5D6‾+D3D4‾ D6‾+D1D2‾ D4‾ D6‾V=D0+D1+D2+D3+D4+D5+D6+D7\begin{aligned} A_2 &= D_4 + D_5 + D_6 + D_7 \\ A_1 &= D_7 + D_6 + D_3\overline{D_4}\,\overline{D_5} + D_2\overline{D_4}\,\overline{D_5} \\ A_0 &= D_7 + D_5\overline{D_6} + D_3\overline{D_4}\,\overline{D_6} + D_1\overline{D_2}\,\overline{D_4}\,\overline{D_6} \\ V &= D_0 + D_1 + D_2 + D_3 + D_4 + D_5 + D_6 + D_7 \end{aligned}

Logic diagram

D4,D5,D6,D7 ─────────────────[OR]── A2

D7 ─────────────────────────┐
D6 ─────────────────────────┤
D3,D4',D5' ──[AND]──────────┼[OR]── A1
D2,D4',D5' ──[AND]──────────┘

D7 ─────────────────────────┐
D5,D6' ──────[AND]──────────┤
D3,D4',D6' ──[AND]──────────┼[OR]── A0
D1,D2',D4',D6' ─[AND]───────┘

D0 ... D7 ───────────────────[OR]── V

Complements D2‾,D4‾,D5‾,D6‾\overline{D_2}, \overline{D_4}, \overline{D_5}, \overline{D_6} come from NOT gates.

Example: D6=D3=D1=1D_6 = D_3 = D_1 = 1, others 0. Then A2=1A_2 = 1, A1=D6=1A_1 = D_6 = 1, A0=0A_0 = 0 (since D6‾=0\overline{D_6} = 0 blocks every term except D7D_7). Output = 110 = 6, the highest-priority active input, and V = 1. The IC 74148 is a standard 8-to-3 priority encoder (with active-low inputs and outputs).

  • Asked 2 times
  • 2075 Chaitra · 6 marks
  • 2072 Chaitra · 7 marks

Design a simplest logic circuit for 'b' segment of the BCD-to-7 segment display decoder.

Answer

A BCD-to-7-segment decoder converts a 4-bit BCD digit ABCDABCD (A = MSB) into the seven signals a–g that light the segments of a display. Assume a common-cathode display, so a segment glows when its signal is 1.

     a
   ─────
  │     │
 f│     │b
  │  g  │
   ─────
  │     │
 e│     │c
  │     │
   ─────
     d

Truth table for segment b

Segment b (upper right) is ON for digits 0, 1, 2, 3, 4, 7, 8, 9 and OFF for 5 and 6. Inputs 1010–1111 are not valid BCD, so they are don't-cares.

DigitA B C Db
00 0 0 01
10 0 0 11
20 0 1 01
30 0 1 11
40 1 0 01
50 1 0 10
60 1 1 00
70 1 1 11
81 0 0 01
91 0 0 11
10–15invalidX
b=Σm(0,1,2,3,4,7,8,9)+d(10,11,12,13,14,15)b = \Sigma m(0,1,2,3,4,7,8,9) + d(10,11,12,13,14,15)

K-map

        CD
AB      00  01  11  10
      +---+---+---+---+
 00   | 1 | 1 | 1 | 1 |
      +---+---+---+---+
 01   | 1 | 0 | 1 | 0 |
      +---+---+---+---+
 11   | X | X | X | X |
      +---+---+---+---+
 10   | 1 | 1 | X | X |
      +---+---+---+---+
  • Octet m(0,1,2,3,8,9,10,11) → B‾\overline{B}
  • Quad m(0,4,8,12) → C‾ D‾\overline{C}\,\overline{D}
  • Quad m(3,7,11,15) → CDCD
b=B‾+C‾ D‾+CD=B‾+(C⊙D)b = \overline{B} + \overline{C}\,\overline{D} + CD = \overline{B} + (C \odot D)

Check: digit 5 (B=1B=1, C=0C=0, D=1D=1): B‾=0\overline{B}=0, C‾ D‾=0\overline{C}\,\overline{D}=0, CD=0CD=0, so b = 0. Digit 6 (B=1B=1, C=1C=1, D=0D=0): b = 0. All other digits give 1.

Simplest logic circuit

Since C‾ D‾+CD=C⊕D‾\overline{C}\,\overline{D} + CD = \overline{C \oplus D}, segment b needs only one X-NOR gate, one NOT gate and one OR gate:

B ──[NOT]── B' ──────────┐
                         [OR]── b
C ──┐                    │
    [XNOR]── C⊙D ────────┘
D ──┘

(If X-NOR is not allowed, use two NOT gates, two AND gates and a 3-input OR for B‾+C‾ D‾+CD\overline{B} + \overline{C}\,\overline{D} + CD.)

  • Asked 2 times
  • 2075 Chaitra · 5 marks
  • 2074 Chaitra · 5 marks

Explain the operation of 3 bit magnitude comparator with truth table and draw the circuit.

Answer

A magnitude comparator compares two binary numbers and indicates whether A>BA>B, A=BA=B or A<BA<B. A 3-bit comparator compares A=A2A1A0A = A_2A_1A_0 with B=B2B1B0B = B_2B_1B_0 (6 inputs, 64 combinations, 3 outputs).

Operation

Comparison starts at the most significant bit:

  1. If A2≠B2A_2 \ne B_2, the result is decided: A2=1,B2=0A_2 = 1, B_2 = 0 gives A>BA>B; A2=0,B2=1A_2 = 0, B_2 = 1 gives A<BA<B.
  2. If A2=B2A_2 = B_2, compare A1A_1 and B1B_1 in the same way.
  3. If A2=B2A_2 = B_2 and A1=B1A_1 = B_1, compare A0A_0 and B0B_0.
  4. If all three pairs are equal, A=BA = B.

Bit equality is detected by X-NOR gates:

xi=AiBi+Ai‾ Bi‾,i=0,1,2x_i = A_iB_i + \overline{A_i}\,\overline{B_i}, \quad i = 0, 1, 2

Truth table (condensed)

The full table has 64 rows; it is written compactly by bit priority (X = any value):

A2A_2 vs B2B_2A1A_1 vs B1B_1A0A_0 vs B0B_0A>BA>BA=BA=BA<BA<B
A2>B2A_2>B_2 (1,0)XX100
A2<B2A_2<B_2 (0,1)XX001
A2=B2A_2=B_2A1>B1A_1>B_1X100
A2=B2A_2=B_2A1<B1A_1<B_1X001
A2=B2A_2=B_2A1=B1A_1=B_1A0>B0A_0>B_0100
A2=B2A_2=B_2A1=B1A_1=B_1A0<B0A_0<B_0001
A2=B2A_2=B_2A1=B1A_1=B_1A0=B0A_0=B_0010

Sample rows: A=101,B=011A=101, B=011 gives A>BA>B (decided at A2A_2); A=110,B=111A=110, B=111 gives A<BA<B (decided at A0A_0); A=B=010A=B=010 gives A=BA=B.

Output expressions

(A=B)=x2x1x0(A>B)=A2B2‾+x2A1B1‾+x2x1A0B0‾(A<B)=A2‾B2+x2A1‾B1+x2x1A0‾B0\begin{aligned} (A=B) &= x_2x_1x_0 \\ (A>B) &= A_2\overline{B_2} + x_2A_1\overline{B_1} + x_2x_1A_0\overline{B_0} \\ (A<B) &= \overline{A_2}B_2 + x_2\overline{A_1}B_1 + x_2x_1\overline{A_0}B_0 \end{aligned}

Circuit

A2,B2 ─[XNOR]─ x2     A1,B1 ─[XNOR]─ x1
A0,B0 ─[XNOR]─ x0

x2, x1, x0 ──────────[AND]──────────── A=B

A2, B2' ─────────[AND]──┐
x2, A1, B1' ─────[AND]──┼─[OR]──────── A>B
x2, x1, A0, B0' ─[AND]──┘

A2', B2 ─────────[AND]──┐
x2, A1', B1 ─────[AND]──┼─[OR]──────── A<B
x2, x1, A0', B0 ─[AND]──┘

Gates: 3 X-NOR, 7 AND, 2 OR (plus inverters for the complemented bits). The A<BA<B output can also be obtained as (A>B)+(A=B)‾\overline{(A>B) + (A=B)} using one NOR gate.

  • Asked 2 times
  • 2079 Bhadra · 1+5 marks
  • 2074 Asoj · 1+4 marks

What is an encoder? Explain 8 to 3 line encoder with circuit diagram and truth table.

Answer

An encoder is a combinational circuit that converts an active signal on one of its 2n2^n (or fewer) input lines into an n-bit binary code. It does the reverse of a decoder.

8-to-3 line (octal-to-binary) encoder

It has 8 inputs D0D_0–D7D_7 (one per octal digit) and 3 outputs A2A1A0A_2A_1A_0. It is assumed that only one input is 1 at any time.

D0D_0D1D_1D2D_2D3D_3D4D_4D5D_5D6D_6D7D_7A2A_2A1A_1A0A_0
10000000000
01000000001
00100000010
00010000011
00001000100
00000100101
00000010110
00000001111

Output expressions

Each output is the OR of the inputs whose code has a 1 in that bit:

A2=D4+D5+D6+D7A1=D2+D3+D6+D7A0=D1+D3+D5+D7\begin{aligned} A_2 &= D_4 + D_5 + D_6 + D_7 \\ A_1 &= D_2 + D_3 + D_6 + D_7 \\ A_0 &= D_1 + D_3 + D_5 + D_7 \end{aligned}

Circuit diagram

 D0 D1 D2 D3 D4 D5 D6 D7
  │  │  │  │  │  │  │  │
  x  │  │  │  ├──┼──┼──┼──[OR]── A2  (D4,D5,D6,D7)
     │  ├──┼──┼──┼──┼──┼──[OR]── A1  (D2,D3,D6,D7)
     ├──┼──┼──┼──┼──┼──┼──[OR]── A0  (D1,D3,D5,D7)

Three 4-input OR gates are enough; D0D_0 is not connected (no output bit is 1 for it).

Limitations

  • If no input is active, the output is 000, the same as for D0D_0; a valid-output line is needed to tell them apart.
  • If two inputs are active together, the output is wrong (e.g. D3D_3 and D5D_5 give 011+101=111011 + 101 = 111, which reads as 7). A priority encoder solves this by encoding only the highest active input.
  • Asked 2 times
  • 2080 Bhadra · 5 marks
  • 2080 Baisakh · 5 marks

Realize a full-adder circuit using a single 1:4 demultiplexer and necessary logic gates.

Answer

A 1:4 demultiplexer with its data input tied to logic 1 behaves as a 2-to-4 decoder: with A,BA, B on the select lines, each output YiY_i is one minterm of AA and BB. The third input CinC_{in} is then combined with these outputs using a few gates.

Truth table of the full adder

ABCinC_{in}SCoutC_{out}
00000
00110
01010
01101
10010
10101
11001
11111

Expressing S and CoutC_{out} in terms of the DEMUX outputs

With S1=AS_1 = A, S0=BS_0 = B and data input D=1D = 1:

Y0=A′B′,Y1=A′B,Y2=AB′,Y3=ABY_0 = A'B',\quad Y_1 = A'B,\quad Y_2 = AB',\quad Y_3 = AB

From the table, grouping by ABAB:

ABDEMUX outputSCoutC_{out}
00Y0Y_0CinC_{in}0
01Y1Y_1Cin′C_{in}'CinC_{in}
10Y2Y_2Cin′C_{in}'CinC_{in}
11Y3Y_3CinC_{in}1
S=(Y0+Y3)Cin+(Y1+Y2)Cin′=(Y1+Y2)⊕CinCout=Y3+(Y1+Y2) Cin\begin{aligned} S &= (Y_0 + Y_3)C_{in} + (Y_1 + Y_2)C_{in}' \\ &= (Y_1 + Y_2) \oplus C_{in} \\ C_{out} &= Y_3 + (Y_1 + Y_2)\,C_{in} \end{aligned}

(Here Y1+Y2=A⊕BY_1 + Y_2 = A \oplus B.)

Circuit

        +----------+
  1 --->| D     Y0 |-- (not used)
        |  1:4  Y1 |--+
  A --->| S1    Y2 |--+--[OR]--- P  (= A xor B)
  B --->| S0    Y3 |------------ Y3
        +----------+

  P, Cin  ---[XOR]-------------------- S
  P, Cin  ---[AND]--- P.Cin --+
  Y3 -------------------------+--[OR]-- Cout

Gates needed: one 2-input OR (P=Y1+Y2P = Y_1 + Y_2), one XOR (S=P⊕CinS = P \oplus C_{in}), one AND (P⋅CinP \cdot C_{in}) and one OR (Cout=Y3+PCinC_{out} = Y_3 + P C_{in}).

Check: for A=1,B=1,Cin=1A=1, B=1, C_{in}=1: Y3=1Y_3 = 1, P=0P = 0, so S=0⊕1=1S = 0 \oplus 1 = 1 and Cout=1C_{out} = 1, i.e. 1+1+1=1121+1+1 = 11_2. Correct.

  • 2081 Bhadra · 2+2+3 marks

Compare a demultiplexer with the decoder. What is a seven-segment decoder? Find out the simplest logic expression for "b" segment of the BCD to 7-segment display decoder and realize the circuit.

Answer

DEMUX vs decoder

A demultiplexer sends one data input to one of 2n2^n outputs chosen by nn select lines. A decoder converts an nn-bit input code into one active line out of 2n2^n lines. A decoder with an enable input works as a DEMUX if the enable is used as the data input.

PointDemultiplexerDecoder
Inputs1 data + n selectn code inputs (+ enable)
FunctionRoutes data to a chosen lineActivates the line for a code
Output contentCopy of the data bitFixed 1 (or 0) on one line
UseData distribution, serial-to-parallelAddress decoding, code conversion
Example1:8 DEMUX3-to-8 decoder (74138)

Seven-segment decoder

A BCD-to-seven-segment decoder (e.g. 7447/7448) takes a 4-bit BCD digit ABCDABCD and produces seven outputs aa to gg that light the segments of an LED display so that the decimal digit 0–9 is shown. Inputs 1010–1111 never occur, so they are don't-cares.

     a
    ---
 f | g | b
    ---
 e |   | c
    ---
     d

Simplest expression for segment "b"

Segment b is ON for digits 0, 1, 2, 3, 4, 7, 8, 9 and OFF for 5 and 6 (standard 7447 style).

b=Σm(0,1,2,3,4,7,8,9)+d(10,11,12,13,14,15)b = \Sigma m(0,1,2,3,4,7,8,9) + d(10,11,12,13,14,15)

K-map (rows AB, columns CD):

AB \ CD00011110
001111
011010
11XXXX
1011XX

Groups: rows 00 and 10 (all B=0B=0) give B′B'; column 00 gives C′D′C'D'; column 11 gives CDCD.

b=B′+C′D′+CD=B′+(C⊙D)b = B' + C'D' + CD = B' + (C \odot D)

Circuit

 B ---[NOT]----------------+
 C --+                     |
     +--[XNOR]--------- --[OR]--- b
 D --+

So segment b needs one inverter, one XNOR and one 2-input OR gate (or with AND/OR: C′D′C'D' and CDCD from two AND gates and a 3-input OR).

  • 2081 Bhadra · 1+3 marks

What is a multiplexer tree? Construct a 1:16 demultiplexer using only 1:4 demultiplexers and logic gates if necessary.

Answer

Multiplexer tree

A multiplexer tree is a larger multiplexer built by connecting smaller multiplexers in two or more levels. The lower select bits drive the first-level MUXes and the higher select bits drive the next level, which picks one first-level output. Example: a 16:1 MUX from five 4:1 MUXes. The same idea used with DEMUXes is called a demultiplexer tree.

1:16 DEMUX from 1:4 DEMUXes

A 1:16 DEMUX needs 4 select lines S3S2S1S0S_3 S_2 S_1 S_0. Use five 1:4 DEMUXes in two levels:

  • Level 1: one 1:4 DEMUX receives the data input DD; its selects are the MSBs S3S2S_3 S_2. It sends DD to one of four lines.
  • Level 2: four 1:4 DEMUXes, each fed from one level-1 output, all with selects S1S0S_1 S_0. They give the 16 outputs Y0Y_0–Y15Y_{15}.
                         S1 S0
                        +------+-- Y0
                     +->| DM1  |-- Y1..Y3
          S3 S2      |  +------+
        +------+     |  +------+-- Y4
  D --->| DM0 0|-----+->| DM2  |-- Y5..Y7
        |     1|--------+------+
        |     2|-----+  +------+-- Y8
        |     3|--+  +->| DM3  |-- Y9..Y11
        +------+  |     +------+
                  |     +------+-- Y12
                  +---->| DM4  |-- Y13..Y15
                        +------+

Working: if S3S2S1S0=1001S_3S_2S_1S_0 = 1001, DM0 (S3S2=10S_3S_2 = 10) sends DD to DM3; DM3 (S1S0=01S_1S_0 = 01) sends it to its second output, which is Y9Y_9. No extra gates are needed.

  • 2081 Baisakh · 2+3+3 marks

What is a priority encoder? Find out the simplest logic circuit for "e" and "f" segments of the BCD-to-seven segment display decoder.

Answer

Priority encoder

A priority encoder is an encoder that gives the binary code of the highest-priority active input when more than one input is active at the same time. It also has a valid output VV that shows at least one input is active. Example: in a 4:2 priority encoder with D3D_3 highest, if D1D_1 and D2D_2 are both 1, the output is 1010 (code of D2D_2). The 74148 is an 8:3 priority encoder used for interrupt handling and keyboard encoding.

Segment "e"

Segment e is ON for digits 0, 2, 6, 8 (inputs 10–15 are don't-cares).

e=Σm(0,2,6,8)+d(10–15)e = \Sigma m(0,2,6,8) + d(10\text{–}15)
AB \ CD00011110
001001
010001
11XXXX
1010XX

Groups: corners (0, 2, 8, 10) give B′D′B'D'; column 10 (2, 6, 10, 14) gives CD′CD'.

e=B′D′+CD′=D′(B′+C)e = B'D' + CD' = D'(B' + C)
 B --[NOT]--+
            +--[OR]--+
 C ---------+        +--[AND]--- e
 D --[NOT]-----------+

Segment "f"

Segment f is ON for digits 0, 4, 5, 6, 8, 9.

f=Σm(0,4,5,6,8,9)+d(10–15)f = \Sigma m(0,4,5,6,8,9) + d(10\text{–}15)
AB \ CD00011110
001000
011101
11XXXX
1011XX

Groups: rows 11 and 10 give AA; column 00 gives C′D′C'D'; cells 4, 5, 12, 13 give BC′BC'; cells 4, 6, 12, 14 give BD′BD'.

f=A+C′D′+BC′+BD′f = A + C'D' + BC' + BD'
 C' -+-[AND]-- C'D' --+
 D' -+                |
 B  -+-[AND]-- BC' ---+
 C' -+                +--[OR 4]--- f
 B  -+-[AND]-- BD' ---+
 D' -+                |
 A  ------------------+

Both circuits are checked against the digit table: e.g. for digit 6 (01100110): e=0+1⋅1=1e = 0 + 1\cdot1 = 1 and f=0+0+0+1=1f = 0 + 0 + 0 + 1 = 1, both segments lit as required.

  • 2080 Bhadra · 6 marks

Realize the following logic function using a single 1:8 demultiplexer and necessary logic gates. Y(A,B,C,D) = Σm(0,2,3,5,7,8,10,13,15)

Answer

A 1:8 DEMUX with data input tied to 1 produces the 8 minterms of its three select variables. The 4-variable function is realized by choosing three variables as selects and handling the fourth with a gate.

Choice of select lines

Use B,C,DB, C, D as selects (S2S1S0S_2 S_1 S_0) and the data input =1= 1. Then output YjY_j is 1 when BCD=jBCD = j. Each YjY_j covers two minterms of the function: jj (with A=0A=0) and j+8j+8 (with A=1A=1).

BCD = jMinterm j (A=0)Minterm j+8 (A=1)Contribution
00 ✓8 ✓Y0Y_0
11 ✗9 ✗–
22 ✓10 ✓Y2Y_2
33 ✓11 ✗A′Y3A' Y_3
44 ✗12 ✗–
55 ✓13 ✓Y5Y_5
66 ✗14 ✗–
77 ✓15 ✓Y7Y_7

Hence

Y=Y0+Y2+Y5+Y7+A′Y3Y = Y_0 + Y_2 + Y_5 + Y_7 + A'Y_3

Circuit

            +---------+
   1 ------>| D    Y0 |----------------> to OR
            |      Y1 |
  B --->S2  |      Y2 |----------------> to OR
  C --->S1  | 1:8  Y3 |--+
  D --->S0  |      Y4 |  +--[AND]------> to OR
            |      Y5 |-----^-|--------> to OR
            |      Y6 |       |
            |      Y7 |-------|--------> to OR
            +---------+       |
  A ---[NOT]--- A' -----------+

  Y0, Y2, Y5, Y7, A'Y3 ---[OR 5]---> Y

Gates: one NOT (for A′A'), one 2-input AND (A′Y3A'Y_3) and one 5-input OR.

Check: minterm 11 (A=1,BCD=011A=1, BCD=011): only Y3=1Y_3 = 1, but A′=0A' = 0, so Y=0Y = 0 (correct, 11 is not in the list). Minterm 3 (A=0A=0): A′Y3=1A'Y_3 = 1, so Y=1Y = 1. All nine minterms 0, 2, 3, 5, 7, 8, 10, 13, 15 give Y=1Y = 1.

(For reference, the minimal SOP is Y=B′D′+BD+A′B′CY = B'D' + BD + A'B'C, which matches the result above.)

  • 2080 Bhadra · 4+2 marks

Design the full-subtractor circuit using decoder and required logic gates. What is a combinational logic circuit?

Answer

Full subtractor using a decoder

A full subtractor computes A−B−BinA - B - B_{in} and gives the difference DD and borrow out BoutB_{out}.

ABBinB_{in}DBoutB_{out}Minterm
000000
001111
010112
011013
100104
101005
110006
111117
D=Σm(1,2,4,7),Bout=Σm(1,2,3,7)D = \Sigma m(1,2,4,7), \qquad B_{out} = \Sigma m(1,2,3,7)

A 3-to-8 decoder with inputs A,B,BinA, B, B_{in} (A = MSB) gives all 8 minterms at Y0Y_0–Y7Y_7. Each output function is the OR of its minterm lines:

D=Y1+Y2+Y4+Y7,Bout=Y1+Y2+Y3+Y7D = Y_1 + Y_2 + Y_4 + Y_7, \qquad B_{out} = Y_1 + Y_2 + Y_3 + Y_7
          +--------+
  A ----->| 2   Y0 |
  B ----->| 1   Y1 |---> D, Bout
  Bin --->| 0   Y2 |---> D, Bout
          | 3:8 Y3 |---> Bout
          |     Y4 |---> D
          |     Y5 |
          |     Y6 |
          |     Y7 |---> D, Bout
          +--------+
  Y1, Y2, Y4, Y7 ---[OR 4]---> D
  Y1, Y2, Y3, Y7 ---[OR 4]---> Bout

Two 4-input OR gates complete the design (with an active-low decoder like 74138, use 4-input NAND gates instead).

Combinational logic circuit

A combinational logic circuit is a circuit whose outputs at any instant depend only on the present values of its inputs. It has no memory and no feedback from output to input. It is built only from logic gates. Examples: adders, subtractors, multiplexers, decoders, encoders and comparators.

  • 2080 Baisakh · 4+3 marks

Draw the simplest logic circuit for "a" segment of the BCD-to-seven segment display decoder and realize the simplest logic expression using only NOR gates.

Answer

Segment a of a BCD-to-seven-segment decoder is ON for digits 0, 2, 3, 5, 6, 7, 8, 9 and OFF only for 1 and 4. Inputs 10–15 are don't-cares.

a=Σm(0,2,3,5,6,7,8,9)+d(10–15)a = \Sigma m(0,2,3,5,6,7,8,9) + d(10\text{–}15)

Simplest SOP and its circuit

AB \ CD00011110
001011
010111
11XXXX
1011XX

Groups: rows 11, 10 give AA; columns 11, 10 give CC; cells 5, 7, 13, 15 give BDBD; corners 0, 2, 8, 10 give B′D′B'D'.

a=A+C+BD+B′D′=A+C+(B⊙D)a = A + C + BD + B'D' = A + C + (B \odot D)
 B --+-[AND]--------+
 D --+              |
 B'--+-[AND]--------+--[OR 4]--- a
 D'--+              |
 A -----------------+
 C -----------------+

Realization using only NOR gates

NOR-NOR logic directly implements a product-of-sums. Take the 0s of the map (cells 1 and 4) with don't-cares:

  • Cell 1 (00010001): cannot combine with 9 (9 is a 1), so the maxterm is (A+B+C+D′)(A + B + C + D').
  • Cell 4 (01000100) combines with don't-care 12: (B′+C+D)(B' + C + D).
a=(A+B+C+D′)(B′+C+D)a = (A + B + C + D')(B' + C + D)

Using De Morgan's theorem:

a=(A+B+C+D′)‾+(B′+C+D)‾‾a = \overline{\overline{(A + B + C + D')} + \overline{(B' + C + D)}}

So: two first-level NORs form the complemented sums, a second-level NOR combines them, and the complemented inputs B′B' and D′D' are made with NOR gates used as inverters (both inputs tied together).

 B --[NOR]-- B'      D --[NOR]-- D'
 A  --+
 B  --+--[NOR 4]--N1--+
 C  --+               |
 D' --+               +--[NOR 2]--- a
 B' --+               |
 C  --+--[NOR 3]--N2--+
 D  --+

Total: 2 NOR inverters + one 4-input NOR + one 3-input NOR + one 2-input NOR = 5 NOR gates.

Check: digit 1 (00010001): N1=0+0+0+0‾=1N_1 = \overline{0+0+0+0} = 1, so a=0a = 0. Digit 4 (01000100): N2=1N_2 = 1, so a=0a = 0. Digit 9 (10011001): N1=0N_1 = 0, N2=0+0+1‾=0N_2 = \overline{0+0+1} = 0, so a=1a = 1. Correct.

  • 2079 Baisakh · 6 marks

Design the logic circuit for 4:2 Priority Encoder.

Answer

A 4:2 priority encoder has four inputs D0D_0–D3D_3 and gives the 2-bit code XYXY of the highest-priority active input. Here D3D_3 has the highest priority and D0D_0 the lowest. A valid bit VV shows that at least one input is 1 (otherwise XYXY is meaningless).

Truth table (X = don't care)

D3D_3D2D_2D1D_1D0D_0XYV
0000XX0
0001001
001X011
01XX101
1XXX111

K-maps (rows D3D2D_3D_2, columns D1D0D_1D_0)

For X:

D3D2D_3D_2 \ D1D0D_1D_000011110
00X000
011111
111111
101111
X=D2+D3X = D_2 + D_3

For Y:

D3D2D_3D_2 \ D1D0D_1D_000011110
00X011
010000
111111
101111
Y=D3+D1D2′Y = D_3 + D_1 D_2'

Valid output:

V=D0+D1+D2+D3V = D_0 + D_1 + D_2 + D_3

Logic circuit

 D3 ------+-----------------[OR]---- X
 D2 ---+--|-----------------^
       |  |
       +-[NOT]--+
 D1 ----------[AND]--+
                     +--[OR]------- Y
 D3 -----------------+

 D0,D1,D2,D3 -------[OR 4]--------- V

Check: D3D2D1D0=0110D_3D_2D_1D_0 = 0110: X=1X = 1, Y=0+1⋅0=0Y = 0 + 1\cdot 0 = 0, so output 1010 = input 2, the highest active one. D3=1D_3 = 1 gives XY=11XY = 11 whatever the others are. All cases were verified against the table.

  • 2079 Baisakh · 6 marks

Design 8:1 Multiplexer using 4:1 Multiplexer and 2:1 Multiplexer.

Answer

An 8:1 MUX has 8 data inputs I0I_0–I7I_7 and 3 select lines S2S1S0S_2S_1S_0. It can be built as a multiplexer tree from two 4:1 MUXes and one 2:1 MUX.

Design

  • Level 1: two 4:1 MUXes. MUX-1 takes I0I_0–I3I_3, MUX-2 takes I4I_4–I7I_7. Both use the lower select bits S1S0S_1 S_0.
  • Level 2: one 2:1 MUX picks MUX-1 output (when S2=0S_2 = 0) or MUX-2 output (when S2=1S_2 = 1).
           S1 S0
         +-------+
 I0 ---->|       |
 I1 ---->| 4:1   |--P--+
 I2 ---->| MUX-1 |     |    S2
 I3 ---->|       |     |  +-----+
         +-------+     +->|0    |
         +-------+        | 2:1 |---> Y
 I4 ---->|       |     +->|1    |
 I5 ---->| 4:1   |--Q--+  +-----+
 I6 ---->| MUX-2 |
 I7 ---->|       |
         +-------+
           S1 S0

Function table

S2S_2S1S_1S0S_0Y
000I0I_0
001I1I_1
010I2I_2
011I3I_3
100I4I_4
101I5I_5
110I6I_6
111I7I_7

Working

P=S1′S0′I0+S1′S0I1+S1S0′I2+S1S0I3P = S_1'S_0'I_0 + S_1'S_0 I_1 + S_1S_0'I_2 + S_1S_0I_3 Q=S1′S0′I4+S1′S0I5+S1S0′I6+S1S0I7Q = S_1'S_0'I_4 + S_1'S_0 I_5 + S_1S_0'I_6 + S_1S_0I_7 Y=S2′P+S2QY = S_2'P + S_2 Q

Substituting gives Y=∑k=07mkIkY = \sum_{k=0}^{7} m_k I_k, the 8:1 MUX equation, where mkm_k is the minterm of S2S1S0S_2S_1S_0.

Example: S2S1S0=110S_2S_1S_0 = 110. Both 4:1 MUXes select their input 2, so P=I2P = I_2 and Q=I6Q = I_6. The 2:1 MUX with S2=1S_2 = 1 passes QQ, so Y=I6Y = I_6. Correct.

  • 2079 Bhadra · 5 marks

Implement the following Boolean function using a single 8:1 multiplexer. F(A,B,C,D) = Σm(2,4,5,7,10,14).

Answer

Use A,B,CA, B, C as the select lines S2S1S0S_2S_1S_0 of the 8:1 MUX and feed each data input with 00, 11, DD or D′D'.

Implementation table

Each data input IjI_j corresponds to ABC=jABC = j and covers minterms 2j2j (D=0D=0) and 2j+12j+1 (D=1D=1). Required minterms: 2, 4, 5, 7, 10, 14.

IjI_jABCMinterms (D=0, D=1)In F?IjI_j
I0I_00000, 1no, no0
I1I_10012, 3yes, noD′D'
I2I_20104, 5yes, yes1
I3I_30116, 7no, yesDD
I4I_41008, 9no, no0
I5I_510110, 11yes, noD′D'
I6I_611012, 13no, no0
I7I_711114, 15yes, noD′D'

The same result in the usual two-row form:

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
D′D'02468101214
DD13579111315
Input0D′D'1DD0D′D'0D′D'

Circuit

             +--------+
  0 -------->| I0     |
  D --[NOT]->| I1     |
  1 -------->| I2     |
  D -------->| I3 8:1 |----> F
  0 -------->| I4 MUX |
  D' ------->| I5     |
  0 -------->| I6     |
  D' ------->| I7     |
             +--------+
               S2 S1 S0
               A  B  C

Only one inverter is needed besides the MUX.

Check: ABCD=1010ABCD = 1010 (minterm 10): select 101101 picks I5=D′=1I_5 = D' = 1, so F=1F = 1. ABCD=1011ABCD = 1011 (minterm 11): I5=D′=0I_5 = D' = 0, so F=0F = 0. Correct.

  • 2078 Kartik · 3+3 marks

Realize full adder circuit using decoder and gates. Subtract (43)₁₀ from (57)₁₀ using 2's complement method.

Answer

Full adder using a decoder and gates

A full adder adds AA, BB and carry-in CC:

ABCSCoC_o
00000
00110
01010
01101
10010
10101
11001
11111
S=Σm(1,2,4,7),Co=Σm(3,5,6,7)S = \Sigma m(1,2,4,7), \qquad C_o = \Sigma m(3,5,6,7)

A 3-to-8 decoder (inputs A,B,CA, B, C) produces every minterm; OR the required lines:

S=Y1+Y2+Y4+Y7,Co=Y3+Y5+Y6+Y7S = Y_1 + Y_2 + Y_4 + Y_7, \qquad C_o = Y_3 + Y_5 + Y_6 + Y_7
          +-------+
  A ----->| 2  Y0 |
  B ----->| 1  Y1 |---> to S
  C ----->| 0  Y2 |---> to S
          |    Y3 |---> to Co
          | 3:8 Y4|---> to S
          |    Y5 |---> to Co
          |    Y6 |---> to Co
          |    Y7 |---> to S and Co
          +-------+
  Y1,Y2,Y4,Y7 --[OR 4]--> S
  Y3,Y5,Y6,Y7 --[OR 4]--> Co

(57)₁₀ − (43)₁₀ by 2's complement

Use 7 bits (57 needs 6 bits; one extra bit for sign safety).

57=01110012,43=0101011257 = 0111001_2, \qquad 43 = 0101011_2

1's complement of 43: 10101001010100. Add 1: 2's complement =1010101= 1010101.

      0111001     (+57)
    + 1010101     (2's complement of 43)
    ---------
    1 0001110
    ^ end carry discarded

An end carry appears, so the result is positive and equals the remaining bits: 00011102=8+4+2=140001110_2 = 8 + 4 + 2 = 14.

Answer: (57)10−(43)10=(0001110)2=(14)10(57)_{10} - (43)_{10} = (0001110)_2 = (14)_{10}

  • 2078 Kartik · 6 marks

Realize a following logic expression using a 4:1 multiplexer and standard logic gates. Y(A,B,C) = ΠM(0,2,6,7)

Answer

First convert the maxterm list to minterms. A 3-variable function has minterms 0–7; the ones not listed as maxterms are the minterms:

Y=ΠM(0,2,6,7)=Σm(1,3,4,5)Y = \Pi M(0,2,6,7) = \Sigma m(1,3,4,5)

Implementation table

Use A,BA, B as select lines (S1=AS_1 = A, S0=BS_0 = B) and express each data input in terms of CC. Input IjI_j covers minterms 2j2j (C=0C = 0) and 2j+12j + 1 (C=1C = 1).

I0I_0I1I_1I2I_2I3I_3
C′C'0246
CC1357
InputCCCC10
  • I0I_0: only minterm 1 present, so I0=CI_0 = C.
  • I1I_1: only minterm 3, so I1=CI_1 = C.
  • I2I_2: both 4 and 5, so I2=1I_2 = 1.
  • I3I_3: neither 6 nor 7, so I3=0I_3 = 0.

Circuit

             +--------+
  C -------->| I0     |
  C -------->| I1 4:1 |----> Y
  1 (Vcc) -->| I2 MUX |
  0 (GND) -->| I3     |
             +--------+
                S1  S0
                A   B

No extra gate is needed here (no C′C' input appears).

Check

The MUX equation gives

Y=A′B′C+A′BC+AB′(1)+AB(0)=A′C+AB′Y = A'B'C + A'BC + AB'(1) + AB(0) = A'C + AB'
ABC000001010011100101110111
Y01011100

Y is 0 exactly at 0, 2, 6, 7, which matches ΠM(0,2,6,7)\Pi M(0,2,6,7).

  • 2078 Bhadra · 5 marks

Design a circuit that compares two 2-bit numbers, A and B, to check if they are equal. The circuit has one output x, so that x = 1 if A = B and x = 0 if A≠B.

Answer

Two 2-bit numbers A=A1A0A = A_1A_0 and B=B1B0B = B_1B_0 are equal only when each pair of corresponding bits is equal. Bit equality is given by the XNOR gate.

Truth table (16 rows; x = 1 only when A = B)

A1A0A_1A_0B1B0B_1B_0x
00001
01011
10101
11111
any other pair0

So

x=A1′A0′B1′B0′+A1′A0B1′B0+A1A0′B1B0′+A1A0B1B0x = A_1'A_0'B_1'B_0' + A_1'A_0B_1'B_0 + A_1A_0'B_1B_0' + A_1A_0B_1B_0

Simplification

Group the terms by the bit-1 pair and the bit-0 pair:

x=(A1′B1′+A1B1)(A0′B0′+A0B0)=(A1⊙B1)(A0⊙B0)=(A1⊕B1)‾⋅(A0⊕B0)‾\begin{aligned} x &= (A_1'B_1' + A_1B_1)(A_0'B_0' + A_0B_0) \\ &= (A_1 \odot B_1)(A_0 \odot B_0) \\ &= \overline{(A_1 \oplus B_1)}\cdot\overline{(A_0 \oplus B_0)} \end{aligned}

The K-map (rows A1A0A_1A_0, columns B1B0B_1B_0) has 1s only on the diagonal cells 0, 5, 10, 15, which cannot be grouped, confirming that the SOP form has four terms; the XNOR form is the simplest circuit.

Logic circuit

 A1 --+
      +--[XNOR]-- E1 --+
 B1 --+                |
                       +--[AND]--- x
 A0 --+                |
      +--[XNOR]-- E0 --+
 B0 --+

Alternative: x=(A1⊕B1)+(A0⊕B0)‾x = \overline{(A_1 \oplus B_1) + (A_0 \oplus B_0)}, i.e. two XOR gates followed by one NOR gate.

Check: A=10A = 10, B=10B = 10: E1=1E_1 = 1, E0=1E_0 = 1, so x=1x = 1. A=10A = 10, B=11B = 11: E0=0E_0 = 0, so x=0x = 0.

  • 2076 Chaitra · 2+4 marks

Describe the importance of parity bits in communication system. Explain 3 bits even parity generator circuit clearly.

Answer

Importance of parity bits

A parity bit is an extra bit added to a data word so that the total number of 1s is even (even parity) or odd (odd parity). Its importance in communication:

  • Error detection: noise can flip a bit during transmission. The receiver recounts the 1s; a wrong parity shows that an error occurred.
  • Simple and cheap: only one extra bit and a few XOR gates are needed at each end.
  • Detects all single-bit (odd-number) errors, which are the most common in many links. (It cannot detect two-bit errors and cannot correct errors.)
  • Used in serial links (UART), memory (parity RAM) and as the base of Hamming codes.

3-bit even parity generator

Inputs: data bits A,B,CA, B, C. Output: parity bit PP chosen so that A,B,C,PA, B, C, P together have an even number of 1s.

ABCP
0000
0011
0101
0110
1001
1010
1100
1111
P=Σm(1,2,4,7)P = \Sigma m(1,2,4,7)

The K-map is a checkerboard (no adjacent 1s), so it is simplified with XOR:

P=A′B′C+A′BC′+AB′C′+ABC=A′(B⊕C)+A(B⊙C)=A⊕B⊕C\begin{aligned} P &= A'B'C + A'BC' + AB'C' + ABC \\ &= A'(B \oplus C) + A(B \odot C) \\ &= A \oplus B \oplus C \end{aligned}
 A --+
     +--[XOR]--+
 B --+         +--[XOR]--- P
 C ------------+

Working: PP is 1 when the data has an odd number of 1s, which makes the total even. Example: data 101101 has two 1s, so P=1⊕0⊕1=0P = 1 \oplus 0 \oplus 1 = 0, and the transmitted word 10101010 has two 1s (even). At the receiver, a 4-bit checker PEC=A⊕B⊕C⊕PPEC = A \oplus B \oplus C \oplus P gives 0 for no error and 1 if a single bit has flipped.

  • 2076 Chaitra · 3+3 marks

Explain the operation of 8:1 multiplexer with necessary diagrams. Construct 32:1 MUX using only 8:1 MUXs.

Answer

Operation of an 8:1 multiplexer

An 8:1 multiplexer selects one of 8 data inputs I0I_0–I7I_7 and passes it to a single output YY. The input is chosen by three select lines S2S1S0S_2S_1S_0 (23=82^3 = 8).

Y=S2′S1′S0′I0+S2′S1′S0I1+S2′S1S0′I2+S2′S1S0I3+S2S1′S0′I4+S2S1′S0I5+S2S1S0′I6+S2S1S0I7Y = S_2'S_1'S_0'I_0 + S_2'S_1'S_0I_1 + S_2'S_1S_0'I_2 + S_2'S_1S_0I_3 + S_2S_1'S_0'I_4 + S_2S_1'S_0I_5 + S_2S_1S_0'I_6 + S_2S_1S_0I_7
S2S1S0S_2S_1S_0000001010011100101110111
YI0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7

Internally it has eight 4-input AND gates (each gets one data input and one combination of S2,S1,S0S_2, S_1, S_0 or their complements) and one 8-input OR gate. Only the AND gate whose select combination is true is enabled.

 I0..I7 ---->+---------+
             |  8:1    |
             |  MUX    |-----> Y
 S2 S1 S0 -->+---------+   (74151)

32:1 MUX using only 8:1 MUXes

A 32:1 MUX needs 5 select lines S4S_4–S0S_0.

  • Level 1: four 8:1 MUXes (M1–M4) take I0I_0–I7I_7, I8I_8–I15I_{15}, I16I_{16}–I23I_{23}, I24I_{24}–I31I_{31}. All use S2S1S0S_2S_1S_0.
  • Level 2: a fifth 8:1 MUX (M5) selects one of the four outputs. Its select lines are S4S_4, S3S_3 on its two lower selects and its MSB select tied to 0, so only inputs I0I_0–I3I_3 of M5 are used.
  I0-I7   -->[M1 8:1]--+      M5 (8:1)
  I8-I15  -->[M2 8:1]--+---> I0
  I16-I23 -->[M3 8:1]--+---> I1 ...  -->  Y
  I24-I31 -->[M4 8:1]--+---> I2, I3
              S2S1S0      sel: 0, S4, S3
                          I4-I7 = 0

Total: 5 MUXes of 8:1. Example: S4..S0=10110S_4..S_0 = 10110 gives M3 output I16+6=I22I_{16+6} = I_{22}, and M5 with S4S3=10S_4S_3 = 10 passes M3, so Y=I22Y = I_{22}.

  • 2076 Asoj · 1+5 marks

What is a decoder? Realize a 2-to-4 line decoder as a full adder circuit.

Answer

Decoder

A decoder is a combinational circuit that converts an nn-bit binary input code into 2n2^n output lines, of which exactly one is active for each input combination. Each output is one minterm of the inputs (e.g. 2-to-4, 3-to-8 (74138), BCD-to-decimal decoders).

Full adder using a 2-to-4 decoder

A 2-to-4 decoder has only two inputs, so feed it AA and BB. Its outputs are the minterms of A,BA, B:

D0=A′B′,D1=A′B,D2=AB′,D3=ABD_0 = A'B',\quad D_1 = A'B,\quad D_2 = AB',\quad D_3 = AB

Group the full-adder truth table by ABAB and write SS and CoutC_{out} in terms of CinC_{in}:

ABActive lineSCoutC_{out}
00D0D_0CinC_{in}0
01D1D_1Cin′C_{in}'CinC_{in}
10D2D_2Cin′C_{in}'CinC_{in}
11D3D_3CinC_{in}1

Let P=D1+D2P = D_1 + D_2 (=A⊕B= A \oplus B). Then

S=(D0+D3)Cin+(D1+D2)Cin′=P⊕CinCout=D3+(D1+D2)Cin=D3+P Cin\begin{aligned} S &= (D_0 + D_3)C_{in} + (D_1 + D_2)C_{in}' = P \oplus C_{in} \\ C_{out} &= D_3 + (D_1 + D_2)C_{in} = D_3 + P\,C_{in} \end{aligned}

Circuit

          +--------+
  A ----->| 2-to-4 |-- D0 (unused)
  B ----->| decoder|-- D1 --+
          |        |-- D2 --+--[OR]-- P
          |        |-- D3 -----------------+
          +--------+                       |
  P ---+--[XOR]------------------- S       |
  Cin -+                                   |
  P ---+--[AND]--------------------+       |
  Cin -+                           +-[OR]--+-- Cout

Gates: 2 OR, 1 XOR, 1 AND.

Check

A B CinC_{in}PSCoutC_{out}A+B+C (binary)
0 1 110110
1 1 000110
1 1 101111
1 0 011001

All eight combinations were verified.

Alternative: two 2-to-4 decoders with enable can be joined (using AA on the enables) into a 3-to-8 decoder; then S=Σm(1,2,4,7)S = \Sigma m(1,2,4,7) and Cout=Σm(3,5,6,7)C_{out} = \Sigma m(3,5,6,7) are taken with two 4-input OR gates.

  • 2076 Asoj · 3 marks

Realize the logic circuit of 1×16 DMUX using 1×4 DMUX and gates if necessary.

Answer

A 1×16 DMUX needs 4 select lines S3S2S1S0S_3S_2S_1S_0. It is built as a demultiplexer tree from five 1×4 DMUXes; no extra gates are needed.

  • Stage 1: one 1×4 DMUX receives the data DD and uses the MSBs S3S2S_3S_2 to send it to one of four second-stage DMUXes.
  • Stage 2: four 1×4 DMUXes use S1S0S_1S_0 and produce Y0Y_0–Y15Y_{15}.
                       S1 S0
                     +------+-- Y0..Y3
         S3 S2    +->| DM1  |
       +------+   |  +------+
  D -->| DM0 0|---+  +------+-- Y4..Y7
       |     1|----->| DM2  |
       |     2|---+  +------+
       |     3|-+ |  +------+-- Y8..Y11
       +------+ | +->| DM3  |
                |    +------+
                |    +------+-- Y12..Y15
                +--->| DM4  |
                     +------+
S3S2S_3S_2Active stage-2 DMUXOutputs reached by S1S0S_1S_0
00DM1Y0Y_0–Y3Y_3
01DM2Y4Y_4–Y7Y_7
10DM3Y8Y_8–Y11Y_{11}
11DM4Y12Y_{12}–Y15Y_{15}

Example: S=1110S = 1110 → DM0 picks DM4, DM4 picks its output 2, so DD appears at Y14Y_{14}.

  • 2075 Chaitra · 7 marks

Design the operation of octal priority encoder with neat diagram.

Answer

An octal (8-to-3) priority encoder has eight inputs D0D_0–D7D_7 and three outputs Y2Y1Y0Y_2Y_1Y_0 giving the binary code of the highest-numbered active input (D7D_7 = highest priority). A valid output VV is 1 when any input is active. The 74148 is a common IC (active-low).

Truth table (X = don't care)

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0Y2Y_2Y1Y_1Y0Y_0V
00000000XXX0
000000010001
0000001X0011
000001XX0101
00001XXX0111
0001XXXX1001
001XXXXX1011
01XXXXXX1101
1XXXXXXX1111

Output equations

Write each output as the OR of the rows where it is 1; each row requires all higher inputs to be 0, and redundant conditions are dropped.

  • Y2=1Y_2 = 1 for highest input 4, 5, 6 or 7:
Y2=D4+D5+D6+D7Y_2 = D_4 + D_5 + D_6 + D_7
  • Y1=1Y_1 = 1 for highest input 2, 3, 6 or 7. Inputs 2 and 3 count only if D4=D5=0D_4 = D_5 = 0 (if D6D_6 or D7D_7 is 1, Y1Y_1 is 1 anyway):
Y1=D7+D6+D5′D4′D3+D5′D4′D2Y_1 = D_7 + D_6 + D_5'D_4'D_3 + D_5'D_4'D_2
  • Y0=1Y_0 = 1 for highest input 1, 3, 5 or 7:
Y0=D7+D6′D5+D6′D4′D3+D6′D4′D2′D1Y_0 = D_7 + D_6'D_5 + D_6'D_4'D_3 + D_6'D_4'D_2'D_1
  • Valid bit:
V=D0+D1+⋯+D7V = D_0 + D_1 + \dots + D_7

Logic diagram

 D4,D5,D6,D7 ----------------------[OR 4]--- Y2

 D7 ---------------------------+
 D6 ---------------------------+
 D5',D4',D3 ---[AND 3]---------+--[OR 4]--- Y1
 D5',D4',D2 ---[AND 3]---------+

 D7 ---------------------------+
 D6',D5 -------[AND 2]---------+
 D6',D4',D3 ---[AND 3]---------+--[OR 4]--- Y0
 D6',D4',D2',D1 [AND 4]--------+

 D0 ... D7 ------------------------[OR 8]--- V

Inverters provide D2′,D4′,D5′,D6′D_2', D_4', D_5', D_6'.

Operation

When several keys or interrupt lines are active together, only the highest one is encoded. Example: D6=D3=D1=1D_6 = D_3 = D_1 = 1, others 0. Then Y2=1Y_2 = 1, Y1=1Y_1 = 1 (from D6D_6), Y0=0Y_0 = 0 (since D6′=0D_6' = 0 blocks all Y0Y_0 terms and D7=0D_7 = 0). Output 110=6110 = 6 and V=1V = 1. All 255 non-zero input patterns were checked against these equations.

  • 2075 Asoj · 3+3 marks

Explain the operation of octal to binary encoder with necessary diagrams. Convert A+B'C in to canonical form.

Answer

Octal-to-binary encoder

An octal-to-binary (8-to-3) encoder has eight inputs D0D_0–D7D_7, one for each octal digit, and three outputs Y2Y1Y0Y_2Y_1Y_0 giving the 3-bit binary code of the active input. Only one input is assumed to be active at a time.

Active inputY2Y_2Y1Y_1Y0Y_0
D0D_0000
D1D_1001
D2D_2010
D3D_3011
D4D_4100
D5D_5101
D6D_6110
D7D_7111

Each output is 1 for the inputs whose code has a 1 in that position:

Y2=D4+D5+D6+D7,Y1=D2+D3+D6+D7,Y0=D1+D3+D5+D7Y_2 = D_4 + D_5 + D_6 + D_7,\quad Y_1 = D_2 + D_3 + D_6 + D_7,\quad Y_0 = D_1 + D_3 + D_5 + D_7
 D4 D5 D6 D7 --[OR 4]--> Y2
 D2 D3 D6 D7 --[OR 4]--> Y1
 D1 D3 D5 D7 --[OR 4]--> Y0
 (D0 is not connected: it gives 000)

Limitations: D0D_0 active and "no input active" both give 000, and two active inputs give a wrong code (e.g. D3+D5D_3 + D_5 → 111). A priority encoder solves these.

Canonical form of A+B′CA + B'C

Expand each term with the missing variables using X+X′=1X + X' = 1:

A=A(B+B′)(C+C′)=ABC+ABC′+AB′C+AB′C′B′C=B′C(A+A′)=AB′C+A′B′C\begin{aligned} A &= A(B + B')(C + C') = ABC + ABC' + AB'C + AB'C' \\ B'C &= B'C(A + A') = AB'C + A'B'C \end{aligned}

Combine and remove the repeated term AB′CAB'C:

A+B′C=A′B′C+AB′C′+AB′C+ABC′+ABCA + B'C = A'B'C + AB'C' + AB'C + ABC' + ABC =Σm(1,4,5,6,7)= \Sigma m(1, 4, 5, 6, 7)

The canonical POS form uses the remaining combinations:

A+B′C=ΠM(0,2,3)=(A+B+C)(A+B′+C)(A+B′+C′)A + B'C = \Pi M(0, 2, 3) = (A + B + C)(A + B' + C)(A + B' + C')
  • 2075 Asoj · 3+3 marks

Describe the importance of parity bits in communication system. Explain 3 bits odd parity generator circuit clearly.

Answer

Importance of parity bits

A parity bit is one extra bit attached to a data word so that the total count of 1s is either even (even parity) or odd (odd parity). In communication systems it matters because:

  • Error detection: noise or interference may flip a bit. The receiver checks the parity; a mismatch shows an error, and the data can be re-requested.
  • Low cost: only one extra bit per word and a few XOR gates.
  • Single-bit errors are always detected (in fact any odd number of errors).
  • Limits: an even number of bit errors goes unnoticed, and the faulty bit cannot be located or corrected. Codes like Hamming code extend the parity idea to correct errors.
  • Odd parity is often preferred because an all-zero word (e.g. a dead line) still carries a 1, so a stuck-at-0 line is detected.

3-bit odd parity generator

Inputs A,B,CA, B, C; output PP is chosen so that A,B,C,PA, B, C, P together contain an odd number of 1s.

ABCP
0001
0010
0100
0111
1000
1011
1101
1110
P=Σm(0,3,5,6)=A′B′C′+A′BC+AB′C+ABC′P = \Sigma m(0,3,5,6) = A'B'C' + A'BC + AB'C + ABC'

The K-map has no adjacent 1s, so it is simplified with XOR/XNOR:

P=A′(B⊙C)+A(B⊕C)=A⊕B⊕C‾\begin{aligned} P &= A'(B \odot C) + A(B \oplus C) \\ &= \overline{A \oplus B \oplus C} \end{aligned}
 A --+
     +--[XOR]--+
 B --+         +--[XNOR]--- P
 C ------------+

Working: if the data already has an odd number of 1s, P=0P = 0; if even, P=1P = 1. Example: data 110110 (two 1s) gives P=1⊕1⊕0‾=1P = \overline{1 \oplus 1 \oplus 0} = 1, so the word 11011101 has three 1s (odd). The receiver's odd parity checker computes A⊕B⊕C⊕P‾\overline{A \oplus B \oplus C \oplus P}, which is 0 when no error is present.

  • 2075 Asoj · 3+3 marks

Realize the circuit diagram for BCD decoder. Explain 1's and 2's complements with examples?

Answer

BCD decoder (BCD-to-decimal, 4-to-10)

A BCD decoder takes a 4-bit BCD code ABCDABCD (AA = MSB) and activates one of ten outputs D0D_0–D9D_9 (IC 7442). Codes 1010–1111 never occur, so they are don't-cares and allow partial decoding.

DigitABCDFull decodingSimplified (with don't-cares)
00000A′B′C′D′A'B'C'D'A′B′C′D′A'B'C'D'
10001A′B′C′DA'B'C'DA′B′C′DA'B'C'D
20010A′B′CD′A'B'CD'B′CD′B'CD'
30011A′B′CDA'B'CDB′CDB'CD
40100A′BC′D′A'BC'D'BC′D′BC'D'
50101A′BC′DA'BC'DBC′DBC'D
60110A′BCD′A'BCD'BCD′BCD'
70111A′BCDA'BCDBCDBCD
81000AB′C′D′AB'C'D'AD′AD'
91001AB′C′DAB'C'DADAD
 A B C D   A' B' C' D'  (inverters)
 |  |  |  |
 +--+--+--+--[AND]--- D0 = A'B'C'D'
 +--+--+--+--[AND]--- D1 = A'B'C'D
      ...  (one AND gate per output)
 +--------+--[AND]--- D8 = AD'
 +--------+--[AND]--- D9 = AD

Ten AND gates and four inverters form the decoder.

1's and 2's complements

1's complement: invert every bit (0 → 1, 1 → 0). Example: 1's complement of 1011010110 is 0100101001.

2's complement: 1's complement + 1. Example: 2's complement of 1011010110 is 01001+1=0101001001 + 1 = 01010.

They represent negative numbers and turn subtraction into addition. Example 9−59 - 5 in 4 bits:

 1's complement method        2's complement method
   1001  (9)                    1001  (9)
 + 1010  (1's comp of 0101)   + 1011  (2's comp of 0101)
 ------                       ------
 1 0011                       1 0100
     +1  end-around carry      carry discarded
 ------                       
   0100  = 4                    0100  = 4

In 1's complement the end carry is added back; in 2's complement it is discarded. 2's complement has a single zero and is used in computers.

  • 2075 Asoj · 2+4 marks

What is the role of hazards in asynchronous circuit design? Explain two bit magnitude comparator with necessary diagrams.

Answer

Role of hazards in asynchronous circuit design

A hazard is an unwanted momentary pulse (glitch) at a circuit output caused by unequal propagation delays along different paths when an input changes. Types: static-1 (output should stay 1 but dips to 0), static-0, and dynamic hazards; essential hazards come from feedback delays.

In asynchronous circuits there is no clock to wait until signals settle, and outputs are fed back as state variables. A glitch can therefore be taken as a real change and drive the circuit into a wrong stable state, causing malfunction. So hazards must be removed, e.g. by adding redundant (consensus) terms in the K-map so that every pair of adjacent 1s is covered by a common group, and by careful delay control.

Two-bit magnitude comparator

It compares A=A1A0A = A_1A_0 and B=B1B0B = B_1B_0 and gives three outputs: GG (A>BA > B), EE (A=BA = B) and LL (A<BA < B).

Let x1=A1⊙B1x_1 = A_1 \odot B_1 and x0=A0⊙B0x_0 = A_0 \odot B_0 (bit-equal signals). Compare the MSBs first; only if they are equal, compare the LSBs:

E=x1x0G=A1B1′+x1A0B0′L=A1′B1+x1A0′B0\begin{aligned} E &= x_1 x_0 \\ G &= A_1B_1' + x_1A_0B_0' \\ L &= A_1'B_1 + x_1A_0'B_0 \end{aligned}

From K-maps the same functions in plain SOP are:

G=A1B1′+A0B1′B0′+A1A0B0′,L=A1′B1+A0′B1B0+A1′A0′B0G = A_1B_1' + A_0B_1'B_0' + A_1A_0B_0', \quad L = A_1'B_1 + A_0'B_1B_0 + A_1'A_0'B_0

Partial truth table:

A1A0A_1A_0B1B0B_1B_0GEL
1001100
0101010
0111001
1110100
 A1,B1 --[XNOR]-- x1      A0,B0 --[XNOR]-- x0
 x1, x0 ------------------[AND]------------ E
 A1,B1' ---[AND]---+
 x1,A0,B0' [AND]---+------[OR]------------- G
 A1',B1 ---[AND]---+
 x1,A0',B0 [AND]---+------[OR]------------- L

Example: A=11A = 11, B=10B = 10: x1=1x_1 = 1, A0B0′=1A_0B_0' = 1, so G=1G = 1. All 16 input combinations were verified.

  • 2074 Chaitra · 4+2 marks

Design the 32:1 Multiplexer using 4:1 multiplexers tree concept and implement the function F = Σ(0,1,3,8,9,13) using suitable Multiplexer.

Answer

32:1 MUX using a 4:1 multiplexer tree

A 32:1 MUX has 32 data inputs and 5 select lines S4S3S2S1S0S_4S_3S_2S_1S_0 (25=322^5 = 32). With 4:1 MUXes (2 selects each) the tree has three levels:

Level4:1 MUXesSelect linesFunction
18 (M1–M8)S1S0S_1S_0Each picks 1 of 4 inputs
22 (M9, M10)S3S2S_3S_2Each picks 1 of 4 level-1 outputs
31 (M11)S4S_4 (on its S0S_0; its S1=0S_1 = 0)Picks M9 or M10
 I0-I3   ->[M1 ]--+
 I4-I7   ->[M2 ]--+->[M9 ]--+
 I8-I11  ->[M3 ]--+  S3S2   |
 I12-I15 ->[M4 ]--+         |    S4 on S0,
                            +--->[M11]---> Y
 I16-I19 ->[M5 ]--+         |    S1 = 0
 I20-I23 ->[M6 ]--+->[M10]--+
 I24-I27 ->[M7 ]--+  S3S2
 I28-I31 ->[M8 ]--+
   (M1-M8 use S1S0)

Total: 11 MUXes of 4:1 (the last one uses only two inputs; a 2:1 MUX could replace it). Example: S4..S0=10110S_4..S_0 = 10110 → M6 passes I22I_{22}, M10 (S3S2=01S_3S_2 = 01) passes M6, M11 (S4=1S_4 = 1) passes M10, so Y=I22Y = I_{22}.

Implementing F=Σm(0,1,3,8,9,13)F = \Sigma m(0,1,3,8,9,13)

The largest minterm is 13, so F is a 4-variable function F(A,B,C,D)F(A,B,C,D). A suitable MUX is an 8:1 MUX with A,B,CA, B, C as selects and DD on the data side.

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
D′D'02468101214
DD13579111315
Input1DD0010DD0
            +--------+
  1 ------->| I0     |
  D ------->| I1     |
  0 ------->| I2,I3  |
  1 ------->| I4 8:1 |----> F
  0 ------->| I5     |
  D ------->| I6     |
  0 ------->| I7     |
            +--------+
             A  B  C (S2 S1 S0)

Check: ABCD=1101ABCD = 1101 (13): select 110 → I6=D=1I_6 = D = 1, so F=1F = 1. ABCD=1100ABCD = 1100 (12): I6=0I_6 = 0, so F=0F = 0.

  • 2074 Asoj · 1+4 marks

What is a multiplexer tree? Design the 16 to 1 multiplexer using 4 to 1 multiplexer.

Answer

Multiplexer tree

A multiplexer tree is the connection of small multiplexers in levels to make a larger multiplexer. The first level selects within groups using the lower select bits, and the next level selects one group using the higher select bits.

16:1 MUX from 4:1 MUXes

A 16:1 MUX has inputs I0I_0–I15I_{15} and four select lines S3S2S1S0S_3S_2S_1S_0. Use five 4:1 MUXes:

  • Level 1: four 4:1 MUXes (M1–M4) with selects S1S0S_1S_0. M1 gets I0I_0–I3I_3, M2 gets I4I_4–I7I_7, M3 gets I8I_8–I11I_{11}, M4 gets I12I_{12}–I15I_{15}.
  • Level 2: one 4:1 MUX (M5) with selects S3S2S_3S_2 picks one of the outputs of M1–M4.
             S1 S0
 I0-I3   -->[ M1 ]--Y1--+
 I4-I7   -->[ M2 ]--Y2--+--> I0..I3 of
 I8-I11  -->[ M3 ]--Y3--+    [ M5 ] ----> Y
 I12-I15 -->[ M4 ]--Y4--+     S3 S2
S3S2S_3S_2M5 passesY for S1S0S_1S_0 = 00, 01, 10, 11
00Y1Y_1I0,I1,I2,I3I_0, I_1, I_2, I_3
01Y2Y_2I4,I5,I6,I7I_4, I_5, I_6, I_7
10Y3Y_3I8,I9,I10,I11I_8, I_9, I_{10}, I_{11}
11Y4Y_4I12,I13,I14,I15I_{12}, I_{13}, I_{14}, I_{15}

Example: S3S2S1S0=1011S_3S_2S_1S_0 = 1011. Every level-1 MUX selects its input 3, so M3 outputs I11I_{11}. M5 with S3S2=10S_3S_2 = 10 selects M3, so Y=I11Y = I_{11}, which is input number 10112=111011_2 = 11. Correct.

  • 2074 Asoj · 3 marks

Write a short note on ROM.

Answer

ROM (Read-Only Memory) is a non-volatile semiconductor memory whose contents are written once (at manufacture or by programming) and then mainly read. It keeps data when power is removed, so it stores fixed programs such as BIOS/boot code, look-up tables and microcode.

Structure: a 2n×m2^n \times m ROM has nn address lines and mm data outputs. An nn-to-2n2^n decoder selects one word (row); a programmable OR array (links at row–column crossings) gives the mm output bits. So a ROM can implement any set of mm Boolean functions of nn variables in sum-of-minterms form.

 A(n-1)..A0 -->[ n:2^n decoder ]--> 2^n word lines
                     |
               [ OR array (links) ]
                     |
               D(m-1) ... D0  (outputs)

Types:

TypeHow programmed / erased
Mask ROMFixed by the maker using a photo-mask
PROMFuses blown once by the user
EPROMElectrically written, erased by UV light
EEPROMElectrically written and erased, byte-wise
FlashElectrically erased in blocks

Example: a 32×832 \times 8 ROM has 5 address lines and 8 outputs, storing 256 bits.

  • 2074 Asoj · 3 marks

Write a short note on DE-MUX tree.

Answer

A DEMUX tree is a large demultiplexer formed by connecting smaller demultiplexers in two or more levels. It is used when a DEMUX of the required size is not available as one IC.

Principle: the first-level DEMUX receives the data input and is driven by the higher-order select bits; each of its outputs feeds a second-level DEMUX driven by the lower-order select bits. Number of outputs = product of the outputs of each level.

Example: 1:16 DEMUX from five 1:4 DEMUXes

                      S1 S0
         S3 S2     +-->[1:4]-- Y0..Y3
       +-------+   |
  D -->|  1:4  |---+-->[1:4]-- Y4..Y7
       | DEMUX |---+
       +-------+   +-->[1:4]-- Y8..Y11
                   |
                   +-->[1:4]-- Y12..Y15

If S3S2S1S0=0110S_3S_2S_1S_0 = 0110, the first DEMUX sends D to the second DEMUX (group 01), which sends it to its output 2, i.e. Y6Y_6.

Features:

  • No extra gates are needed; only select lines are shared.
  • Other sizes: 1:32 from 1:8 and 1:4 (or 1:2), 1:8 from 1:2 DEMUXes, etc.
  • Delay increases with the number of levels.
  • 2073 Shrawan · 5 marks

Implement a full adder circuit using 4:1 Multiplexers.

Answer

A full adder has inputs AA, BB, CinC_{in} and outputs Sum SS and Carry CoutC_{out}. Two 4:1 MUXes are used, one for each output, with AA and BB on the select lines (S1=AS_1 = A, S0=BS_0 = B) and CinC_{in} on the data side.

Truth table

ABCinC_{in}SCoutC_{out}
00000
00110
01010
01101
10010
10101
11001
11111
S=Σm(1,2,4,7),Cout=Σm(3,5,6,7)S = \Sigma m(1,2,4,7), \qquad C_{out} = \Sigma m(3,5,6,7)

Implementation tables

For data input IjI_j (AB=jAB = j), the two rows are Cin=0C_{in} = 0 (minterm 2j2j) and Cin=1C_{in} = 1 (minterm 2j+12j+1).

Sum:

I0I_0I1I_1I2I_2I3I_3
Cin′C_{in}'0246
CinC_{in}1357
InputCinC_{in}Cin′C_{in}'Cin′C_{in}'CinC_{in}

Carry:

I0I_0I1I_1I2I_2I3I_3
Cin′C_{in}'0246
CinC_{in}1357
Input0CinC_{in}CinC_{in}1

Circuit

               +-------+                  +-------+
  Cin -------->| I0    |      0 --------->| I0    |
  Cin --[NOT]->| I1 4:1|-> S  Cin ------->| I1 4:1|-> Cout
  Cin'-------->| I2    |      Cin ------->| I2    |
  Cin -------->| I3    |      1 --------->| I3    |
               +-------+                  +-------+
                 A  B                       A  B

Check

From the MUX equation:

Cout=A′B(Cin)+AB′(Cin)+AB(1)=(A⊕B)Cin+ABC_{out} = A'B(C_{in}) + AB'(C_{in}) + AB(1) = (A \oplus B)C_{in} + AB

which is the standard carry expression. For A=1,B=0,Cin=1A = 1, B = 0, C_{in} = 1: select 1010 gives S=I2=Cin′=0S = I_2 = C_{in}' = 0 and Cout=I2=Cin=1C_{out} = I_2 = C_{in} = 1, i.e. 1+0+1=1021 + 0 + 1 = 10_2. All eight rows were verified.

  • 2073 Shrawan · 6 marks

Design 1:32 demultiplexer tree using 1:8 DEMUXs and 1:2 DEMUXs only.

Answer

A 1:32 DEMUX has one data input DD, five select lines S4S3S2S1S0S_4S_3S_2S_1S_0 and 32 outputs Y0Y_0–Y31Y_{31}. Since 32=2×2×832 = 2 \times 2 \times 8, it can be built with three 1:2 DEMUXes and four 1:8 DEMUXes in three levels.

Design

LevelDEMUXesSelectOutputs
1one 1:2 (DM-A)S4S_42 lines
2two 1:2 (DM-B, DM-C)S3S_34 lines
3four 1:8 (DM1–DM4)S2S1S0S_2S_1S_032 outputs
                         S2S1S0
                 S3   +->[1:8 DM1]-- Y0..Y7
         S4    +[1:2]-+
       +[1:2]--+ DM-B +->[1:8 DM2]-- Y8..Y15
  D -->| DM-A  |
       +-------+ S3   +->[1:8 DM3]-- Y16..Y23
               +[1:2]-+
                 DM-C +->[1:8 DM4]-- Y24..Y31
  • DM-A output 0 (when S4=0S_4 = 0) feeds DM-B; output 1 feeds DM-C.
  • DM-B sends data to DM1 (S3=0S_3 = 0) or DM2 (S3=1S_3 = 1); DM-C to DM3 or DM4.
  • Each 1:8 DEMUX decodes S2S1S0S_2S_1S_0 to one of its eight outputs.
S4S3S_4S_3Active 1:8 DEMUXOutput range
00DM1Y0Y_0–Y7Y_7
01DM2Y8Y_8–Y15Y_{15}
10DM3Y16Y_{16}–Y23Y_{23}
11DM4Y24Y_{24}–Y31Y_{31}

Example

S4S3S2S1S0=11010S_4S_3S_2S_1S_0 = 11010 (=26= 26): DM-A (S4=1S_4 = 1) → DM-C; DM-C (S3=1S_3 = 1) → DM4; DM4 (S2S1S0=010S_2S_1S_0 = 010) → its output 2, which is Y24+2=Y26Y_{24+2} = Y_{26}. So DD appears at Y26Y_{26} and all other outputs stay 0.

Total: 3 DEMUXes of 1:2 + 4 DEMUXes of 1:8 = 7 ICs, no extra gates.

  • 2073 Shrawan · 2+6 marks

Differentiate between combinational and sequential circuits. Explain BCD-to-Decimal decoder circuit with suitable diagram.

Answer

Combinational vs sequential circuits

PointCombinationalSequential
Output depends onPresent inputs onlyPresent inputs and past state
MemoryNoneHas memory (flip-flops)
FeedbackNoYes
ClockNot neededUsually needed (synchronous)
Building blocksGatesGates + flip-flops
ExamplesAdder, MUX, decoderCounter, register, FSM

BCD-to-decimal decoder

A BCD-to-decimal (4-line to 10-line) decoder accepts a 4-bit BCD code ABCDABCD (AA = MSB) and makes exactly one of ten outputs D0D_0–D9D_9 active, showing the decimal digit. The 7442 is the TTL IC (active-low outputs).

Truth table

ABCDActive outputABCDActive output
0000D0D_00101D5D_5
0001D1D_10110D6D_6
0010D2D_20111D7D_7
0011D3D_31000D8D_8
0100D4D_41001D9D_9

Codes 1010–1111 are invalid in BCD, so they are don't-cares.

Output expressions. With full decoding each output is a 4-variable minterm, e.g. D5=A′BC′DD_5 = A'BC'D. Using the don't-cares (K-map grouping), shorter expressions are obtained:

OutputFull decodingSimplified
D0D_0A′B′C′D′A'B'C'D'A′B′C′D′A'B'C'D'
D1D_1A′B′C′DA'B'C'DA′B′C′DA'B'C'D
D2D_2A′B′CD′A'B'CD'B′CD′B'CD'
D3D_3A′B′CDA'B'CDB′CDB'CD
D4D_4A′BC′D′A'BC'D'BC′D′BC'D'
D5D_5A′BC′DA'BC'DBC′DBC'D
D6D_6A′BCD′A'BCD'BCD′BCD'
D7D_7A′BCDA'BCDBCDBCD
D8D_8AB′C′D′AB'C'D'AD′AD'
D9D_9AB′C′DAB'C'DADAD

For example, D8D_8: 1000 can be grouped with don't-cares 1010, 1100, 1110, giving AD′AD'.

Logic diagram

 A  B  C  D
 |  |  |  |---[NOT]-- D'
 |  |  |------[NOT]-- C'
 |  |---------[NOT]-- B'
 |------------[NOT]-- A'

 A',B',C',D' --[AND4]--> D0
 A',B',C',D  --[AND4]--> D1
 B',C,D'     --[AND3]--> D2
 B',C,D      --[AND3]--> D3
 B,C',D'     --[AND3]--> D4
 B,C',D      --[AND3]--> D5
 B,C,D'      --[AND3]--> D6
 B,C,D       --[AND3]--> D7
 A,D'        --[AND2]--> D8
 A,D         --[AND2]--> D9

Working: for input 01110111, only the gate BCDBCD has all inputs 1, so D7=1D_7 = 1 and the others are 0. The simplified version gives false outputs for invalid codes (e.g. 1111 activates D7D_7 and D9D_9); if invalid codes must be rejected, full decoding is used, as in the 7442 which keeps all outputs inactive for 1010–1111. Uses: driving decimal indicators (Nixie tubes, LEDs) and selecting one of ten devices.

  • 2072 Chaitra · 4+3 marks

How do you design 32:1 Mux by using multiplexer tree? Implement logic function Y = Σm(0,1,3,8,9,13,15) by using suitable multiplexer.

Answer

32:1 MUX by multiplexer tree

A 32:1 MUX needs 5 select lines S4S_4–S0S_0. A common tree uses four 8:1 MUXes and one 4:1 MUX:

  • Level 1: four 8:1 MUXes with selects S2S1S0S_2S_1S_0: M1 takes I0I_0–I7I_7, M2 I8I_8–I15I_{15}, M3 I16I_{16}–I23I_{23}, M4 I24I_{24}–I31I_{31}.
  • Level 2: one 4:1 MUX (M5) with selects S4S3S_4S_3 selects one of M1–M4.
           S2 S1 S0
 I0-I7   -->[M1 8:1]--+
 I8-I15  -->[M2 8:1]--+-->[M5 4:1]---> Y
 I16-I23 -->[M3 8:1]--+     S4 S3
 I24-I31 -->[M4 8:1]--+
S4S3S_4S_3Selected MUXInputs reached
00M1I0I_0–I7I_7
01M2I8I_8–I15I_{15}
10M3I16I_{16}–I23I_{23}
11M4I24I_{24}–I31I_{31}

Example: S=10101S = 10101 → M3 picks its input 5 (I21I_{21}) and M5 (S4S3=10S_4S_3 = 10) passes it, so Y=I21Y = I_{21}. (With only 4:1 MUXes the tree would need 8 + 2 + 1 = 11 MUXes.)

Implementing Y=Σm(0,1,3,8,9,13,15)Y = \Sigma m(0,1,3,8,9,13,15)

The largest minterm is 15, so Y=Y(A,B,C,D)Y = Y(A,B,C,D). A suitable MUX is an 8:1 MUX with A,B,CA, B, C on the selects and DD on the data inputs.

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
D′D'02468101214
DD13579111315
Input1DD0010DDDD
            +--------+
  1 ------->| I0     |
  D ------->| I1     |
  0 ------->| I2     |
  0 ------->| I3 8:1 |----> Y
  1 ------->| I4 MUX |
  0 ------->| I5     |
  D ------->| I6     |
  D ------->| I7     |
            +--------+
             A  B  C

Check: ABCD=1111ABCD = 1111 (15): select 111 → I7=D=1I_7 = D = 1, Y=1Y = 1. ABCD=0010ABCD = 0010 (2): select 001 → I1=D=0I_1 = D = 0, Y=0Y = 0. All 16 rows match.

  • 2070 Chaitra · 4 marks

Realize the logic circuit of the following using 8:1 MUX. F(W,X,Y,Z) = Σm(1,2,5,7,8,10,12,13,15)

Answer

Use W,X,YW, X, Y as the select lines S2S1S0S_2S_1S_0 of the 8:1 MUX and connect ZZ, Z′Z', 0 or 1 to the data inputs. Input IjI_j covers minterms 2j2j (Z=0Z = 0) and 2j+12j+1 (Z=1Z = 1).

Required minterms: 1, 2, 5, 7, 8, 10, 12, 13, 15.

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
Z′Z'02468101214
ZZ13579111315
InputZZZ′Z'ZZZZZ′Z'Z′Z'1ZZ
             +--------+
  Z -------->| I0     |
  Z' ------->| I1     |
  Z -------->| I2     |
  Z -------->| I3 8:1 |----> F
  Z' ------->| I4 MUX |
  Z' ------->| I5     |
  1 -------->| I6     |
  Z -------->| I7     |
             +--------+
              W  X  Y
  (Z' from one NOT gate)

Check: WXYZ=1100WXYZ = 1100 (12): select 110 → I6=1I_6 = 1, so F=1F = 1. WXYZ=1001WXYZ = 1001 (9): select 100 → I4=Z′=0I_4 = Z' = 0, so F=0F = 0 (9 is not a minterm). Correct.

  • 2068 Chaitra · 5 marks

Design a 32 to 1 multiplexer using 16 to 1 and 2 to 1 multiplexers.

Answer

A 32:1 MUX has inputs I0I_0–I31I_{31} and five select lines S4S3S2S1S0S_4S_3S_2S_1S_0. It is built from two 16:1 MUXes and one 2:1 MUX (a multiplexer tree).

Design

  • Level 1: MUX-1 (16:1) takes I0I_0–I15I_{15}; MUX-2 (16:1) takes I16I_{16}–I31I_{31}. Both share the lower selects S3S2S1S0S_3S_2S_1S_0.
  • Level 2: a 2:1 MUX with select S4S_4 passes MUX-1 output when S4=0S_4 = 0 and MUX-2 output when S4=1S_4 = 1.
             S3 S2 S1 S0
           +-----------+
 I0-I15 -->| 16:1 MUX-1|--P--+      S4
           +-----------+     |   +------+
                             +-->|0     |
           +-----------+         | 2:1  |---> Y
 I16-I31 ->| 16:1 MUX-2|--Q----->|1     |
           +-----------+         +------+
             S3 S2 S1 S0

Output equation

Y=S4′P+S4QY = S_4'P + S_4Q

where P=∑k=015mkIkP = \sum_{k=0}^{15} m_k I_k and Q=∑k=015mkIk+16Q = \sum_{k=0}^{15} m_k I_{k+16}, with mkm_k the minterms of S3S2S1S0S_3S_2S_1S_0.

S4S_4S3S2S1S0S_3S_2S_1S_0Y
00000 – 1111I0I_0 – I15I_{15}
10000 – 1111I16I_{16} – I31I_{31}

Example

S4S3S2S1S0=11001S_4S_3S_2S_1S_0 = 11001 (= 25). MUX-1 gives I9I_9 and MUX-2 gives I25I_{25} (both select input 9). The 2:1 MUX with S4=1S_4 = 1 passes QQ, so Y=I25Y = I_{25}. Correct.

Alternative: if the 16:1 MUXes (e.g. 74150) have enable inputs, connect S4′S_4' to the enable of MUX-1 and S4S_4 to MUX-2, and OR the two outputs instead of using the 2:1 MUX.

  • 2068 Chaitra · 5 marks

Design a 3-bit even parity generator and 4-bit even parity checker circuit.

Answer

Parity is used to detect single-bit errors. With even parity, the transmitted word (data + parity bit) always has an even number of 1s.

3-bit even parity generator

Inputs A,B,CA, B, C; output PP makes the total number of 1s even.

ABCP
0000
0011
0101
0110
1001
1010
1100
1111
P=Σm(1,2,4,7)=A′B′C+A′BC′+AB′C′+ABC=A′(B⊕C)+A(B⊙C)=A⊕B⊕C\begin{aligned} P &= \Sigma m(1,2,4,7) = A'B'C + A'BC' + AB'C' + ABC \\ &= A'(B \oplus C) + A(B \odot C) = A \oplus B \oplus C \end{aligned}
 A --+
     +--[XOR]--+
 B --+         +--[XOR]--- P
 C ------------+

4-bit even parity checker

The receiver gets A,B,C,PA, B, C, P and produces the parity error check PECPEC: 0 if the count of 1s is even (no error), 1 if odd (error).

A B C PNo. of 1sPEC
000000
000111
001120
011131
111140
(other rows follow the same rule)

PEC=1PEC = 1 for minterms 1, 2, 4, 7, 8, 11, 13, 14 (odd number of 1s). The K-map is a checkerboard, so

PEC=A⊕B⊕C⊕P=(A⊕B)⊕(C⊕P)PEC = A \oplus B \oplus C \oplus P = (A \oplus B) \oplus (C \oplus P)
 A --+
     +--[XOR]--+
 B --+         |
               +--[XOR]--- PEC
 C --+         |
     +--[XOR]--+
 P --+

Example

Data 110110: generator gives P=1⊕1⊕0=0P = 1 \oplus 1 \oplus 0 = 0; sent word 11001100. If received correctly, PEC=1⊕1⊕0⊕0=0PEC = 1 \oplus 1 \oplus 0 \oplus 0 = 0 (no error). If bit C flips (received 11101110), PEC=1PEC = 1, so an error is flagged.

  • 2082 Shrawan · 4 marks

Implement 16:1 multiplexer using only 8:1 multiplexers.

Answer

A 16:1 MUX has inputs I0I_0–I15I_{15} and four selects S3S2S1S0S_3S_2S_1S_0. Using only 8:1 MUXes, three are needed:

  • MUX-1 (8:1): inputs I0I_0–I7I_7, selects S2S1S0S_2S_1S_0, output PP.
  • MUX-2 (8:1): inputs I8I_8–I15I_{15}, selects S2S1S0S_2S_1S_0, output QQ.
  • MUX-3 (8:1) used as a 2:1 MUX: PP to its I0I_0, QQ to its I1I_1; its select S0S_0 is driven by S3S_3 and its other two selects are tied to 0.
         S2 S1 S0
        +--------+
 I0-I7->| MUX-1  |--P--+     +--------+
        +--------+     +---->| I0     |
        +--------+     +---->| I1 MUX3|---> Y
 I8-15->| MUX-2  |--Q--+     | I2-I7=0|
        +--------+           +--------+
         S2 S1 S0            0  0  S3
                             (S2 S1 S0 of MUX-3)
Y=S3′P+S3QY = S_3'P + S_3Q
S3S_3Y
0PP = one of I0I_0–I7I_7
1QQ = one of I8I_8–I15I_{15}

Example: S3S2S1S0=1101S_3S_2S_1S_0 = 1101: P=I5P = I_5, Q=I13Q = I_{13}; MUX-3 select =001= 001 passes QQ, so Y=I13Y = I_{13}. Correct.

  • 2082 Shrawan · 4 marks

Realize a full-subtractor circuit using a single 2×4 decoder and necessary logic gates.

Answer

A full subtractor computes A−B−BinA - B - B_{in}, giving difference DD and borrow BoutB_{out}. A single 2×4 decoder has only two inputs, so feed it AA and BB; its outputs are the minterms of A,BA, B, and BinB_{in} is combined with gates.

Truth table grouped by AB

ABBinB_{in}DBoutB_{out}
00000
00111
01011
01101
10010
10100
11000
11111
ABDecoder lineDBoutB_{out}
00Y0Y_0BinB_{in}BinB_{in}
01Y1Y_1Bin′B_{in}'1
10Y2Y_2Bin′B_{in}'0
11Y3Y_3BinB_{in}BinB_{in}

Equations

D=(Y1+Y2)⊕BinBout=Y1+(Y0+Y3) Bin\begin{aligned} D &= (Y_1 + Y_2) \oplus B_{in} \\ B_{out} &= Y_1 + (Y_0 + Y_3)\,B_{in} \end{aligned}

(Here Y1+Y2=A⊕BY_1 + Y_2 = A \oplus B and Y0+Y3=A⊙BY_0 + Y_3 = A \odot B.)

          +--------+
  A ----->| 2x4  Y0|---> E (OR)
  B ----->|      Y1|---> P (OR), Bout (OR)
          |      Y2|---> P (OR)
          |      Y3|---> E (OR)
          +--------+
  Y0, Y3 ---[OR]--- E  (= A xnor B)
  Y1, Y2 ---[OR]--- P  (= A xor B)
  P, Bin ---[XOR]------------------ D
  E, Bin ---[AND]--- E.Bin --+
  Y1 ------------------------+-[OR]-- Bout

Gates: 2 OR (2-input), 1 XOR, 1 AND, 1 OR.

Check: A=0,B=1,Bin=1A=0, B=1, B_{in}=1: Y1=1Y_1 = 1, P=1P = 1, D=1⊕1=0D = 1 \oplus 1 = 0, Bout=1B_{out} = 1; indeed 0−1−1=−20 - 1 - 1 = -2, i.e. D=0D = 0 with borrow 1. All 8 rows were verified.

  • 2082 Shrawan · 2+3 marks

Differentiate between RAM and ROM. How does an EEPROM cell work?

Answer

RAM vs ROM

PointRAMROM
Full formRandom Access MemoryRead Only Memory
OperationRead and writeRead only (written once / rarely)
VolatilityVolatile: data lost on power offNon-volatile: data kept
UseTemporary data, running programsFirmware, BIOS, look-up tables
TypesSRAM, DRAMMask ROM, PROM, EPROM, EEPROM
Write speedFastSlow or not possible

Working of an EEPROM cell

EEPROM (Electrically Erasable PROM) can be written and erased electrically, byte by byte, in the circuit. Each cell uses a floating-gate MOSFET (FLOTOX) plus a select transistor.

       Control gate
     ==============
       oxide
     --------------  Floating gate (isolated)
       thin tunnel oxide (~10 nm)
  n+ Source  [ p-substrate ]  n+ Drain
  1. Structure: a floating gate, fully surrounded by oxide, lies between the control gate and the channel. A small region of very thin oxide lies over the drain.
  2. Programming (write): a high voltage (about 12–20 V) is applied to the control gate with the drain grounded. Electrons tunnel through the thin oxide into the floating gate (Fowler–Nordheim tunnelling). The trapped negative charge raises the transistor's threshold voltage.
  3. Erasing: the voltage is reversed (high voltage on the drain, control gate grounded), so electrons tunnel back out of the floating gate and the threshold falls to its normal value.
  4. Reading: a normal voltage is applied to the control gate. A charged cell does not conduct (read as 0); an uncharged cell conducts (read as 1). The charge stays for 10+ years without power, so the memory is non-volatile.

EEPROM does not need UV light (unlike EPROM), but the cell is larger and the number of write cycles is limited (about 10510^5–10610^6).

  • 2082 Baisakh · 5 marks

Design a circuit that compares two 4-bit numbers, A and B, to check if they are equal. The circuit has one output X, so that X = 1 if A = B and X = 0 if A ≠ B.

Answer

Two 4-bit numbers A=A3A2A1A0A = A_3A_2A_1A_0 and B=B3B2B1B0B = B_3B_2B_1B_0 are equal only when every pair of corresponding bits is equal. Equality of one pair is detected by an XNOR gate.

Bit-equality signals

xi=Ai⊙Bi=AiBi+Ai′Bi′,i=0,1,2,3x_i = A_i \odot B_i = A_iB_i + A_i'B_i', \quad i = 0, 1, 2, 3
AiA_iBiB_ixix_i
001
010
100
111

Output

X=1X = 1 only if all four xi=1x_i = 1:

X=x3x2x1x0=(A3⊙B3)(A2⊙B2)(A1⊙B1)(A0⊙B0)X = x_3x_2x_1x_0 = (A_3 \odot B_3)(A_2 \odot B_2)(A_1 \odot B_1)(A_0 \odot B_0)

Equivalent form with XOR and NOR:

X=(A3⊕B3)+(A2⊕B2)+(A1⊕B1)+(A0⊕B0)‾X = \overline{(A_3 \oplus B_3) + (A_2 \oplus B_2) + (A_1 \oplus B_1) + (A_0 \oplus B_0)}

A full truth table would have 28=2562^8 = 256 rows with X=1X = 1 in only 16 of them (A=BA = B), so the bit-wise method is used instead of a K-map.

Logic circuit

 A3 --+
 B3 --+--[XNOR]-- x3 --+
 A2 --+                |
 B2 --+--[XNOR]-- x2 --+
                       +--[AND 4]--- X
 A1 --+                |
 B1 --+--[XNOR]-- x1 --+
 A0 --+                |
 B0 --+--[XNOR]-- x0 --+

Gates: four 2-input XNOR gates and one 4-input AND gate.

Examples

ABx3x2x1x0x_3x_2x_1x_0X
1011101111111
1011100111010
0110111001110

This is the "A = B" part of the 7485 4-bit magnitude comparator.

  • 2082 Baisakh · 4 marks

Implement the following function with 8:1 multiplexer F(A,B,C,D) = Σm(0,1,3,4,8,9,15) + dΣ(2,6,13).

Answer

Use A,B,CA, B, C as the select lines S2S1S0S_2S_1S_0 and DD (or D′D', 0, 1) on the data inputs. Input IjI_j covers minterms 2j2j (D=0D=0) and 2j+12j+1 (D=1D=1).

  • Minterms: 0, 1, 3, 4, 8, 9, 15
  • Don't-cares: 2, 6, 13 (each can be taken as 0 or 1, whichever gives a simpler input)

Implementation table (X = don't care)

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
D′D'0X(2)4X(6)8101214
DD1357911X(13)15
Input11D′D'0100DD

Choices for the don't-cares:

  • I1I_1: minterm 3 is 1; taking d(2) = 1 gives I1=1I_1 = 1 (no gate needed).
  • I3I_3: minterm 7 is 0; taking d(6) = 0 gives I3=0I_3 = 0.
  • I6I_6: minterm 12 is 0; taking d(13) = 0 gives I6=0I_6 = 0.

Circuit

             +--------+
  1 -------->| I0     |
  1 -------->| I1     |
  D --[NOT]->| I2     |
  0 -------->| I3 8:1 |----> F
  1 -------->| I4 MUX |
  0 -------->| I5     |
  0 -------->| I6     |
  D -------->| I7     |
             +--------+
              A  B  C

Check: ABCD=0100ABCD = 0100 (4): select 010 → I2=D′=1I_2 = D' = 1, F=1F = 1. ABCD=0101ABCD = 0101 (5): I2=D′=0I_2 = D' = 0, F=0F = 0. ABCD=1111ABCD = 1111 (15): I7=D=1I_7 = D = 1. All required minterms give 1 and all other non-don't-care minterms give 0.

  • 2082 Baisakh · 6 marks

Implement the circuit with a PLA of the following Boolean function: F1 = Σm(3,5,6,7) and F2 = Σm(0,2,4,7).

Answer

A PLA (Programmable Logic Array) has a programmable AND array that forms product terms and a programmable OR array that sums them into outputs. To use it efficiently, each function is minimized and product terms are shared where possible.

Simplification

F1=Σm(3,5,6,7)F_1 = \Sigma m(3,5,6,7):

A \ BC00011110
00010
10111
F1=AB+AC+BCF_1 = AB + AC + BC

F2=Σm(0,2,4,7)F_2 = \Sigma m(0,2,4,7):

A \ BC00011110
01001
11010

Groups: (0, 2) gives A′C′A'C'; (0, 4) gives B′C′B'C'; 7 alone gives ABCABC.

F2=A′C′+B′C′+ABCF_2 = A'C' + B'C' + ABC

PLA programming table

Six product terms are needed (none is common to both functions). In the input columns 1 = true variable, 0 = complemented, – = not connected; in the output columns 1 = term connected to that OR gate.

TermProductABCF1F_1F2F_2
1ABAB11–1–
2ACAC1–11–
3BCBC–111–
4A′C′A'C'0–0–1
5B′C′B'C'–00–1
6ABCABC111–1

Size: 3 inputs × 6 product terms × 2 outputs.

PLA diagram

 A  A' B  B' C  C'        (input buffers)
 |  |  |  |  |  |
 x--+--x--+--+--+--[AND]-- P1 = AB
 x--+--+--+--x--+--[AND]-- P2 = AC
 +--+--x--+--x--+--[AND]-- P3 = BC
 +--x--+--+--+--x--[AND]-- P4 = A'C'
 +--+--+--x--+--x--[AND]-- P5 = B'C'
 x--+--x--+--x--+--[AND]-- P6 = ABC
            OR array
 P1, P2, P3 ----------[OR]--> F1
 P4, P5, P6 ----------[OR]--> F2
 (x = programmed connection)

Check: ABC=110ABC = 110 (6): P1=1P_1 = 1, so F1=1F_1 = 1; P4=P5=P6=0P_4 = P_5 = P_6 = 0, so F2=0F_2 = 0. Both match the given minterm lists for all 8 inputs.

  • 2081 Bhadra · 3+3 marks

Realize logic circuit for segment "b" and "d" of the seven segment display decoder.

Answer

A BCD-to-seven-segment decoder takes BCD input ABCDABCD (AA = MSB) and drives segments a–g. Inputs 10–15 never occur, so they are don't-cares (X).

     a
    ---
 f | g | b
    ---
 e |   | c
    ---
     d

Segment "b"

Segment b is ON for digits 0, 1, 2, 3, 4, 7, 8, 9 (OFF for 5, 6).

b=Σm(0,1,2,3,4,7,8,9)+d(10–15)b = \Sigma m(0,1,2,3,4,7,8,9) + d(10\text{–}15)
AB \ CD00011110
001111
011010
11XXXX
1011XX

Groups: B′B' (rows 00 and 10), C′D′C'D' (column 00), CDCD (column 11).

b=B′+C′D′+CD=B′+(C⊙D)b = B' + C'D' + CD = B' + (C \odot D)
 B ---[NOT]---------------+
 C --+                    +--[OR]--- b
 D --+--[XNOR]------------+

Segment "d"

Segment d is ON for digits 0, 2, 3, 5, 6, 8, 9 (OFF for 1, 4, 7).

d=Σm(0,2,3,5,6,8,9)+d(10–15)d = \Sigma m(0,2,3,5,6,8,9) + d(10\text{–}15)
AB \ CD00011110
001011
010101
11XXXX
1011XX

Groups: AA (rows 11, 10); B′D′B'D' (corners 0, 2, 8, 10); B′CB'C (2, 3, 10, 11); CD′CD' (2, 6, 10, 14); BC′DBC'D (5 with 13).

d=A+B′D′+B′C+CD′+BC′Dd = A + B'D' + B'C + CD' + BC'D
 B',D' ---[AND]---+
 B',C  ---[AND]---+
 C,D'  ---[AND]---+--[OR 5]--- d
 B,C',D --[AND]---+
 A ---------------+

Check: digit 5 (01010101): b=0+0+0=0b = 0 + 0 + 0 = 0 (b off) and d=BC′D=1d = BC'D = 1 (d on). Digit 7 (01110111): b=CD=1b = CD = 1 and every term of dd is 0. Both expressions were verified for digits 0–9.

  • 2081 Baisakh · 2+5 marks

Differentiate between encoder and decoder. Design an 8 to 3 encoder with diagrams.

Answer

Encoder vs decoder

PointEncoderDecoder
FunctionConverts one active line to a binary codeConverts a binary code to one active line
Inputs / outputs2n2^n inputs, nn outputsnn inputs, 2n2^n outputs
Main gatesOR gatesAND gates
Example8-to-3 (octal to binary)3-to-8 (74138)
UseKeyboards, interrupt encodingAddress decoding, display driving

8-to-3 encoder

An 8-to-3 (octal-to-binary) encoder has eight inputs D0D_0–D7D_7 and three outputs Y2Y1Y0Y_2Y_1Y_0. When one input DkD_k is 1, the output is the binary code of kk. Only one input is assumed active at a time.

Truth table

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0Y2Y_2Y1Y_1Y0Y_0
00000001000
00000010001
00000100010
00001000011
00010000100
00100000101
01000000110
10000000111

Output equations. Each output is 1 for the inputs whose code has a 1 in that bit:

Y2=D4+D5+D6+D7Y1=D2+D3+D6+D7Y0=D1+D3+D5+D7\begin{aligned} Y_2 &= D_4 + D_5 + D_6 + D_7 \\ Y_1 &= D_2 + D_3 + D_6 + D_7 \\ Y_0 &= D_1 + D_3 + D_5 + D_7 \end{aligned}

Logic diagram

 D4, D5, D6, D7 ---[OR 4]---> Y2
 D2, D3, D6, D7 ---[OR 4]---> Y1
 D1, D3, D5, D7 ---[OR 4]---> Y0
 (D0 not connected: it gives 000)

Example: D6=1D_6 = 1 → Y2=1Y_2 = 1, Y1=1Y_1 = 1, Y0=0Y_0 = 0, output 110=6110 = 6.

Limitations: D0=1D_0 = 1 and "no input active" both give 000, and two active inputs give a wrong code (e.g. D3D_3 and D4D_4 give 111). A valid-output bit and a priority encoder (74148) remove these problems.

  • 2081 Baisakh · 2+4 marks

Explain the applications of de-multiplexer. Subtract 011 from 010 using 2's complement method.

Answer

Applications of a demultiplexer

A demultiplexer sends one input to one of many outputs selected by the select lines. Uses:

  • Data distribution / serial-to-parallel conversion: serial data on one line is sent to different output lines in turn.
  • Time-division demultiplexing in communication: separating signals from a shared line at the receiver (e.g. telephone exchanges).
  • Decoder function: with data input held at 1 (or used as enable), a 1:2n2^n DEMUX works as an nn-to-2n2^n decoder for memory address decoding and chip selection.
  • Boolean function generation: outputs give minterms, which can be ORed to realize functions (e.g. full adder).
  • Control signal routing in ALUs, microprocessors and multi-display systems.

(010)₂ − (011)₂ using 2's complement

Here 010=2010 = 2 and 011=3011 = 3; expected result 2−3=−12 - 3 = -1.

  1. 2's complement of the subtrahend 011011:
    • 1's complement: 100100
    • add 1: 100+1=101100 + 1 = 101
  2. Add to the minuend:
     010    (+2)
   + 101    (2's complement of 3)
   -----
     111    (no end carry)
  1. There is no end carry, so the result is negative and is in 2's complement form. Take the 2's complement of 111111 to get its magnitude:
    • 1's complement: 000000
    • add 1: 001001

Answer: (010)2−(011)2=−(001)2=(−1)10(010)_2 - (011)_2 = -(001)_2 = (-1)_{10}. In 3-bit 2's complement form the result is stored as 111111.

  • 2081 Baisakh · 2+5 marks

Differentiate between de-multiplexer and decoder. Construct 4×16 line decoder using 2×4 line decoders with enable.

Answer

DEMUX vs decoder

PointDemultiplexerDecoder
Inputs1 data + nn select linesnn code inputs (+ enable)
Outputs2n2^n2n2^n
JobRoutes the data bit to one outputActivates the output for the input code
Output valueEquals the data inputFixed active level (1 or 0)
Typical useData distributionAddress decoding, code conversion

A decoder with enable becomes a DEMUX when the enable pin is used as the data input; e.g. 74138 serves both roles.

4×16 decoder from 2×4 decoders with enable

A 4×16 decoder has inputs ABCDA B C D (AA = MSB) and outputs Y0Y_0–Y15Y_{15}. Use five 2×4 decoders:

  • Decoder 0 (control): inputs A,BA, B; enable tied to 1 (or to an overall enable EE). Its outputs O0O_0–O3O_3 enable one of the four output decoders.
  • Decoders 1–4: inputs C,DC, D; each enable comes from one output of decoder 0. Each produces four of the final outputs.
        A B                     C D
     +--------+             +--------+
 E ->|E    O0 |------------>|E DEC1  |--> Y0 .. Y3
     |     O1 |---------+   +--------+
     | DEC0   |         |   +--------+
     |     O2 |------+  +-->|E DEC2  |--> Y4 .. Y7
     |     O3 |---+  |      +--------+
     +--------+   |  |      +--------+
                  |  +----->|E DEC3  |--> Y8 .. Y11
                  |         +--------+
                  |         +--------+
                  +-------->|E DEC4  |--> Y12 .. Y15
                            +--------+
   (C, D go to all of DEC1 - DEC4)

Connections: O0→O_0 \to DEC1, O1→O_1 \to DEC2, O2→O_2 \to DEC3, O3→O_3 \to DEC4 (all enables).

ABEnabled decoderOutputs for CD = 00…11
00DEC1Y0Y_0–Y3Y_3
01DEC2Y4Y_4–Y7Y_7
10DEC3Y8Y_8–Y11Y_{11}
11DEC4Y12Y_{12}–Y15Y_{15}

Working

Input ABCD=1101ABCD = 1101: decoder 0 sees AB=11AB = 11 and enables DEC4 only; DEC4 decodes CD=01CD = 01 and makes its second output high, i.e. Y13Y_{13}. The disabled decoders keep all their outputs at 0, so exactly one of the 16 lines is active, giving Yk=mk(A,B,C,D)Y_k = m_k(A,B,C,D).

  • 2081 Baisakh · 2 marks

Write a short note on PROM.

Answer

PROM (Programmable Read-Only Memory) is a ROM that is manufactured blank and can be programmed once by the user with a PROM programmer. After programming its contents cannot be changed (one-time programmable, OTP).

  • Structure: a fixed AND array (decoder producing all minterms of the address lines) and a programmable OR array. Each cross-point has a fusible link (nichrome or polysilicon fuse, or a diode).
  • Programming: all fuses are intact at first (all bits 1). A high current pulse blows selected fuses, making those bits 0. This is permanent.
  • Uses: storing fixed programs, look-up tables and code converters; it can implement any combinational function in sum-of-minterms form.

Unlike EPROM or EEPROM, a PROM cannot be erased; a mistake means a new chip.

  • 2081 Baisakh · 2 marks

Write a short note on MUX tree.

Answer

A MUX tree is a way of building a large multiplexer from several smaller multiplexers connected in levels (a tree). It is used when a single IC with enough inputs is not available.

  • The first level of small MUXes receives the data inputs. The lower-order select lines are applied to all of them in common.
  • The outputs of the first level go to the data inputs of the next level, which is driven by the higher-order select lines.
  • The last MUX gives the final output YY.

Example: 8:1 MUX from 2:1 MUXes (needs 4 + 2 + 1 = 7 MUXes):

I0,I1 -[2:1]-+
I2,I3 -[2:1]-+-[2:1]-+
I4,I5 -[2:1]-+       +-[2:1]--> Y
I6,I7 -[2:1]-+-[2:1]-+
      ^S0       ^S1     ^S2

Similarly a 16:1 MUX can be built from five 4:1 MUXes (four in the first level using S1S0S_1S_0, one in the second level using S3S2S_3S_2).

Advantages: large MUX from standard small ICs; easy to expand. Drawback: more ICs and more propagation delay (one MUX delay per level).

  • 2080 Bhadra · 1+4 marks

What is meant by a decoder? Construct 3×8 decoder using two 2×4 decoders and additional gates if required.

Answer

A decoder is a combinational circuit that converts an nn-bit binary input code into one of 2n2^n unique output lines; for each input combination exactly one output is active (it generates all minterms).

3×8 decoder using two 2×4 decoders

Let the inputs be AA (MSB), BB, CC (LSB). Each 2×4 decoder has an enable input EE (active high).

  • BB and CC go to the inputs of both 2×4 decoders.
  • AA selects which decoder works: A′A' (through a NOT gate) drives EE of decoder 1 and AA drives EE of decoder 2.
  • When A=0A = 0, decoder 1 is enabled and gives D0D_0–D3D_3; when A=1A = 1, decoder 2 gives D4D_4–D7D_7.
              +---------+
B,C ---+----->| 2x4 #1  |--> D0..D3
       |   +->| E       |
       |   |  +---------+
A -+-[NOT]-+
   |   |      +---------+
   |   +----->| 2x4 #2  |--> D4..D7
   +--------->| E       |
              +---------+
ABCActive output
000D0D_0
001D1D_1
010D2D_2
011D3D_3
100D4D_4
101D5D_5
110D6D_6
111D7D_7

Only one extra gate (an inverter) is needed. With an overall enable EE, use E⋅A′E\cdot A' and E⋅AE\cdot A (two AND gates) for the two enables.

  • 2080 Baisakh · 2+4 marks

What is a priority encoder? Find out logic expressions and draw the logic circuit of 4 to 2 priority encoder.

Answer

A priority encoder is an encoder that gives the binary code of the highest-priority active input when more than one input is active at the same time. It also has a valid output VV that shows whether any input is active (an ordinary encoder gives a wrong code when two inputs are high).

4-to-2 priority encoder

Inputs D0D_0–D3D_3, with D3D_3 the highest priority. Outputs Y1Y0Y_1Y_0 and VV (X = don't care).

D3D_3D2D_2D1D_1D0D_0Y1Y_1Y0Y_0VV
0000XX0
0001001
001X011
01XX101
1XXX111

Expressions (from K-maps of the expanded table):

  • Y1=1Y_1 = 1 when D3=1D_3 = 1 or D2=1D_2 = 1:
Y1=D3+D2Y_1 = D_3 + D_2
  • Y0=1Y_0 = 1 when D3=1D_3 = 1, or when D1=1D_1 = 1 with D2=0D_2 = 0 (and D3=0D_3=0):
Y0=D3+D3′D2′D1=D3+D2′D1Y_0 = D_3 + D_3'D_2'D_1 = D_3 + D_2'D_1
  • VV is 1 if any input is 1:
V=D3+D2+D1+D0V = D_3 + D_2 + D_1 + D_0

Logic circuit

D3 -----------+---------> [OR] --> Y1
D2 ---+-------|---------> [  ]
      |       |
      +-[NOT]-|-+
              | [AND]-+
D1 -----------|-[   ] +-> [OR] --> Y0
              +---------> [  ]

D0,D1,D2,D3 ----------> [4-in OR] --> V

So the circuit needs one NOT, one 2-input AND, two 2-input OR gates and one 4-input OR gate. Example: D3D2D1D0=0110D_3D_2D_1D_0 = 0110 gives Y1Y0=10Y_1Y_0 = 10 because D2D_2 has higher priority than D1D_1.

  • 2080 Baisakh · 2+4 marks

What is a ROM? Explain it how one bit memory is stored as '1' or '0', based on BJT circuit.

Answer

ROM (Read Only Memory) is a non-volatile semiconductor memory in which data is written once (during manufacture or by programming) and afterwards can only be read. Data stays even when power is removed. It is used to store fixed programs (BIOS, firmware), look-up tables and code converters. Types: mask ROM, PROM, EPROM, EEPROM.

Storing 1 or 0 in a BJT ROM cell

A bipolar ROM is an array of row (word) lines and column (bit) lines. At each crossing there is a cell position where a BJT may or may not be connected.

  • The base of the transistor is connected to the row line.
  • The collector is connected to VCCV_{CC}.
  • The emitter is connected to the column line only if a 1 is to be stored. Each column line has a resistor to ground.
 Vcc        Row line (from decoder)
  |          |
  C          |
   \|--------+       (stored '1')
   /| B
  E
  |
==+===== Column line --> sense --> Data = 1
         |
        [R]
         |
        GND

 Stored '0': emitter link absent (or fuse blown),
 so column stays at 0 V through R.

Reading:

  1. The address decoder makes the selected row line HIGH.
  2. In a cell storing 1, the transistor's base is high, so it conducts (emitter follower). Current flows through the column resistor and the column line goes HIGH, which is read as 1.
  3. In a cell storing 0, there is no emitter connection, so no current flows into that column; the resistor keeps it at 0 V, read as 0.
  4. Unselected rows are LOW, so their transistors are off and do not affect the columns.

In a mask ROM the connection is made or left out by the metal mask. In a bipolar PROM every cell is made with a fusible link in the emitter; the user stores a 0 by blowing the fuse with a high current pulse, and the intact fuse keeps a 1. Since the stored pattern is fixed by a physical connection, the data is non-volatile.

  • 2079 Bhadra · 4 marks

Realize full-adder using a single 4:1 MUX and logical gates.

Answer

A full adder adds AA, BB and CinC_{in} and gives

S=A⊕B⊕Cin,Cout=AB+Cin(A⊕B)S = A \oplus B \oplus C_{in}, \qquad C_{out} = AB + C_{in}(A \oplus B)

Use AA and BB as the select lines (S1=AS_1 = A, S0=BS_0 = B) of the 4:1 MUX and express each output in terms of CinC_{in}.

Truth table grouped by A, B

ABCinC_{in}SCoutC_{out}
00000
00110
01010
01101
10010
10101
11001
11111
ABS in terms of CinC_{in}CoutC_{out} in terms of CinC_{in}
00 (I0I_0)CinC_{in}0
01 (I1I_1)Cin′C_{in}'CinC_{in}
10 (I2I_2)Cin′C_{in}'CinC_{in}
11 (I3I_3)CinC_{in}1

Realization

  • Sum from the single 4:1 MUX: I0=CinI_0 = C_{in}, I1=Cin′I_1 = C_{in}', I2=Cin′I_2 = C_{in}', I3=CinI_3 = C_{in} (one NOT gate gives Cin′C_{in}').
  • Carry from gates: Cout=AB+Cin(A⊕B)C_{out} = AB + C_{in}(A\oplus B), using one XOR, two AND and one OR gate (or the simpler Cout=AB+BCin+ACinC_{out} = AB + BC_{in} + AC_{in}).
Cin ------+----------> I0 +-------+
          +-[NOT]--+-> I1 | 4:1   |
                   +-> I2 | MUX   |--> S
Cin -----------------> I3 |       |
                          +-------+
                          S1=A S0=B

A --+--[AND]---------------+
B --+--[   ]               +--[OR]--> Cout
A,B --[XOR]--[AND]---------+
Cin ---------[   ]

Check: A=1,B=0,Cin=1A=1, B=0, C_{in}=1 selects I2=Cin′=0I_2 = C_{in}' = 0 so S=0S = 0, and Cout=0+1⋅1=1C_{out} = 0 + 1\cdot1 = 1. This matches 1+0+1=1021+0+1 = 10_2.

(If a second 4:1 MUX were allowed, CoutC_{out} would use I0=0,I1=Cin,I2=Cin,I3=1I_0=0, I_1=C_{in}, I_2=C_{in}, I_3=1.)

  • 2079 Bhadra · 6 marks

Design the BCD to seven segment decoder. Obtain the simplest logic expressions for segments "a" and "e" also draw their circuits.

Answer

A BCD-to-seven-segment decoder takes a 4-bit BCD digit ABCDABCD (AA = MSB) and drives the seven segments a–g of a display so that the decimal digit 0–9 is shown. Inputs 1010–1111 never occur, so they are don't cares. (Common-cathode display: a 1 lights the segment.)

   --a--
  |     |
  f     b
  |--g--|
  e     c
  |     |
   --d--

Truth table for segments a and e

DigitA B C Dae
0000011
1000100
2001011
3001110
4010000
5010110
6011011
7011110
8100011
9100110

So a=Σm(0,2,3,5,6,7,8,9)+d(10–15)a = \Sigma m(0,2,3,5,6,7,8,9) + d(10\text{–}15) and e=Σm(0,2,6,8)+d(10–15)e = \Sigma m(0,2,6,8) + d(10\text{–}15).

K-map for a

        CD=00 01  11  10
AB=00     1   0   1   1
AB=01     0   1   1   1
AB=11     X   X   X   X
AB=10     1   1   X   X

Groups: AA (rows 11, 10 with don't cares), CC (columns 11, 10), BDBD (cells 5, 7, 13, 15), B′D′B'D' (corners 0, 2, 8, 10).

a=A+C+BD+B′D′a = A + C + BD + B'D'

K-map for e

        CD=00 01  11  10
AB=00     1   0   0   1
AB=01     0   0   0   1
AB=11     X   X   X   X
AB=10     1   0   X   X

Groups: B′D′B'D' (corners 0, 2, 8, 10) and CD′CD' (column 10: 2, 6, 14, 10).

e=B′D′+CD′=D′(B′+C)e = B'D' + CD' = D'(B' + C)

Circuits

a:  A --------------------+
    C --------------------+
    B --+[AND]------------+--[4-in OR]--> a
    D --+[   ]            |
    B'--+[AND]------------+
    D'--+[   ]

e:  B' --+--[OR]--+
    C  --+--[  ]  +--[AND]--> e
    D' -----------+--[   ]

ee needs only one OR gate, one AND gate and an inverter for DD (B′B' is shared with segment a). Check: digit 6 (0110): a=0+1+0+0=1a = 0+1+0+0 = 1, e=D′(B′+C)=1⋅(0+1)=1e = D'(B'+C) = 1\cdot(0+1) = 1, correct.

  • 2079 Bhadra · 2+4 marks

What is a memory device? Distinguish between PAL and PLA memory devices.

Answer

A memory device is a device that stores binary information (bits) and lets it be read back, and in some types written. Each stored word is reached by an address. Examples: ROM, PROM, EPROM, RAM. Programmable logic devices such as PROM, PAL and PLA use the same array structure (an AND array that decodes the inputs and an OR array that holds the pattern), so they are studied with memories.

PAL vs PLA

PLA (Programmable Logic Array): both the AND array and the OR array are programmable. PAL (Programmable Array Logic): the AND array is programmable but the OR array is fixed (each OR gate gets a fixed group of product terms).

PointPALPLA
AND arrayProgrammableProgrammable
OR arrayFixedProgrammable
Sharing of product termsNot possible; each output has its own termsAny product term can feed any output
FlexibilityLessMore
SpeedFaster (fewer programmable links in path)Slower
Cost and complexityCheaper, simpler to makeCostlier, more complex
Terms per outputLimited to a fixed numberLimited only by total AND gates
Typical useSimple glue logic, widely used (e.g. PAL16L8)Multi-output functions with common terms
 PAL:  inputs -> [programmable AND] -> [fixed OR] -> out
 PLA:  inputs -> [programmable AND] -> [prog. OR] -> out

Example: if F1=AB+CF_1 = AB + C and F2=AB+DF_2 = AB + D, a PLA generates ABAB once and feeds it to both outputs; a PAL must generate ABAB twice, once in each OR group.

  • 2078 Bhadra · 4+3 marks

Implement the given function F = Σ(0,2,3,5,8,12,14) using only one 8:1 MUX. Add the binary numbers 1011 and 1101 by using Full adders.

Answer

Implementing F = Σ(0,2,3,5,8,12,14) with one 8:1 MUX

Take A,B,CA, B, C as select lines (S2S1S0S_2S_1S_0) and the LSB DD as the data variable. Each data input IiI_i covers minterms 2i2i (D=0D = 0) and 2i+12i+1 (D=1D = 1).

IiI_iABCMinterms (DD=0, DD=1)In F?IiI_i
I0I_00000, 1yes, noD′D'
I1I_10012, 3yes, yes1
I2I_20104, 5no, yesDD
I3I_30116, 7no, no0
I4I_41008, 9yes, noD′D'
I5I_510110, 11no, no0
I6I_611012, 13yes, noD′D'
I7I_711114, 15yes, noD′D'
D' --> I0 +--------+
1  --> I1 |        |
D  --> I2 |  8:1   |
0  --> I3 |  MUX   |--> F
D' --> I4 |        |
0  --> I5 |        |
D' --> I6 |        |
D' --> I7 +--------+
           S2 S1 S0
           A  B  C

Only one NOT gate is needed for D′D'.

Adding 1011 and 1101 with full adders

Use a 4-bit parallel adder: four full adders FA0–FA3, with C0=0C_0 = 0 and each carry going to the next stage.

 A3B3     A2B2     A1B1     A0B0
  1 1      0 1      1 0      1 1
 [FA3]<-C3[FA2]<-C2[FA1]<-C1[FA0]<-C0=0
  |  \     |        |        |
 C4  S3    S2       S1       S0
StageAiA_iBiB_iCiC_iSiS_iCi+1C_{i+1}
FA011001
FA110101
FA201101
FA311111

Answer: 1011+1101=1100021011 + 1101 = 11000_2 (carry C4=1C_4 = 1, sum S3S2S1S0=1000S_3S_2S_1S_0 = 1000). Check: 11+13=24=11000211 + 13 = 24 = 11000_2.

  • 2078 Bhadra · 6 marks

Find out the simplest logic circuit as far as possible for the 'e' segment of the seven segment display decoder.

Answer

For a BCD-to-seven-segment decoder the input is a BCD digit ABCDABCD (AA = MSB). Codes 1010–1111 never occur, so they are don't cares. Segment e is the lower-left segment (common-cathode display: 1 = ON).

   --a--
  f     b
   --g--
  e     c
   --d--

Truth table for e

Segment e is ON only for digits 0, 2, 6 and 8.

DigitA B C De
000001
100010
200101
300110
401000
501010
601101
701110
810001
910010
10–151010–1111X
e=Σm(0,2,6,8)+d(10,11,12,13,14,15)e = \Sigma m(0,2,6,8) + d(10,11,12,13,14,15)

K-map

        CD=00 01  11  10
AB=00     1   0   0   1
AB=01     0   0   0   1
AB=11     X   X   X   X
AB=10     1   0   X   X
  • Quad 1: the four corners m0,m2,m8,m10m_0, m_2, m_8, m_{10} give B′D′B'D'.
  • Quad 2: column CD=10CD = 10: m2,m6,m14,m10m_2, m_6, m_{14}, m_{10} give CD′CD'.
e=B′D′+CD′=D′(B′+C)e = B'D' + CD' = D'(B' + C)

Simplest circuit

The factored form needs only one OR, one AND and two inverters:

B --[NOT]-- B' --+
                 +--[OR]--+
C ---------------+        +--[AND]--> e
D --[NOT]-- D' -----------+

Check: digit 2 (0010): D′=1D' = 1, B′+C=1B' + C = 1, so e=1e = 1; digit 4 (0100): B′=0B' = 0, C=0C = 0, so e=0e = 0. Both correct.

  • 2078 Bhadra · 2+3 marks

Define PLA (Programmable Logic Array). Implement the full subtractor using PLA.

Answer

A PLA (Programmable Logic Array) is a programmable logic device with a programmable AND array followed by a programmable OR array. The AND array generates the needed product terms of the inputs and the OR array sums any of them for each output, so it can implement several SOP functions that share product terms.

Full subtractor using PLA

Inputs AA (minuend), BB (subtrahend), BinB_{in} (borrow in). Outputs: difference DD and borrow out BoB_o.

ABBinB_{in}DBoB_o
00000
00111
01011
01101
10010
10100
11000
11111
D=Σm(1,2,4,7)=A′B′Bin+A′BBin′+AB′Bin′+ABBinD = \Sigma m(1,2,4,7) = A'B'B_{in} + A'BB_{in}' + AB'B_{in}' + ABB_{in} Bo=Σm(1,2,3,7)=A′Bin+A′B+BBinB_o = \Sigma m(1,2,3,7) = A'B_{in} + A'B + BB_{in}

DD (XOR) cannot be simplified, so 4 + 3 = 7 product terms are needed.

PLA programming table (1 = true input, 0 = complemented, – = not used):

TermProductABBinB_{in}DBoB_o
1A′B′BinA'B'B_{in}0011–
2A′BBin′A'BB_{in}'0101–
3AB′Bin′AB'B_{in}'1001–
4ABBinABB_{in}1111–
5A′BinA'B_{in}0–1–1
6A′BA'B01––1
7BBinBB_{in}–11–1
A  B  Bin (true and complement lines)
|  |  |
[ AND array: P1 ... P7 ]   (programmed)
   |
[ OR array ]
   OR1 = P1+P2+P3+P4  ---> D
   OR2 = P5+P6+P7     ---> Bo

So a 3-input, 7-product-term, 2-output PLA implements the full subtractor.

  • 2078 Kartik · 4 marks

Implement the given function F = Σ(0,1,3,6,10,12,14) using 8×1 MUX only.

Answer

Use A,B,CA, B, C as the select lines (S2S1S0S_2 S_1 S_0) and the LSB DD as the data variable. Data input IiI_i covers minterm 2i2i (when D=0D=0) and 2i+12i+1 (when D=1D=1).

Implementation table (F = Σ(0,1,3,6,10,12,14)):

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
D′D' row02468101214
DD row13579111315
Input1DD0D′D'0D′D'D′D'D′D'

(Bold = minterm present in F.)

Rules: both entries present gives 1, none gives 0, only the D′D' row gives D′D', only the DD row gives DD.

1  --> I0 +--------+
D  --> I1 |        |
0  --> I2 |  8x1   |
D' --> I3 |  MUX   |--> F
0  --> I4 |        |
D' --> I5 |        |
D' --> I6 |        |
D' --> I7 +--------+
           S2 S1 S0
           A  B  C

Inputs 1 and 0 are tied to VCCV_{CC} and ground; one inverter gives D′D'.

Check: ABCD=1100ABCD = 1100 (minterm 12) selects I6=D′=1I_6 = D' = 1, so F=1F = 1; ABCD=0101ABCD = 0101 (minterm 5) selects I2=0I_2 = 0, so F=0F = 0. Both agree with the given function.

  • 2078 Kartik · 2+2×2 marks

Differentiate between PROM and PLA. Implement the following boolean functions using PAL. a) A(x,y,z) = Σ(2,4,5,7) b) B(x,y,z) = Σ(0,2,6)

Answer

PROM vs PLA

PointPROMPLA
AND arrayFixed (full decoder, all 2n2^n minterms)Programmable
OR arrayProgrammableProgrammable
Functions in formSum of minterms (no simplification)Simplified SOP, shared terms
Size for many inputsGrows as 2n2^n, wastefulOnly needed product terms
Typical useLook-up tables, code convertersMulti-output logic with common terms

Functions using PAL

In a PAL the AND array is programmable and the OR array is fixed, so each function is first simplified to SOP.

a) A(x,y,z)=Σ(2,4,5,7)A(x,y,z) = \Sigma(2,4,5,7)

       yz=00 01 11 10
x=0      0   0  0  1
x=1      1   1  1  0
  • m4,m5m_4, m_5 give xy′xy'; m5,m7m_5, m_7 give xzxz; m2m_2 alone gives x′yz′x'yz'.
A=xy′+xz+x′yz′A = xy' + xz + x'yz'

b) B(x,y,z)=Σ(0,2,6)B(x,y,z) = \Sigma(0,2,6)

       yz=00 01 11 10
x=0      1   0  0  1
x=1      0   0  0  1
  • m0,m2m_0, m_2 give x′z′x'z'; m2,m6m_2, m_6 give yz′yz'.
B=x′z′+yz′B = x'z' + yz'

PAL programming table (each OR gate has 3 AND inputs; 1 = true, 0 = complement, – = not connected):

Product termxyzOutput
1: xy′xy'10–A
2: xzxz1–1A
3: x′yz′x'yz'010A
4: x′z′x'z'0–0B
5: yz′yz'–10B
6: (unused)–––B
x y z --[prog. AND]-- P1,P2,P3 --[fixed OR]--> A
               \----- P4,P5,P6 --[fixed OR]--> B

The unused term 6 has all its fuses intact (both xx and x′x' connected) so it gives 0 and does not affect B.

  • 2076 Chaitra · 4 marks

Implement 1:16 demultiplexer using 1:2 demultiplexer.

Answer

A 1:16 demultiplexer sends one data input DD to one of 16 outputs chosen by 4 select lines S3S2S1S0S_3S_2S_1S_0. With 1:2 demultiplexers (one select line each) we build a tree of four levels.

Number of 1:2 DEMUXes: 1+2+4+8=151 + 2 + 4 + 8 = 15.

LevelDEMUXesSelect lineOutputs
11S3S_3 (MSB)2
22S2S_24
34S1S_18
48S0S_0 (LSB)16 (Y0Y_0–Y15Y_{15})
                         +-[1:2]-Y0,Y1
                +-[1:2]--+
                |        +-[1:2]-Y2,Y3
       +-[1:2]--+
       |        |        +-[1:2]-Y4,Y5
       |        +-[1:2]--+
       |                 +-[1:2]-Y6,Y7
D-[1:2]+
       |                 +-[1:2]-Y8,Y9
       |        +-[1:2]--+
       |        |        +-[1:2]-Y10,Y11
       +-[1:2]--+
                |        +-[1:2]-Y12,Y13
                +-[1:2]--+
                         +-[1:2]-Y14,Y15
   S3      S2       S1       S0

Working:

  1. The first DEMUX sends DD to its upper output if S3=0S_3 = 0 (towards Y0Y_0–Y7Y_7) or lower output if S3=1S_3 = 1 (towards Y8Y_8–Y15Y_{15}).
  2. Each level halves the group again using S2S_2, then S1S_1, then S0S_0.
  3. All DEMUXes at one level share the same select line.

Example: S3S2S1S0=1011S_3S_2S_1S_0 = 1011: level 1 goes to the lower half (8–15), level 2 (S2=0S_2=0) to 8–11, level 3 (S1=1S_1=1) to 10–11, level 4 (S0=1S_0=1) to Y11Y_{11}. So Y11=DY_{11} = D and all other outputs are 0.

  • 2076 Chaitra · 2+4 marks

Differentiate between RAM and ROM. Implement F1 = Σ(1,2,4,6) and F2 = Σm(0,2,3) using PROM.

Answer

RAM vs ROM

PointRAMROM
Full formRandom Access MemoryRead Only Memory
OperationRead and writeRead only (written once/rarely)
VolatilityVolatile: data lost on power offNon-volatile
UseTemporary data and running programsFixed programs (BIOS, firmware), tables
TypesSRAM, DRAMMask ROM, PROM, EPROM, EEPROM
SpeedFast read and writeFast read; writing slow or impossible

F1 = Σ(1,2,4,6) and F2 = Σ(0,2,3) using PROM

Three inputs (AA, BB, CC) and two outputs, so an 8 × 2 PROM is used: a fixed 3-to-8 decoder (AND array) produces all minterms m0m_0–m7m_7, and the programmable OR array connects the needed minterms to each output.

PROM truth table (contents):

Address ABCABCMintermF1F_1F2F_2
000m0m_001
001m1m_110
010m2m_211
011m3m_301
100m4m_410
101m5m_500
110m6m_610
111m7m_700

A 1 means the fuse/link between that minterm line and the OR gate is kept; a 0 means it is blown.

A B C
| | |
[3-to-8 decoder] (fixed AND array)
 m0 m1 m2 m3 m4 m5 m6 m7
 |  x  x  |  x  |  x  |   --> OR1 --> F1
 x  |  x  x  |  |  |  |   --> OR2 --> F2
 (x = intact link)
  • F1=m1+m2+m4+m6F_1 = m_1 + m_2 + m_4 + m_6
  • F2=m0+m2+m3F_2 = m_0 + m_2 + m_3

No simplification is needed with a PROM, because the decoder already gives every minterm.

  • 2076 Asoj

Define encoder. Design 4×16 Decoder using 2×4 Decoder only.

Answer

An encoder is a combinational circuit that does the reverse of a decoder: it has 2n2^n (or fewer) input lines and nn output lines, and gives the binary code of the input line that is active. Example: an 8-to-3 (octal-to-binary) encoder gives Y2Y1Y0=101Y_2Y_1Y_0 = 101 when input D5D_5 is high.

4×16 decoder using only 2×4 decoders

Inputs AA (MSB), BB, CC, DD (LSB). Each 2×4 decoder has an enable input EE. Five 2×4 decoders are needed, in two levels.

  • First level (1 decoder): inputs AA, BB. Its four outputs act as enables, selecting one of the second-level decoders.
  • Second level (4 decoders): inputs CC, DD in common. Only the enabled one gives an active output.
                       +-------+
            C,D ------>| 2x4 #1|--> Y0..Y3
                  +--->| E     |
                  |    +-------+
  +--------+  O0--+    +-------+
A-|  2x4   |  O1------>| 2x4 #2|--> Y4..Y7
B-|  (#0)  |  O2--+    +-------+
E-|        |  O3-+|    +-------+
  +--------+     |+--->| 2x4 #3|--> Y8..Y11
                 |     +-------+
                 |     +-------+
                 +---->| 2x4 #4|--> Y12..Y15
                       +-------+
 (C,D go to all four second-level decoders)
ABEnabled decoderOutputs active (by CD)
00#1Y0Y_0–Y3Y_3
01#2Y4Y_4–Y7Y_7
10#3Y8Y_8–Y11Y_{11}
11#4Y12Y_{12}–Y15Y_{15}

Example: ABCD=1101ABCD = 1101: decoder #0 makes O3 high, enabling #4; CD=01CD = 01 makes its second output high, so Y13=1Y_{13} = 1 (since 11012=131101_2 = 13).

  • 2076 Asoj

Write a short note on PLA.

Answer

A PLA (Programmable Logic Array) is a programmable logic device made of a programmable AND array followed by a programmable OR array. It implements several Boolean functions in sum-of-products (SOP) form.

Structure (n inputs, k product terms, m outputs):

inputs --[buffers: true and complement]
            |
   [ programmable AND array ] -> P1 ... Pk
            |
   [ programmable OR array ]  -> F1 ... Fm
            |
   [ XOR / inverter (optional) ] -> outputs
  • Each input is given in true and complemented form.
  • Each AND gate forms one product term by connecting chosen literals.
  • Each OR gate adds any chosen product terms. A product term can be shared by several outputs.
  • Size is given as n×k×mn \times k \times m, e.g. a 3 × 4 × 2 PLA.

Design steps:

  1. Simplify each function to minimum SOP (try both FF and F′F' to reduce product terms).
  2. Find the common product terms.
  3. Write the PLA programming table (inputs used, output connections, true/complement).

Example: F1=AB′+ACF_1 = AB' + AC, F2=AC+BCF_2 = AC + BC need only three product terms (AB′AB', ACAC, BCBC) since ACAC is shared.

Advantages: both arrays programmable, so very flexible; shares product terms; uses fewer terms than a PROM for functions with many inputs.

Disadvantages: two programmable arrays make it slower and costlier than a PAL; harder to manufacture.

  • 2075 Chaitra · 5 marks

Implement the following function using 8×1 MUX. F(A,B,C,D) = Σ(0,2,3,6,7,8,12,13,15)

Answer

Use A,B,CA, B, C as select lines (S2S1S0S_2S_1S_0) and DD (LSB) as the data variable. Input IiI_i corresponds to minterms 2i2i (with D=0D=0) and 2i+12i+1 (with D=1D=1).

Implementation table for F=Σ(0,2,3,6,7,8,12,13,15)F = \Sigma(0,2,3,6,7,8,12,13,15) (bold = minterm in F):

I0I_0I1I_1I2I_2I3I_3I4I_4I5I_5I6I_6I7I_7
D′D' row02468101214
DD row13579111315
InputD′D'101D′D'01DD

Rule: both circled gives 1, none gives 0, only the upper (D′D') row gives D′D', only the lower (DD) row gives DD.

Circuit:

D' --> I0 +--------+
1  --> I1 |        |
0  --> I2 |  8x1   |
1  --> I3 |  MUX   |--> F
D' --> I4 |        |
0  --> I5 |        |
1  --> I6 |        |
D  --> I7 +--------+
           S2 S1 S0
           A  B  C

Logic 1 is tied to VCCV_{CC}, logic 0 to ground, and a NOT gate gives D′D'.

Verification:

ABCDMintermSelected inputF
00000I0=D′=1I_0 = D' = 11
00011I0=D′=0I_0 = D' = 00
110113I6=1I_6 = 11
111014I7=D=0I_7 = D = 00
111115I7=D=1I_7 = D = 11

All agree with the given minterm list, so the function is realised with one 8×1 MUX and one inverter.

  • 2075 Chaitra · 1+4 marks

What is ROM? Implement given functions F1(A,B,C) = Σ(2,3,5,6) and F2(A,B,C) = Σ(0,1,5) using ROM.

Answer

ROM (Read Only Memory) is a non-volatile memory whose contents are fixed once programmed and can only be read in normal operation. As a logic device it is a fixed AND array (decoder) that generates all minterms of the address inputs, followed by a programmable OR array.

F1 = Σ(2,3,5,6), F2 = Σ(0,1,5) using ROM

Three inputs and two outputs, so an 8 × 2 ROM (3-to-8 decoder + 2 OR gates).

Address ABCABCMintermF1F_1F2F_2
000m0m_001
001m1m_101
010m2m_210
011m3m_310
100m4m_400
101m5m_511
110m6m_610
111m7m_700
F1=m2+m3+m5+m6,F2=m0+m1+m5F_1 = m_2 + m_3 + m_5 + m_6, \qquad F_2 = m_0 + m_1 + m_5
 A B C
 | | |
[3-to-8 decoder]
 m0 m1 m2 m3 m4 m5 m6 m7
  .  .  x  x  .  x  x  .  --> OR1 --> F1
  x  x  .  .  .  x  .  .  --> OR2 --> F2
 (x = connection kept, . = removed)

When an address is applied, the decoder makes one minterm line high; each output is 1 if that line is connected to its OR gate. Example: ABC=101ABC = 101 activates m5m_5, which is connected to both OR gates, so F1=F2=1F_1 = F_2 = 1.

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 ↗