Digital Logic (EX 152) – Model Answers · Paper 4

Tribhuvan University, IOE · BE (BEI, BCT) · Year I / Part II · Regular (New Course – 2080 Batch) · 2081 Ashwin · Full Marks 60 · Pass 24 · 3 hrs

1. Merits and demerits of digital signal over analog signal [2]

Merits of digital signalsDemerits of digital signals
Immune to noise; signal can be regenerated without lossNeeds A/D and D/C conversion for real-world (analog) signals
Easy to store, copy and process (memory, computers)Quantization error; information lost between sample instants
Accuracy can be increased by adding bitsNeeds larger bandwidth for the same information
Error detection/correction and encryption are possibleSampling/conversion circuits add cost and delay
ICs are cheap, small, low power and easily reproducibleCannot represent a continuous signal exactly

2. Conversions [2×1.5]

(a) (6E.2C)16 = (?)8

Hex → binary (4 bits per digit): 6 = 0110, E = 1110, 2 = 0010, C = 1100 → 0110 1110 . 0010 1100.
Regroup in 3 bits: integer part (from the point to the left) 01 101 110 → 001 101 110 = 1 5 6; fraction part (from the point to the right) 001 011 00 → 001 011 000 = 1 3 0.

(6E.2C)16 = (156.13)8   (check: 6E = 110 = 1568; 0.2C = 44/256 = 0.171875 = 0.138)

(b) (10110110)Gray = (?)2

(10110110)Gray = (11011011)2

3. Simplest logic circuit for segment 'f' of BCD-to-seven-segment decoder [4]

Inputs: BCD digit ABCD (A = MSB). Segment f (upper-left bar) is ON for the digits 0, 4, 5, 6, 8, 9. Codes 10–15 never occur → don't care (X).

Fig: seven-segment display (a–g); segment f is the upper-left bar.

f = A + BC' + BD' + C'D'

Fig: logic circuit for segment f (NOT gates for C', D'; three 2-input ANDs; one 4-input OR).

4. Y(A,B,C) = Σm(0,2,3,5,7) with a single 4:1 MUX; combined half adder / half subtractor [4+3]

(i) Y using a 4:1 MUX

Use A and B as select lines (S1 = A, S0 = B); the data inputs are functions of C.

Fig: Y = Σm(0,2,3,5,7) with one 4:1 MUX; C' from a NOT gate; I1 tied to logic 1.

(ii) Half adder and half subtractor in one circuit

Half adder: Sum = A⊕B, Carry = AB. Half subtractor: Diff = A⊕B, Borrow = A'B. Sum and Diff are identical. Introduce a mode input M (M = 0 → adder, M = 1 → subtractor):

S/D = A ⊕ B  ,  C/Bo = (A ⊕ M)·B

For M = 0: A⊕0 = A → carry = AB. For M = 1: A⊕1 = A' → borrow = A'B.

Fig: combined half adder/subtractor – two XOR gates and one AND gate.

5. Synchronous mod-6 down counter using JK flip-flops [7]

