Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

4 questions
1long12 marks

(a) Perform the following number system conversions, showing all steps: (i) Convert the decimal number (427.625)10(427.625)_{10} to its binary, octal and hexadecimal equivalents. (ii) Convert the hexadecimal number (2AF.C)16(2AF.C)_{16} to decimal. (6 marks)

(b) Differentiate between weighted and non-weighted codes with examples. Encode the decimal number (58)10(58)_{10} into BCD (8421), Excess-3 and Gray code, and explain one practical advantage of using Gray code in digital systems. (6 marks)

(a) Number System Conversions

(i) (427.625)10(427.625)_{10} to binary, octal, hexadecimal

Integer part 427 to binary (repeated division by 2, read remainders bottom-up):

DivisionQuotientRemainder
427/22131
213/21061
106/2530
53/2261
26/2130
13/261
6/230
3/211
1/201

So 427=(110101011)2427 = (110101011)_2.

Fraction 0.625 to binary (repeated multiplication by 2, read carries top-down): 0.625×2=1.25  (1),  0.25×2=0.5  (0),  0.5×2=1.0  (1)0.625\times2=1.25\;(1),\;0.25\times2=0.5\;(0),\;0.5\times2=1.0\;(1). So 0.625=(0.101)20.625=(0.101)_2.

(427.625)10=(110101011.101)2\boxed{(427.625)_{10}=(110101011.101)_2}

Octal — group binary in 3s from the binary point: 1106  1015  0113.1015\underbrace{110}_{6}\;\underbrace{101}_{5}\;\underbrace{011}_{3}.\underbrace{101}_{5}

=(653.5)8=(653.5)_8

Hexadecimal — group in 4s from the binary point (000110101011.10100001\,1010\,1011.1010): 000111010A1011B.1010A\underbrace{0001}_{1}\,\underbrace{1010}_{A}\,\underbrace{1011}_{B}.\underbrace{1010}_{A}

=(1AB.A)16=(1AB.A)_{16}

(ii) (2AF.C)16(2AF.C)_{16} to decimal

2×162+A×161+F×160+C×1612\times16^2+A\times16^1+F\times16^0+C\times16^{-1} =2(256)+10(16)+15(1)+12(0.0625)=512+160+15+0.75=2(256)+10(16)+15(1)+12(0.0625)=512+160+15+0.75 (2AF.C)16=(687.75)10\boxed{(2AF.C)_{16}=(687.75)_{10}}

(b) Weighted vs Non-weighted Codes

Weighted codesNon-weighted codes
Each bit position carries a fixed weight; value = sum of weighted bitsBits have no positional weight
e.g. BCD (8421), 2421, 5211e.g. Excess-3, Gray code

Encoding (58)10(58)_{10}:

  • BCD (8421): 5=0101,  8=10000101  10005=0101,\;8=1000 \Rightarrow 0101\;1000
  • Excess-3 (add 3 to each digit, then BCD): 5+3=8=1000,  8+3=11=10111000  10115+3=8=1000,\;8+3=11=1011 \Rightarrow 1000\;1011
  • Gray code of 58=(111010)258 = (111010)_2: MSB unchanged, then each Gray bit = XOR of adjacent binary bits: 1,  11=0,  11=0,  10=1,  01=1,  10=1(100111)Gray1,\;1\oplus1=0,\;1\oplus1=0,\;1\oplus0=1,\;0\oplus1=1,\;1\oplus0=1 \Rightarrow (100111)_{Gray}

Advantage of Gray code: Only one bit changes between successive values, so in applications like shaft/position encoders and asynchronous state transitions it eliminates spurious intermediate outputs (glitches/false codes) that occur when multiple bits change simultaneously.

number-systemscodesbcd
2long12 marks

(a) State and prove De Morgan's theorems for two variables. Hence simplify the Boolean expression F=(A+B)+(AC)F = \overline{(A + \overline{B})} + \overline{(\overline{A}\,C)} and implement it using only NAND gates. (5 marks)

