1. Design a counter with output sequence 14, 15, 0, 7, 8, 9, 5, 6 in a wrap around fashion with a modulo­16 counter and a minimal number of 4:1 multiplexers.

Current State
Next State
Q3
Q2
Q1
Q0
LOAD
Q3
Q2
Q1
Q0
0
0
0
0
1
0
1
1
1
0
0
0
1
X
X
X
X
X
0
0
1
0
X
X
X
X
X
0
0
1
1
X
X
X
X
X
0
1
0
0
X
X
X
X
X
0
1
0
1
0
X
X
X
X
0
1
1
0
1
1
1
1
0
0
1
1
1
0
X
X
X
X
1
0
0
0
0
X
X
X
X
1
0
0
1
1
0
1
0
1
1
0
1
0
X
X
X
X
X
1
0
1
1
X
X
X
X
X
1
1
0
0
X
X
X
X
X
1
1
0
1
X
X
X
X
X
1
1
1
0
0
X
X
X
X
1
1
1
1
0
X
X
X
X

2.A Full Subtracter inputs three bits: bit x, subtrahend y, borrow­in bit bin, and outputs two bits: difference d, borrow­out bit bout. Implement the Full Subtracter with a minimal two­level NAND gates.

x
y
bin
d
bout
0
0
0
0
0
0
0
1
1
1
0
1
0
1
1
0
1
1
0
1
1
0
0
1
0
1
0
1
0
0
1
1
0
0
0
1
1
1
1
1

3.Design a four­bit borrow­look­ahead subtracter with four Full Subtracters and a minimal network of AND, OR, NOT gates.

In general:

di = xi'yi'bi + xi'yibi' + xiyi'bi' + xiyibi

and

bi+1 = xi'yi + (xi' + yi)bi

Let Gi = xi'yi and Pi = xi' + yi

then

bi+1 = Gi + Pibi

solving for each bi

b1 = G0 + P0b0

b2 = G1 + P1b1 = G1 + P1(G0 + P0b0) = G1 + P1G0 + P1P0b0

b3 = G2 + P2b2 = G2 + P2(G1 + P1G0 + P1P0b0) = G2 + P2G1 + P2P1G0 + P2P1P0b0

b4 = G3 + P3b3 = G3 + P3(G2 + P2G1 + P2P1G0 + P2P1P0b0) = G3 + P3G2 + P3P2G1 + P3P2P1G0 + P3P2P1P0b0

Finally, using the subtractors from problem 2:

4.A serial subtracter inputs xi, yi, the i'th bit of two binary numbers in each clock cycle for i = 0 to n and outputs the difference. Implement the subtracter with a JK Flip­Flop and a minimal network of AND, OR, NOT gates.

x
y
bin
(Q)
d
bout
(Qnext)
J
K
0
0
0
0
0
0
X
0
0
1
1
1
X
0
0
1
0
1
1
1
X
0
1
1
0
1
X
0
1
0
0
1
0
0
X
1
0
1
0
0
X
1
1
1
0
0
0
0
X
1
1
1
1
1
X
0