About

Homework: Exercise 5

Theory: How to Approach These

Jump to: Q1 · Q2 · Q3 · Q4 · Q5


Homework Solutions

Exercise Q1

How many inputs does a decoder have if it has 64 outputs?

PartDetail
AsksFind the number of inputs nn of a decoder with 64 outputs.
Needsnn inputs give 2n2^n outputs, so n=log⁡2(outputs)n = \log_2(\text{outputs}).
Look at64 is a power of 2, so no rounding is needed.
If it changesNot a power of 2 (e.g. 10 outputs): round up, 24=16≥102^4 = 16 \ge 10 so 4 inputs.
Show solution ↓
Solution

How to solve

  1. A decoder activates one output per input pattern, so outputs =2n= 2^n.
  2. Solve 2n=642^n = 64 with a logarithm.
KnownRulen=log⁡2(…)n = \log_2(\ldots)Check

Sample answer

2n=64  ⇒  n=log⁡264=6.2^n = 64 \;\Rightarrow\; n = \log_2 64 = 6.

The decoder has 6 inputs (a 6-to-64 decoder). Check: 26=642^6 = 64 ✓.

Watch out: the count is the number of inputs, not outputs, and a non-power of 2 must be rounded up.

Exercise Q2

How many control lines does a multiplexer have if it has 32 inputs?

PartDetail
AsksFind the number of select (control) lines for 32 data inputs.
Needsss select lines choose one of 2s2^s inputs, so s=log⁡2(inputs)s = \log_2(\text{inputs}).
Look at“Inputs” means the data inputs; select lines are not counted.
If it changesOnly the number changes; non-powers of 2 round up.
Show solution ↓
Solution

How to solve

  1. Each select-line pattern picks one data input, so inputs =2s= 2^s.
  2. Solve 2s=322^s = 32.

Sample answer

s=log⁡232=5.s = \log_2 32 = 5.

The multiplexer has 5 control lines. Check: 25=322^5 = 32 ✓.

Watch out: do not count the select lines among the 32 inputs.

Exercise Q3

Analyze the following sequential circuit by determining the truth table.

JK flip-flop A and D flip-flop BJKQQ'JKDQQ'DXclockAB
Present StateInputNext State
ABXAB
000
001
010
011
100
101
110
111
PartDetail
AsksFor each of the 8 rows (A,B,X)(A, B, X), find A+A^+ and B+B^+ after the next clock pulse.
NeedsJK: 00 hold, 01 reset, 10 set, 11 toggle. D: Q+=DQ^+ = D. Use present values.
Look atNOR gets XX and AA and drives both JJ and KK; AND gets AA and Q′Q' of the D flip-flop (B′B').
If it changesOnly the input equations change; the row-by-row method stays.
Show solution ↓
Solution

How to solve

  1. Name the parts: AA is the JK flip-flop, BB the D flip-flop, XX the input.
  2. Write the input equations from the wires (below).
  3. Since JA=KAJ_A = K_A, AA toggles when (A+X)′=1(A+X)' = 1 and holds otherwise.
  4. Per row: compute A+XA + X, then J=KJ = K, then the JK action gives next AA; compute B′B', then DBD_B, which is next BB.
  5. Fill the two Next State columns; the working goes in the extra columns on the right.

Sample answer

From the wiring:

JA=KA=(A+X)′,DB=A⋅B′J_A = K_A = (A + X)', \qquad D_B = A \cdot B'
Present StateInputNext StateWorking
ABXABA+XA + XJA=KAJ_A = K_AJK actionB′B'DB=AB′D_B = AB'
0001001toggle10
0010010hold10
0101001toggle00
0110010hold00
1001110hold11
1011110hold11
1101010hold00
1111010hold00

Final table (rows ABXABX = 000 → 111): Next AA = 1, 0, 1, 0, 1, 1, 1, 1 and Next BB = 0, 0, 0, 0, 1, 1, 0, 0.