(b) A logic function is given by F(A,B,C,D)=m(0,1,2,4,5,7,8,9,10,12,13,15)F(A,B,C,D) = \sum m(0,1,2,4,5,7,8,9,10,12,13,15). Simplify the function using a four-variable Karnaugh map, identify any don't-care groupings that arise, and draw the minimized logic circuit using basic gates. (7 marks)

(a) De Morgan's Theorems

Statement:

A+B=AˉBˉAB=Aˉ+Bˉ\overline{A+B}=\bar A\cdot\bar B \qquad \overline{A\cdot B}=\bar A+\bar B

Proof by truth table (for A+B=AˉBˉ\overline{A+B}=\bar A\bar B):

ABA+B\overline{A+B}AˉBˉ\bar A\bar B
0011
0100
1000
1100

Columns 3 and 4 are identical, so the identity holds. The second theorem is proved similarly (the truth tables of AB\overline{AB} and Aˉ+Bˉ\bar A+\bar B match).

Simplify F=(A+Bˉ)+(AˉC)F=\overline{(A+\bar B)}+\overline{(\bar A\,C)}:

Apply De Morgan to each term:

(A+Bˉ)=AˉB,(AˉC)=A+Cˉ\overline{(A+\bar B)}=\bar A\cdot B,\qquad \overline{(\bar A\,C)}=A+\bar C F=AˉB+A+CˉF=\bar A B + A + \bar C

Using the absorption identity A+AˉB=A+BA+\bar A B = A+B:

F=A+B+Cˉ\boxed{F=A+B+\bar C}

NAND-only implementation: A SOP/OR form is realized with NAND by double-inversion. Since F=A+B+Cˉ=AˉBˉCF=A+B+\bar C=\overline{\bar A\cdot\bar B\cdot C}, invert AA, BB (using NAND as inverters, inputs tied together) and use CC directly, then feed Aˉ,Bˉ,C\bar A,\bar B,C into one 3-input NAND gate whose output is FF. (An OR of three terms = NAND of their complements.)

(b) K-map for F=m(0,1,2,4,5,7,8,9,10,12,13,15)F=\sum m(0,1,2,4,5,7,8,9,10,12,13,15)

Four-variable map (rows ABAB, columns CDCD in Gray order 00,01,11,1000,01,11,10):

AB\CD00011110
001(0)1(1)1(3?)01(2)
011(4)1(5)1(7)0(6)
111(12)1(13)1(15)0(14)
101(8)1(9)0(11)1(10)

Minterm 3 is not present, so cell (00,11) = 0. Filling the 12 given minterms and grouping the 1s:

  • Group of 8 — column pairs CD=00CD=00 and CD=01CD=01 (i.e. Cˉ\bar C) covers 0,1,4,5,8,9,12,130,1,4,5,8,9,12,13 ⇒ term Cˉ\bar C.
  • Group of 4BDB\,D (cells 5,7,13,155,7,13,15) ⇒ term BDBD.
  • Group of 2 — minterms 22 and 1010 (BˉCˉD...\bar B\,\bar C\,D... ) actually 2,102,10 share B=0,C=0...B=0,C=0... ; minterm 2 =AˉBˉCDˉ=\bar A\bar B C\bar D, 10 =ABˉCDˉ=A\bar B C\bar D: common BˉCDˉ\bar B C\bar D ⇒ term BˉCDˉ\bar B C\bar D.
F=Cˉ+BD+BˉCDˉ\boxed{F=\bar C + BD + \bar B C\bar D}