Sequence (QCQBQA): 101 → 100 → 011 → 010 → 001 → 000 → 101 (5 down to 0, then back to 5). States 110, 111 unused (don't care). JK excitation: 0→0 (0,X); 0→1 (1,X); 1→0 (X,1); 1→1 (X,0).

K-maps (variables C, B, A):

JB = CA'

KB = A'

JC = B'A'

KC = A'

For FF-A: JA = 1 in all even states and KA = 1 in all odd states, the rest being don't care → JA = KA = 1 (toggles every clock).

JA = KA = 1;  JB = CA', KB = A';  JC = B'A', KC = A'

Fig: mod-6 synchronous down counter; NOT gate gives A' (used by all gates); common clock for all JK flip-flops.

Fig: timing diagram (positive-edge clock, count 5→4→3→2→1→0→5). The unused states 110 and 111 lead to valid states (110→001, 111→110→001), so the counter is self-correcting.

6. 4-bit SIPO shift register – input data 1011 [3+7]

Working: four D flip-flops (A, B, C, D) are connected in cascade (QA→DB, QB→DC, QC→DD) with a common clock. Serial data is applied to DA, one bit per clock pulse (MSB first: 1,0,1,1). On every positive clock edge each FF takes the value of the FF on its left, so data moves one position to the right. After four clock pulses the four bits are present simultaneously at the parallel outputs QAQBQCQD – serial-to-parallel conversion. All FFs are cleared before the first pulse.

Fig: 4-bit SIPO shift register (parallel outputs QA, QB, QC, QD).

After the 4th pulse: QDQCQBQA = 1011 – the first bit entered is at QD, the last at QA.

Fig: timing diagram for input 1011 (outputs change at the rising clock edge).

7. 3-bit up/down asynchronous counter, negative-edge triggered clock [3+3]

Principle: three JK (or T) flip-flops in toggle mode (J = K = 1) with negative-edge triggering. FF-A (LSB) receives the external clock. A flip-flop toggles when the previous stage output makes a 1 → 0 transition. Therefore:

A control input M (M = 1 → up, M = 0 → down) selects the source using AND–OR gates: CLKB = M·QA + M'·QA', CLKC = M·QB + M'·QB'.

Fig: 3-bit up/down ripple counter (FF clock inputs shown for the up mode, i.e. from Q; the two gate networks above select Q or Q' with M).

Fig: timing diagram – UP counting (M = 1): 000 → 111 → 000. Each output changes at the falling edge of the clock/previous output.

Fig: timing diagram – DOWN counting (M = 0): 000 → 111 → 110 → … → 000 (borrow from the 000 state sets the counter to 111).

8. Sequence detector for 101 using SR flip-flops (output Y = 1) [10]

Assumptions: Mealy machine with input X and output Y (called Z in the question), overlapping allowed (10101 gives two detections).

Step 1 – State diagram

S0: no progress. S1: last bit is 1. S2: last two bits are 10.

Fig: state diagram, edge label = X/Y. From S2, X = 1 completes 101 (Y = 1) and this last 1 starts a new sequence → S1.

Step 2 – State table (S0 = 00, S1 = 01, S2 = 10; A = MSB; 11 unused) with SR excitation

SR excitation: 0→0 (0,X); 0→1 (1,0); 1→0 (0,1); 1→1 (X,0).

Step 3 – K-maps (variables A, B, X)

SA = BX'

RA = A

SB = X

RB = BX'

Y = AX

SA = BX', RA = A, SB = X, RB = BX', Y = AX

Check: SARA = BX'A = 0 (state 11 unused) and SBRB = XBX' = 0 → the forbidden S=R=1 never occurs.

Step 4 – Circuit

Fig: 101 detector using two SR flip-flops (common clock); SB = X is connected directly; Y = AX from one AND gate.

Verification: input 1 0 1 from S0: X=1 → S1 (01); X=0 → SA = BX' = 1, RB = 1 → 10 (S2); X=1 → Y = AX = 1, RA = 1, SB = 1 → 01 (S1). ✓

9. Two-input TTL NOR gate; characteristics of CMOS family [5+2]

Fig: simplified 2-input TTL NOR gate. Q1A, Q1B: input transistors (inputs A, B); Q2A, Q2B: phase-splitter transistors connected in parallel (common collector and common emitter); Q3–D–Q4: totem-pole output; R1–R4: resistors; VCC = +5 V.

Operation

Because the Q2 transistors are in parallel, one input at 1 is enough to make the output 0: Y = (A + B)' (NOR).

Characteristics of CMOS family

10. Frequency measurement – functional diagram and operation [4]

The frequency of a periodic signal is the number of cycles per second. A digital frequency meter counts the input cycles N during an accurately known gate time T: f = N / T.

Unknown signal fx→Schmitt trigger
(pulse shaper)
→AND (gate)→Decade counters→Latch→BCD-to-7-segment decoder → Display
Crystal oscillator (e.g. 1 MHz)→Decade dividers→Gate control FF (T-FF) – gate time 1 s / 0.1 s / 10 ms→ gate signal to AND; strobe to latch; then reset to counters

Operation: (1) The input is squared by the Schmitt trigger, giving one clean pulse per cycle. (2) The crystal oscillator is divided down by decade dividers to obtain a stable pulse of, say, 1 s, which a flip-flop turns into the gate signal (T = 1 s). (3) While the gate is high, the AND gate passes the input pulses and the counter counts them. (4) When the gate goes low the counting stops, the count N is transferred to the latch (strobe pulse) and displayed; then a reset pulse clears the counter for the next measurement. (5) Example: N = 3250 pulses in T = 1 s → f = 3.25 kHz; with T = 0.1 s the count 325 represents 3.25 kHz (decimal point shifted). Accuracy is decided by the crystal stability and the ±1 count error, so longer gate times give higher resolution.