Behaviour: once A=1A = 1 it stays 1 and BB alternates (B+=B′B^+ = B' when A=1A=1). From A=0A = 0, X=0X = 0 sets AA to 1 and X=1X = 1 keeps it 0.

Watch out: never use the new AA to compute B+B^+; every right-hand side uses present values. Take B′B' from the D flip-flop’s Q′Q' output.

Exercise Q4

Complete the truth table for the following sequential circuit:

JK flip-flop A feeding D flip-flop B through an XORJKQQ'JKDQQ'DXYclockAB
InputPresentNext state
XYAAB
000
001
010
011
100
101
110
111
PartDetail
AsksFind A+A^+ and B+B^+ for every (X,Y,A)(X, Y, A).
NeedsJK rule, D rule, XOR (1 when inputs differ).
Look atX→JX \to J, Y→KY \to K; YY also goes through an inverter into the XOR with AA; XOR drives DD. Present BB is unused.
If it changesColumn order here is X,Y,AX, Y, A; copy the order of the table you are given.
Show solution ↓
Solution

How to solve

  1. Write the equations: JA=XJ_A = X, KA=YK_A = Y, DB=A⊕Y′D_B = A \oplus Y'.
  2. A+A^+: read XYXY as JKJK (00 hold, 01 reset, 10 set, 11 toggle).
  3. B+B^+: compute Y′Y', then A⊕Y′A \oplus Y' using the present AA.
  4. Fill the two Next state columns; the working goes in the extra columns on the right.

Sample answer

From the wiring:

JA=X,KA=Y,DB=A⊕Y′J_A = X, \qquad K_A = Y, \qquad D_B = A \oplus Y'
InputPresentNext stateWorking
XYAABJK actionY′Y'DB=A⊕Y′D_B = A \oplus Y'
0000100 hold10⊕1=10 \oplus 1 = 1
0011000 hold11⊕1=01 \oplus 1 = 0
0100001 reset00⊕0=00 \oplus 0 = 0
0110101 reset01⊕0=11 \oplus 0 = 1
1001110 set10⊕1=10 \oplus 1 = 1
1011010 set11⊕1=01 \oplus 1 = 0
1101011 toggle00⊕0=00 \oplus 0 = 0
1110111 toggle01⊕0=11 \oplus 0 = 1

Result (rows XYAXYA = 000 → 111): Next AA = 0, 1, 0, 0, 1, 1, 1, 0 and Next BB = 1, 0, 0, 1, 1, 0, 0, 1.

Check: B+=A′B^+ = A' when Y=0Y = 0 and B+=AB^+ = A when Y=1Y = 1 ✓.

Watch out: the XOR uses Y′Y', not YY, and the old AA, not A+A^+.

Exercise Q5

A Mux-Not flip-flop (MN flip-flop) behaves as follows: If M = 1, the flip-flop complements the current state. If M = 0, the next state of the flip-flop is equal to the value of N.

a) Derive the characteristic table for the flip-flop.

b) Show how a JK flip-flop can be converted to a MN flip-flop by adding gate(s) and inverter(s).

PartDetail
Asks(a) Table of Q(t+1)Q(t+1) for every M,NM, N. (b) The JJ, KK logic that makes a JK flip-flop act like it.
NeedsJK excitation table (change → J,KJ,K) and K-maps with don’t-cares.
Look atM=1M = 1: toggle (Q′Q'). M=0M = 0: copy NN.
If it changesAny conversion: new table → old excitation table → K-map per input → gates.
Show solution ↓
Solution

How to solve

  1. Build the table of the new flip-flop with QQ and Q+Q^+ (8 rows).
  2. For each row, write the J,KJ, K that cause Q→Q+Q \to Q^+: 0→0: J=0,K=dJ=0, K=d; 0→1: J=1,K=dJ=1, K=d; 1→0: J=d,K=1J=d, K=1; 1→1: J=d,K=0J=d, K=0.
  3. K-map each of JJ and KK (rows MM, columns NQNQ) and use the dd‘s to enlarge groups.
  4. Draw the gates in front of the JK flip-flop and verify with Q+=JQ′+K′QQ^+ = JQ' + K'Q.
MMNNQQQ+Q^+JJKK
000
001
010
011
100
101
110
111

Sample answer

(a) Characteristic table

MMNNQ(t+1)Q(t+1)
000
011
10Q(t)′Q(t)'
11Q(t)′Q(t)'

Equation: Q+=M′N+MQ′Q^+ = M'N + MQ'.

(b) Conversion

MMNNQQQ+Q^+JJKK
00000d
0010d1
01011d
0111d0
10011d
1010d1
11011d
1110d1

JJ (rows MM, columns NQNQ):

M\NQM \backslash NQ00011110
00dd1
11dd1

Bottom row gives MM, columns 11–10 give NN: J=M+NJ = M + N.

KK:

M\NQM \backslash NQ00011110
0d10d
1d11d

Bottom row gives MM, columns 00–01 give N′N': K=M+N′K = M + N'.

J=M+N,K=M+N′J = M + N, \qquad K = M + N'
JK flip-flop with J = M + N and K = M + N'JKQQ'JKNMclockN'J = M + NK = M + N'Q

Verify: Q+=(M+N)Q′+M′NQQ^+ = (M+N)Q' + M'NQ. For M=1M = 1: Q+=Q′Q^+ = Q' (toggle) ✓. For M=0M = 0: Q+=N(Q′+Q)=NQ^+ = N(Q' + Q) = N ✓.

Watch out: use the excitation table (change → inputs), not the characteristic table, and use a dd only when it enlarges a group.