(No don't-care cells were specified; all unlisted minterms are treated as 0.)

Circuit: one inverter for CC; one 2-input AND for BDBD; one 3-input AND for BˉCDˉ\bar B C\bar D; feed the three product terms into a 3-input OR gate to obtain FF.

boolean-algebrak-maplogic-minimization
3long16 marks

(a) Explain the difference between synchronous and asynchronous (ripple) counters, clearly discussing the propagation delay limitation of ripple counters. (4 marks)

(b) Design a synchronous MOD-6 counter that counts in the sequence 01234500 \rightarrow 1 \rightarrow 2 \rightarrow 3 \rightarrow 4 \rightarrow 5 \rightarrow 0 using JK flip-flops. Draw the state diagram, construct the excitation table, derive the simplified flip-flop input equations using K-maps, and draw the final circuit diagram. (12 marks)

(a) Synchronous vs Asynchronous (Ripple) Counters

Synchronous counterAsynchronous (ripple) counter
All flip-flops share the same clock, triggered simultaneouslyClock of each FF is driven by the output of the previous FF
Outputs change at the same instantOutputs change one after another (a "ripple")
Faster; no cumulative delaySlower; delay accumulates
More complex combinational logic on inputsSimpler hardware

Propagation-delay limitation of ripple counters: because each stage clocks the next, the change must ripple through every stage. With nn flip-flops each having delay tpdt_{pd}, the worst-case settling time is ntpdn\cdot t_{pd}. This (i) limits the maximum clock frequency to roughly fmax=1/(ntpd)f_{max}=1/(n\,t_{pd}) and (ii) produces transient false intermediate counts (decoding spikes) during the ripple interval. Synchronous counters avoid this since all FFs switch together.

(b) Synchronous MOD-6 Counter (0→1→2→3→4→5→0) using JK Flip-Flops

State diagram: a single directed loop 01234500\to1\to2\to3\to4\to5\to0. Three flip-flops QCQBQAQ_C Q_B Q_A are needed (23=862^3=8\ge6); states 6 and 7 are unused (don't-cares).

JK excitation table (Q→Q⁺ ⇒ J,K): 00:0,X0\to0:0,X; 01:1,X0\to1:1,X; 10:X,11\to0:X,1; 11:X,01\to1:X,0.

State / excitation table (QCQBQAQ_C Q_B Q_A, present → next):

Present QCQBQAQ_CQ_BQ_ANextJCKCJ_C K_CJBKBJ_B K_BJAKAJ_A K_A
0000010 X0 X1 X
0010100 X1 XX 1
0100110 XX 01 X
0111001 XX 1X 1
100101X 00 X1 X
101000X 10 XX 1
110X (unused)X XX XX X
111X (unused)X XX XX X

K-map simplification (using 110,111 as don't-cares):

  • JA=QˉC+QˉBJ_A = \bar Q_C + \bar Q_B? Check: JAJ_A must be 1 at states 000,010,100 (where QA=0Q_A=0 and we move to QA=1Q_A=1). JA=1J_A=1 at 000,010,100 ⇒ JA=QˉAJ_A=\bar Q_A region; minimal: JA=QCQBJ_A = \overline{Q_C Q_B} is not needed — simply   JA=1\;J_A=1 except at state 011/101 where QA=1Q_A=1. Taking QAQ_A=0 rows: 000,010,100 give JA=1J_A=1. So JA=QC+QB\boxed{J_A=\overline{Q_C}\,+\,\overline{Q_B}} covering 000,010,100 (and don't-care 110) ⇒ JA=QˉC+QˉBJ_A=\bar Q_C+\bar Q_B... evaluating, the clean minimal result is:
JA=QC+QB,KA=1J_A=\overline{Q_C}+\overline{Q_B},\quad K_A=1 JB=QAQC,KB=QAJ_B=Q_A\overline{Q_C},\quad K_B=Q_A JC=QAQB,KC=QAJ_C=Q_AQ_B,\quad K_C=Q_A

(Verification: at 011 → JC=QAQB=1J_C=Q_AQ_B=1 sets QCQ_C; KB=QA=1K_B=Q_A=1 resets QBQ_B; KA=1K_A=1 resets QAQ_A ⇒ next = 100 ✓. At 101 → KC=QA=1K_C=Q_A=1 resets QCQ_C, KA=1K_A=1 resets QAQ_A ⇒ 000 ✓.)

Final circuit: three JK flip-flops A,B,CA,B,C with a common clock. Wire JA=QˉC+QˉBJ_A=\bar Q_C+\bar Q_B (OR of inverted QC,QBQ_C,Q_B) and KA=1K_A=1 (tied high); JB=QAQˉCJ_B=Q_A\bar Q_C (AND of QAQ_A and QˉC\bar Q_C), KB=QAK_B=Q_A; JC=QAQBJ_C=Q_AQ_B (AND), KC=QAK_C=Q_A. Outputs QCQBQAQ_CQ_BQ_A give the 0–5 count.

sequential-circuit-designcountersflip-flops
4long12 marks

(a) Design a full adder using two half adders and additional gates. Write its truth table and derive the expressions for SUM and CARRY. (6 marks)

(b) Show how a 44-to-11 multiplexer can be used to implement the Boolean function F(A,B,C)=m(1,2,4,7)F(A,B,C) = \sum m(1,2,4,7) by treating AA and BB as select lines. Draw the implementation, clearly indicating the data input connections. (6 marks)

(a) Full Adder from Two Half Adders

Truth table (inputs A,B,CinA,B,C_{in}; outputs S,CoutS,C_{out}):

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

Expressions:

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

Realization with two half adders (HA):

  • HA-1 inputs A,BA,B → sum S1=ABS_1=A\oplus B, carry C1=ABC_1=AB.
  • HA-2 inputs S1,CinS_1,C_{in} → sum S=S1Cin=ABCinS=S_1\oplus C_{in}=A\oplus B\oplus C_{in}, carry C2=S1Cin=(AB)CinC_2=S_1\,C_{in}=(A\oplus B)C_{in}.
  • An OR gate combines the two carries: Cout=C1+C2=AB+(AB)CinC_{out}=C_1+C_2=AB+(A\oplus B)C_{in}.

(b) Implement F(A,B,C)=m(1,2,4,7)F(A,B,C)=\sum m(1,2,4,7) with a 4-to-1 MUX (A,B as select)

With A,BA,B as select lines (S1=A,S0=BS_1=A,\,S_0=B), the remaining variable CC (and constants) form the data inputs. Tabulate minterms grouped by ABAB:

ABAB (select)mintermsC=0C=0C=1C=1Data input IABI_{AB}
00m0,m1F=0F=1 (m1)I0=CI_0=C
01m2,m3F=1 (m2)F=0I1=CˉI_1=\bar C
10m4,m5F=1 (m4)F=0I2=CˉI_2=\bar C
11m6,m7F=0F=1 (m7)I3=CI_3=C

Data input connections:

I0=C,I1=Cˉ,I2=Cˉ,I3=CI_0=C,\quad I_1=\bar C,\quad I_2=\bar C,\quad I_3=C

Implementation: a 4:1 MUX with select S1=AS_1=A, S0=BS_0=B. Connect I0I_0 and I3I_3 to CC, and I1I_1 and I2I_2 to Cˉ\bar C (one inverter generates Cˉ\bar C). The MUX output Y=FY=F. This requires just the MUX plus one NOT gate.

combinational-circuitsaddersmultiplexer
B

Section B: Short Answer Questions

Attempt all / any as specified.

8 questions
5short6 marks

Perform the subtraction (35)10(52)10(35)_{10} - (52)_{10} using the 8-bit 2's complement method. Show the binary representation of each operand, the addition step, and interpret the final result including its sign.

(35)10(52)10(35)_{10}-(52)_{10} using 8-bit 2's complement

Operands in 8-bit binary:

  • +35=00100011+35 = 0010\,0011
  • +52=00110100+52 = 0011\,0100

2's complement of 52 (so we can add 52-52): invert 00110100110010110011\,0100 \to 1100\,1011, then add 1 → 110011001100\,1100. So 52=11001100-52 = 1100\,1100.

Addition 35+(52)35 + (-52):

  0010 0011   (+35)
+ 1100 1100   (-52)
-----------
  1110 1111   (no carry out of MSB)

Result =11101111= 1110\,1111.

Interpretation: MSB =1=1 ⇒ the result is negative. Take its 2's complement to read the magnitude: invert 11101111000100001110\,1111 \to 0001\,0000, add 1 → 00010001=170001\,0001 = 17.

(35)10(52)10=1710=111011112s comp\boxed{(35)_{10}-(52)_{10}=-17_{10}=1110\,1111_{\,2'\text{s comp}}}

There is no carry out of the MSB, which (together with operands of opposite sign) confirms there is no overflow and the result is valid.

number-systemssigned-arithmetic
6short6 marks

Explain the operation of a 3-to-8 line decoder. Draw its block diagram and truth table, and show how two such decoders together with an enable input can be combined to build a 4-to-16 line decoder.

3-to-8 Line Decoder

A decoder is a combinational circuit that converts an nn-bit binary code into one of 2n2^n unique output lines. A 3-to-8 decoder has 3 inputs (A2A1A0A_2A_1A_0) and 8 outputs (D0D_0D7D_7); for each input combination exactly one output is active (HIGH) — the one whose index equals the binary value of the input. Each output is a minterm: Di=miD_i=m_i.

Block diagram (described): a box with inputs A2,A1,A0A_2,A_1,A_0 and an enable EE on the left, and eight outputs D0D7D_0\ldots D_7 on the right.

Truth table (active-high, E=1E=1):

A2A_2A1A_1A0A_0Active output
000D0D_0
001D1D_1
010D2D_2
011D3D_3
100D4D_4
101D5D_5
110D6D_6
111D7D_7

Each output: Di=A2A1A0D_i=A_2'A_1'A_0'\ldots (the corresponding minterm), gated by EE.

Building a 4-to-16 Decoder from two 3-to-8 Decoders

Use the 4th (most-significant) input A3A_3 to enable one decoder at a time:

  • Feed A2A1A0A_2A_1A_0 to the address inputs of both decoders.
  • Connect A3A_3 through an inverter so that:
    • Decoder-0 is enabled when A3=0A_3=0 (its enable =Aˉ3=\bar A_3) → produces outputs D0D_0D7D_7.
    • Decoder-1 is enabled when A3=1A_3=1 (its enable =A3=A_3) → produces outputs D8D_8D15D_{15}.

Since only one decoder is enabled for a given A3A_3, exactly one of the 16 outputs is active for each 4-bit input, giving a complete 4-to-16 decoder.

decodersencoders
7short6 marks

Distinguish between a latch and a flip-flop. Explain the working of a JK flip-flop with its truth table, and describe how the race-around condition occurs and how a master-slave configuration eliminates it.

Latch vs Flip-Flop

LatchFlip-flop
Level-triggered (transparent while enable is active)Edge-triggered (responds only at clock edge)
Output follows input as long as enable is HIGHOutput changes only on rising/falling edge
Asynchronous / gated by an enable levelSynchronous, clocked
e.g. SR latch, gated D latche.g. JK, D, T flip-flops

JK Flip-Flop

The JK flip-flop removes the forbidden state of the SR flip-flop. With clock present:

JKQ+Q^{+}Action
00QQNo change (hold)
010Reset
101Set
11Qˉ\bar QToggle

Characteristic equation: Q+=JQˉ+KˉQQ^{+}=J\bar Q+\bar K Q.

Race-Around Condition

In a level-triggered JK flip-flop with J=K=1J=K=1, the output toggles. If the clock pulse width tpt_p is greater than the propagation delay tpdt_{pd}, the output toggles repeatedly (QQˉQQ\to\bar Q\to Q\ldots) while the clock is HIGH. At the end of the pulse the final state is uncertain. This uncontrolled multiple toggling is the race-around condition, and it occurs when tp>tpdt_p>t_{pd}.

Master-Slave Elimination

A master-slave configuration uses two JK flip-flops in cascade driven by complementary clocks:

  • The master is enabled when clock =1=1 and captures the inputs, but its output cannot reach the outside.
  • The slave is enabled when clock =0=0 and transfers the master's stored value to the output.

Because the master and slave are never transparent at the same time, the data is sampled once and transferred once per clock cycle. The output can change only on the clock edge, so toggling can happen at most once per cycle, eliminating the race-around condition.

flip-flopslatches
8short6 marks

Explain the operation of a 4-bit Serial-In Parallel-Out (SIPO) shift register with a neat diagram. Illustrate the contents of the register after each clock pulse when the serial input sequence 10111011 is applied (LSB first).

4-bit Serial-In Parallel-Out (SIPO) Shift Register

Structure: four D flip-flops Q3Q2Q1Q0Q_3Q_2Q_1Q_0 in cascade, all driven by a common clock. Serial data enters D0D_0 of the first flip-flop; each flip-flop's output feeds the next flip-flop's D input (D1=Q0,  D2=Q1,  D3=Q2D_1=Q_0,\;D_2=Q_1,\;D_3=Q_2). All four outputs Q3Q2Q1Q0Q_3Q_2Q_1Q_0 are read out in parallel. On each clock pulse the contents shift one position (here toward Q3Q_3) and the new serial bit enters at Q0Q_0.

Operation with serial input 10111011 applied LSB first (so the bits enter in time order 1,1,0,11,1,0,1). Register starts cleared at 00000000; bit shown entering at Q0Q_0, shifting left:

ClockSerial inQ3Q_3Q2Q_2Q1Q_1Q0Q_0
Initial0000
110001
210011
300110
411101

After 4 clock pulses the register holds Q3Q2Q1Q0=1101Q_3Q_2Q_1Q_0 = 1101, available in parallel. It takes n=4n=4 clocks to serially load an nn-bit SIPO register before the full word is read out.

registersshift-registers
9short6 marks

Differentiate between RAM and ROM. Briefly explain the internal organization of a ROM and show how a ROM can be used to implement the combinational functions F1=m(0,2,5,7)F_1 = \sum m(0,2,5,7) and F2=m(1,3,4,6)F_2 = \sum m(1,3,4,6) of two variables... (extend to three input variables) using a single ROM.

RAM vs ROM

RAMROM
Read and writePrimarily read-only (written once / at manufacture)
Volatile — loses data on power-offNon-volatile — retains data
Used for temporary working storageUsed for fixed programs/firmware, look-up tables
Types: SRAM, DRAMTypes: mask-ROM, PROM, EPROM, EEPROM

Internal Organization of a ROM

A ROM is essentially a programmable decoder + OR array. An nn-input ROM has a fixed nn-to-2n2^n decoder (a fixed/hardwired AND array generating all 2n2^n minterms) feeding a programmable OR array that produces the output bits. A ROM with nn address lines and mm data lines stores 2n×m2^n\times m bits; each output column is the OR of the minterms programmed for that function.

Implementing functions with one ROM

The functions are given for input variables (extended to three inputs A,B,CA,B,C, n=38n=3 \Rightarrow 8 words). The decoder generates minterms m0m_0m7m_7; we program two outputs F1,F2F_1,F_2:

F1=m(0,2,5,7),F2=m(1,3,4,6)F_1=\sum m(0,2,5,7),\qquad F_2=\sum m(1,3,4,6)

ROM truth table (program map):

Addr ABCABCmintermF1F_1F2F_2
000010
001101
010210
011301
100401
101510
110601
111710

The 3-to-8 decoder activates the addressed minterm line; the OR-array fuse is present at (mi,F1)(m_i,F_1) wherever the F1F_1 column is 1, and similarly for F2F_2. Here F1F_1 and F2F_2 happen to be complementary. Thus a single 8×28\times2 ROM implements both combinational functions: every minterm need only be routed to the correct output column.

memoryrompld
10short6 marks

Compare PROM, PLA and PAL in terms of the programmability of their AND and OR arrays. Draw the basic structure of a PLA and explain why it is more flexible than a PROM for implementing arbitrary sum-of-products functions.

PROM vs PLA vs PAL

All three are programmable logic devices built from an AND array (forms product terms) feeding an OR array (forms sums). They differ in which array is programmable:

DeviceAND arrayOR array
PROMFixed (full decoder — all 2n2^n minterms)Programmable
PLAProgrammableProgrammable
PALProgrammableFixed

Structure of a PLA

Described diagram: the nn inputs (and their complements) drive a programmable AND plane that generates a chosen set of product terms (not all minterms — only those needed). These product terms feed a programmable OR plane whose outputs are the sum-of-products functions. Programmable connection points (fuses/anti-fuses) exist at every cross-point of both planes.

Why a PLA is more flexible than a PROM

  • In a PROM the AND array is fixed and decodes all 2n2^n minterms; you can only choose how minterms are OR-ed. For functions of many variables this wastes a huge number of unused product lines (2n2^n grows exponentially).
  • In a PLA the AND plane is programmable, so you generate only the specific product terms your functions require, and product terms can be shared among several outputs. This makes the PLA far more area-efficient for arbitrary, sparse SOP functions of many input variables, whereas a PROM is practical only for small look-up-table-style functions.
pldplapal
11short6 marks

(a) Prove that the NAND gate is a universal gate by realizing the NOT, AND and OR functions using only NAND gates. (4 marks)

(b) Express the XOR function Y=ABY = A \oplus B using NAND gates only. (2 marks)

(a) NAND as a Universal Gate

A gate is universal if NOT, AND and OR can all be built from it; then any Boolean function is realizable. For a NAND, Y=ABY=\overline{A\cdot B}.

NOT: tie both inputs together — AA=Aˉ\overline{A\cdot A}=\bar A.

AND: NAND followed by a NAND-inverter — AB=AB\overline{\overline{A\cdot B}}=A\cdot B. (First NAND gives AB\overline{AB}, second NAND used as inverter gives ABAB.)

OR: invert each input with a NAND, then NAND the results — by De Morgan AˉBˉ=A+B\overline{\bar A\cdot\bar B}=A+B. So three NANDs: two as input inverters and one combining them.

Since NOT, AND, OR are all realized using only NAND gates, NAND is universal.

(b) XOR using NAND gates only

Y=AB=ABˉ+AˉBY=A\oplus B=A\bar B+\bar A B. A standard 4-NAND realization:

G1 = NAND(A, B)        = (AB)'
G2 = NAND(A, G1)       = (A·(AB)')'
G3 = NAND(B, G1)       = (B·(AB)')'
Y  = NAND(G2, G3)      = A ⊕ B

Thus Y=(AAB)(BAB)=ABY=\overline{\big(\,\overline{A\cdot\overline{AB}}\,\big)\cdot\big(\,\overline{B\cdot\overline{AB}}\,\big)}=A\oplus B, using only four 2-input NAND gates.

boolean-algebralogic-gates
12short4 marks

Design a 1-bit magnitude comparator that compares two bits AA and BB and produces three outputs indicating A>BA > B, A=BA = B and A<BA < B. Write the truth table and derive the output expressions.

1-bit Magnitude Comparator

Compare two bits AA and BB producing G  (A>B)G\;(A>B), E  (A=B)E\;(A=B), L  (A<B)L\;(A<B).

Truth table:

ABG(A>B)G\,(A{>}B)E(A=B)E\,(A{=}B)L(A<B)L\,(A{<}B)
00010
01001
10100
11010

Output expressions:

G=(A>B)=ABˉG=(A>B)=A\bar B L=(A<B)=AˉBL=(A<B)=\bar A B E=(A=B)=AB=AB+AˉBˉE=(A=B)=\overline{A\oplus B}=AB+\bar A\bar B

Implementation: GG uses one AND gate (AA and Bˉ\bar B); LL uses one AND gate (Aˉ\bar A and BB); EE is an XNOR of A,BA,B (equivalently E=G+LE=\overline{G+L}, i.e. a NOR of the other two outputs). Two inverters supply Aˉ,Bˉ\bar A,\bar B.

combinational-circuitscomparator

Frequently asked questions

Where can I find the BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) question paper 2078?
The full BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) 2078 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Digital Logic (IOE, EX 502) 2078 paper come with solutions?
Yes. Every question on this Digital Logic (IOE, EX 502) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) 2078 paper?
The BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) 2078 paper carries 80 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Digital Logic (IOE, EX 502) past paper free?
Yes — reading and attempting this Digital Logic (IOE, EX 502) past paper on Kekkei is completely free.