You are on page 1of 32

Digital Systems Design Using VHDL 3rd

Edition Roth Solutions Manual


Visit to download the full and correct content document: https://testbankdeal.com/dow
nload/digital-systems-design-using-vhdl-3rd-edition-roth-solutions-manual/
Chapter 6 Solutions
6.1 (a) 4 Cells, if N is used as the clock enable. When N = 1 then
X0+ = S' D0 + S X1 (3 variable function) (two 3 variable functions
X1+ = S' D1 + S X2 (3 variable function) will fit into one cell)
If the clock enable is not used each bit requires a separate cell: 8 cells total.
X0+ = N S' D0 + N S X1 + N' X0 (5 variable function)

(b)

(c) X function generator output = X0+ = S' D0 + S X1


Y function generator output = X1+ = S' D1 + S X2

6.2 (a) QA0+ = En (Ld U + Ld' QA0') + En' QA0 = En (X) + En' QA0
QA1+ = En (Ld V + Ld' (QA0 ⊕ QA1) + En' QA1 = En (Y) + En' QA1

(b)

X = Ld U + Ld' QA0'
Y = Ld V + Ld' (QA0 ⊕ QA1)

6.3 (a) Q2+ = EN' Q2 + EN (Ld D2 + Ld' Q3)


Q1+ = EN' Q1 + EN (Ld D1 + Ld' Q2)
Q0+ = EN' Q0 + EN (Ld D0 + Ld' Q1)

(b) Two cells

133
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(c) Y = Ld D3 + Ld' Si
X = Ld D2 + Ld' Q3

6.4 (a) The next state equation of Q1 can be implemented using the X function generator with the inputs
R, S, Q1, and Q2. The next state equation of Q2 can be implemented using the Y function
generator with the inputs T, Q1, and Q2. The output P can be implemented using the Z function
generator with the inputs T (C input) and the X function generator.

(b)

6.5 (a) M = S2'S1'S0'I0 + S2'S1'S0I1 + S2'S1S0'I2 + S2'S1S0I3 + S2S1'S0'I4 + S2S1'S0I5 + S2S1S0'I6 + S2S1S0I7

The 8-to-1 MUX can be decomposed into seven 2-to-1 MUXes, and implemented in four Figure
6-1(a) logic blocks.

M = S2'MX + S2MY
Mx = S1'M1 + S1M2
MY = S1’M3 + S1M4
M1 = S0'I0 + S0I1
M2 = S0'I2 + S0I3
M3 = S0'I4 + S0I5
M4 = S0'I6 + S0I7

134
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The X and Y functions for each block each implement one 2-to-1 mux as labeled:

(b) Three 2-to-1 MUXes (or a 4-to-1 mux) can be implemented in each Figure 6-3 logic block. In
total, three blocks are required to implement seven 2-to-1 MUXes. The X, Y, and Z function
generators for each block implement a 2-to-1 MUX as labeled:

135
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(c) Each function generator used implements a 2-to-1 mux, and has the same LUT contents:
0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1

(d) Each function generator used implements a 2-to-1 mux


X and Y LUT4s have 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1
Z LUT3s have 0, 0, 1, 1, 0, 1, 0, 1 (Consider C as MSB, Y as LSB)

6.6 (a) library IEEE;


use IEEE.numeric_bit.all;

entity Figure6_1a is
port(X_in, Y_in: in unsigned(1 to 4);
clk, CE: in bit;
Qx, Qy: out bit;
X, Y: inout bit;
XLUT, YLUT: in unsigned(0 to 15));
end Figure6_1a;

architecture internal of Figure6_1a is


signal X_Index, Y_Index: unsigned(1 to 4);
begin
X_Index <= X_in(4) & X_in(3) & X_in(2) & X_in(1);
Y_Index <= Y_in(4) & Y_in(3) & Y_in(2) & Y_in(1);
X <= XLUT(to_integer(X_Index));
Y <= YLUT(to_integer(Y_Index));

process(clk)
begin
if clk = '1' and clk'event then

136
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
if CE = '1' then
Qx <= X; Qy <= Y;
end if;
end if;
end process;
end internal;

(b) library IEEE;


use IEEE.numeric_bit.all;

entity LUT_Mux is
port(I0, I1, I2, I3, S0, S1: in bit;
M: out bit);
end LUT_Mux;

architecture internal of LUT_Mux is


component Figure6_1a is
port(X_in, Y_in: in unsigned(1 to 4);
clk, CE: in bit;
Qx, Qy: out bit;
X, Y: inout bit;
XLUT, YLUT: in unsigned(0 to 15));
end component;
signal in1, in2, in3: unsigned(1 to 4);
signal M1, M2, Mout: bit;
begin
in1 <= I0 & I1 & S0 & '0';
in2 <= I2 & I3 & S0 & '0';
in3 <= M1 & M2 & S1 & '0';
M <= Mout;

B0: Figure6_1a port map (in1, in2, '0', '0', open, open, M1, M2,
"0101001101010011", "0101001101010011");
B1: Figure6_1a port map (in3, "0000", '0', '0', open, open, Mout,
open,
"0101001101010011", "0000000000000000");
end internal;

6.7 (a) library IEEE;


use IEEE.numeric_bit.all;

entity Figure6_3 is
port(X_in, Y_in: in unsigned(1 to 4);
clk, CE, C: in bit;
Qx, Qy: out bit;
X, Y: inout bit;
XLUT, YLUT: in unsigned(0 to 15);
ZLUT: in unsigned(0 to 7);
SA, SB, SC, SD: in bit);
end Figure6_3;

architecture internal of Figure6_3 is


signal X_Index, Y_Index: unsigned(1 to 4);
signal Z_Index: unsigned(1 to 3);
signal X_int, Y_int, Z_int: bit;
signal MuxA, MuxB, MuxC, MuxD: bit;
begin
X_Index <= X_in(4) & X_in(3) & X_in(2) & X_in(1);
Y_Index <= Y_in(4) & Y_in(3) & Y_in(2) & Y_in(1);
Z_Index <= Y_int & X_int & C;
X_int <= XLUT(to_integer(X_Index));
Y_int <= YLUT(to_integer(Y_Index));

137
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Z_int <= ZLUT(to_integer(Z_Index));

MuxA <= X_int when SA = '0' else Z_Int;


MuxB <= X_int when SB = '0' else Z_Int;
MuxC <= Y_int when SC = '0' else Z_Int;
MuxD <= Y_Int when Sd = '0' else Z_Int;

X <= MuxB;
Y <= MuxD;

process(clk)
begin
if clk = '1' and clk'event then
if CE = '1' then
Qx <= MuxA; Qy <= MuxC;
end if;
end if;
end process;
end internal;

(b) library IEEE;


use IEEE.numeric_bit.all;

entity Code_Converter is
port(X, clk: in bit;
Z: out bit);
end Code_Converter;

architecture internal of Code_Converter is


component Figure6_3 is
port(X_in, Y_in: in unsigned(1 to 4);
clk, CE, C: in bit;
Qx, Qy: out bit;
X, Y: inout bit;
XLUT, YLUT: in unsigned(0 to 15);
ZLUT: in unsigned(0 to 7);
SA, SB, SC, SD: in bit);
end component;
signal Q1, Q2, Q3, Zout: bit;
signal input: unsigned(3 downto 0);
begin
input <= X & Q1 & Q2 & Q3;
Z <= Zout;

B0: Figure6_3 port map(input, input, clk, '1', '0', Q3, Q2, open,
open,
"0001111111000000", "0110000001000000",
"00000000", '0', '0', '0', '0');
B1: Figure6_3 port map(input, input, clk, '1', '0', Q1, open, open,
Zout,
"1010001110000000", "1010010110011000",
"00000000", '0', '0', '0', '0');
end internal;

6.8 (a) A 4-to-16 decoder requires 16 outputs, and each function needs no more than 4-variables. 8
Figure 6-1 (a) logic blocks are required.

(b) X-Function LUT: 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0


Y-Function LUT: 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

138
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.9 (a) 4 logic blocks are required, 8 LUT4’s (See Figure 3-6 for truth table).
a = n7 + n6 + n5 +n4
b1 = n5'n4' (n3 + n2)
b = n7 + n6 + b1
c1 = n5 + n4'n3 + n4'n2'n1
c = n7 + n6'c1
d1 = n3 + n2 + n1 + n0
d2 = n7 + n6 + n5 + n4
d = d2 + d1

(b) F = a, X3 = n7, X2 = n6, X1 = n5, X0 = n4 G = b1, Y3 = n5, Y2 = n4, Y1 = n3, Y0 = n2


X3 X2 X1 X0 F Y3 Y2 Y1 Y0 G
0 0 0 0 0 0 0 0 0 1
0 0 0 1 1 0 0 0 1 1
0 0 1 0 1 0 0 1 0 1
0 0 1 1 1 0 0 1 1 1
0 1 0 0 1 0 1 0 0 0
0 1 0 1 1 0 1 0 1 0
0 1 1 0 1 0 1 1 0 0
0 1 1 1 1 0 1 1 1 0
1 0 0 0 1 1 0 0 0 0
1 0 0 1 1 1 0 0 1 0
1 0 1 0 1 1 0 1 0 0
1 0 1 1 1 1 0 1 1 0
1 1 0 0 1 1 1 0 0 0
1 1 0 1 1 1 1 0 1 0
1 1 1 0 1 1 1 1 0 0
1 1 1 1 1 1 1 1 1 0

6.10 (a) F1 = W+X’Z +WY+WZ’+X’Z’


-- X’Z + X’Z’ = X’
--W + WY + WZ’ = W
Thus: F1 = W + X’
We need one LUT3 to implement the function.

(b)
X3 X2 X1(W) X0(X) F1
0 0 0 0 1
0 0 0 1 0
0 0 1 0 1
0 0 1 1 1
0 1 0 0 1
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1

139
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.11 (a)

(b) FX = AB′CD + A′BC + ACD′


(c) FY = AB′CD + A′BC + BDE
(d) & (e)
A B C D FX FY
0 0 0 0 0 0
0 0 0 1 0 0
0 0 1 0 0 0
0 0 1 1 0 0
0 1 0 0 0 0
0 1 0 1 0 1
0 1 1 0 1 1
0 1 1 1 1 1
1 0 0 0 0 0
1 0 0 1 0 0
1 0 1 0 1 0
1 0 1 1 0 1
1 1 0 0 0 0
1 1 0 1 0 1
1 1 1 0 1 0
1 1 1 1 0 1

6.12 (a)

(b) X function generator: Q+ = PQ+M


(c) Y function generator: F2 = P + PM + QNS = P + QNS
(d) Z function generator:

140
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
F1 = P′M′N+MN′+ PQN′+M′Q′N
= M′N(P′+Q′) + N′(M + PQ)
= (N + M+PQ)(N′ + M′(P′+Q′))′′
= (N + M+PQ)(N(M+PQ)) ′

6.13 (a)

(b) X function generator: F2 = P+RS


(c) Y function generator: Q+ = PQ+RS
(d) Z function generator:
F1 = P′R′N+RSN′+ PN′+P′S′N
= NP′(R′+ S′) + N′(RS+ P)
= (NP′(R′+ S′))′′ + N′(RS+ P)
= (N′+P+RS)′ + N′(RS+ P)

6.14

LUT5 on top implements A′BC′D′E + A′BC′E′ + ABCDE


LUT5 on bottom implements AB′CD′E′ + B′C′E′ + ABCDE

141
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.15

LUT5 on top implements P′QR′SU + PQ + RSU + R′U′


LUT5 on bottom implements PQ + QR + S + U

6.16 Expanding F around X6 results in 4 variable functions which can be realized using one function
generator each.

F = X6 (X1' X2 X3 + X2 X3' X4' + X2 X3 X4') + X6' (X2' X3' X4 + X2 X3' X4' + X3' X4 X5) + X7
F = X6 (F1) + X6' (F2) + X7

For block one: X LUT has inputs X1, X2, X3, and X4 and realizes F1 = X1' X2 X3 + X2 X3' X4' + X2 X3
X4'.
Y LUT has inputs X2, X3, X4, and X5 and realizes F2 = X2' X3' X4 + X2 X3' X4' + X3' X4 X5

For block two: X LUT has the outputs of block one’s X LUT (F1) and Y LUT (F2), X6, and X7 as
inputs. The X LUT realizes F = X6 (F1) + X6' (G1) + X7. The Y LUT is unused.

6.17 Expanding Q+ around U Q results in 4 variable equations which can be realized using one function
generator each.

Q+ = U Q (V' W + X' Y + V W') + U' Q' (V X' Y' + V' Y + X Y + V' X)


Q+ = U Q (Xfunc) + U' Q'(Yfunc)

Mark connections in a manner similar to Problem 6.1’s solution.

For block one: X LUT has inputs V, W, X, and Y and realizes V' W + X' Y + V W'
Y LUT has inputs V, X, and Y and realizes V X' Y' + V' Y + X Y + V' X

For block two: X LUT has U, Q, and block one’s Xfunc and Yfunc as inputs and realizes
Q+ = U Q (Xfunc) + U' Q'(Yfunc)

6.18 One cell. Expanding around X5 results in 4 variable equations which can be realized using one
function generator each and X5 can be used as the C input.

X = X5 (X1' X2' X3' X4' + X1 X2 X3 X4) + X5' (X6 X7' X8' X9 + X6' X7 X8 X9')
Xfunc = (X1' X2' X3' X4' + X1 X2 X3 X4)
Yfunc = (X6 X7' X8' X9 + X6' X7 X8 X9')
Zfunc = X5 (Xfunc) + X5' (Yfunc)

142
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.19 (a) Expanding Z around Y results in 4 variable equations which can be realized using one function
generator each.
Z = Y (V W' X + U' V' W) + Y' (V W' X + T V' W)
Z = Zfunc = Y (Xfunc) + Y' (Yfunc)

Implement internal logic cell connections in a manner similar to Problem 6.12 Solution with U,
V, W, and X as inputs to the X-function generator, T, V, W, and X as inputs to the Y-function
generator and Y as the C input.

(b) The original equation can be implemented as follows:

Block 1: X-LUT has inputs U, V, W, X and realizes V W' X + U' V' W


Y-LUT has inputs T, V, W, X and realizes V W' X + T V' W

Block 2: X-LUT has Y and Block 1’s Xfunc and Yfunc as inputs and realizes Z = Y (Xfunc) + Y'
(Yfunc)
Y-LUT is unused

6.20 Y = a'b'Y00 + a'bY01 + ab'Y10 + abY11

Y00 = Ya=0,b=0 = cde'f + c'def


Y01 = Ya=0,b=1 = cde'f + cdef ' + c'de'f
Y10 = Ya=1,b=0 = cde'f + cd 'ef '
Y11 = Ya=1,b=1 = cde + cde'f + cdef ' + cd 'e'f

143
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.21 Y = e'f ' Y00 + e'f Y01 + ef ' Y10 + efY11

Y00 = 0
Y01 = abcd
Y10 = a' bc'd ' + b'c'
Y11 = ab'cd + a'bc'd'

6.22 (a) Y = a' (bc'd'e + b'c'e) + a (b'cd'e + b'c'e + bcde) = a' (Y1) + a (Y2)
Y1 = bc'd'e + b'c'e
Y2 = b'cd'e + b'c'e + bcde

144
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(b)

(c)
bcde Y1 (Xfunc) Y2 (Yfunc)
0000 0 0
0001 1 1
0010 0 0
0011 1 1
0100 0 0
0101 0 1
0110 0 0
0111 0 0
1000 0 0
1001 1 0
1010 0 0
1011 0 0
1100 0 0
1101 0 0
1110 0 0
1111 0 1

a Xfunc Yfunc Zfunc


000 0
001 0
010 1
011 1
100 0
101 1
110 0
111 1

6.23 (a) Eight LUTs are required. Each bit of the adder requires one LUT to generate the sum and one
LUT to generate the carry-out.

(b) Four LUT4s are required. Each bit of the adder requires one LUT4 to generate the sum.
Dedicated carry chain logic generates the carry-out.

145
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(c) When Su is 1, the circuit should add a to the 2’s complement of b by inverting each bit of b and
setting bit 0’s Cin to.

Each bit will have the same output function:

Su ai bi Cin Outi
0 0 0 0 0
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0

Outi = Su'ai'bi'Cin + Su'ai'biCin' + Su'aibi'Cin' + Su'aibiCin + Suai'bi'Cin' + Suai'biCin + Suaibi'Cin +


SuaibiCin'

146
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
147
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.24 (a) 14 cells total.

(b) 14 cells total: 6 for adders and 8 for AND gates but propagation delay is less.

6.25 (a) Z = A'(BC 'D ' EF ' + B'C 'E ' F + BC ' E ' F ') + A(B'CD ' E ' F + B'C ' E ' F + BCDE)
Z = A'(Z0) + A(Z1)

Z0 = D'(Y00) + D(Y01)
Y00 = BC ' EF ' + B'C ' E ' F + BC ' E ' F
Y01 = B'C ' E ' F + BC ' E ' F '

Z1 = D'(Y10) + D(Y11)
Y10 = B'C ' E ' F + B'CE ' F
Y11 = B'C ' E ' F + BCE

148
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(b)

149
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.26 F = X6 (X1' X2 X3' X4 + X2' X4' + X3 X4 X5 + X1 X3) + X6' (X2' X3' X4 + X2 X4 + X3' X4 + X1 X3)

6.27 To realize the next-state equations, we need to use at least four Kintex logic slices (Figure 6-13).
One Kintex logic slice is ¼ CLB. Therefore, only 1 CLB is needed.

150
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.28

6.29 (a) No solution available

(b)

151
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(c)

(d)

6.30 The sequential circuit requires 3 Virtex slices. For the first slice, the G inputs are Q2, C, D, and E (G
= Q2' C D E). The F inputs are Q2, A, B, and C (F = Q2 A B C). The BX input is Q1. Then the X flip-
flop implements the Q1 flip-flop. Also, if the FXA input is 1, the FXB input is 0, and the BY input is
Q1, then the Y flip-flop implements Q2. For the second slice, the G inputs are Q2, A, and B (G = Q2'
A B + Q2' A' B'). The F inputs are Q2, A, B, and C (F = Q2' A B' + Q2 (A' + B + C)). The BX input is
Q1. Then the output to the F5 MUX implements Z1. For the third slice, the G inputs are Q1, Q2, A,
and B (G = Q1 A' + Q1 B + Q2'). Then the Y combinational output implements Z2.

6.31 The sequential circuit requires 2 Xilinx slices. For the first slice, D1-D5 inputs are Q1,Q2,A,B,C and
D6 is 1. O5 is read from AQ with first output. O6 is read from AMUX with second output. For the
second slice, D1-D5 takes input Q1,Q2,A,B,C. D6 is 1. O5 is read from A as Z1 and O6 is read from
AMUX combinational as Z2.

6.32 The circuit can be implemented using 2 Logic Modules. In the first LM, the common 4 inputs are
Q1,Q2,A,B. Each of the 2 inputs to the LUT's are C,0. XQ will hold Q1. This Q1 is latched onto YQ
giving Q2+. Y will hold Z1. In the second LM, only the first LUT is used with inputs Q1,A,B and
Z2 is read from X.

152
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.33 The possible functions are bolded below:
i) All 32-variable functions
ii) Some 32-variable functions
iii) All 8-variable functions
iv) Some 8-variable functions
v) All 7-variable functions
vi) Some 7-variable functions
vii) All 6-variable functions
viii) Some 6-variable functions
ix) All 36-variable functions
x) Some 36-variable functions
xi) All 39-variable functions
xii) Some 39-variable functions

6.34 (a) No solution provided

(b) No solution provided

6.35

153
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.36 (a)

(b) library IEEE;


use IEEE.numeric_bit.all;

entity P6_24b is
port(A: in unsigned(15 downto 0);
N: in integer range 0 to 15;
A_Shft: out unsigned(15 downto 0));
end P6_24b;

architecture internal of P6_24b is


signal decoder_out: unsigned(15 downto 0);
signal mplier_out: unsigned(31 downto 0);
begin
decoder_out <= "0000000000000001" sll N;
mplier_out <= A * decoder_out;
A_shft <= mplier_out(15 downto 0);
end internal;

(c)

library IEEE;
use IEEE.numeric_bit.all;

entity P6_24c is
port(A: in unsigned(15 downto 0);
N: in integer range 0 to 15;
A_Shft: out unsigned(15 downto 0));
end P6_24c;

architecture internal of P6_24c is


signal decoder_out: unsigned(15 downto 0);
signal mplier_out: unsigned(31 downto 0);
begin
decoder_out <= "0000000000000001" sll (15 - N);

154
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
mplier_out <= A * decoder_out;
A_shft <= mplier_out(30 downto 15);
end internal;

6.37 S0: Q0Q1Q2Q3 = 1000, S1: 0100, S2: 0010, S3: 0001

Q0+ = St'Q0 + Q3
Q1+ = StQ0 + K 'M 'Q1 + K 'Q2
Q2+ = MQ1
Q3+ = KM 'Q1 + KQ2
Load = StQ0
Done = Q3
Sh = M'Q1 + Q2
Ad = MQ1

6.38 S0: Q0Q1Q2Q3Q4Q5Q6 = 1000000, S1: 0100000, S2: 0010000, S3: 0001000, S4: 0000100, S5:
0000010,
S6: 0000001

Q0+ = St'Q0 + CQ4 + C 'Q6


Q1+ = StQ0
Q 2+ = Q 1
Q 3+ = Q 2
Q 4+ = Q 3
Q5+ = C 'Q4 + K 'C 'Q5 + CQ5
Q6+ = KC 'Q5 + CQ6
Rdy = Q0
Ldu = StQ0
Lds = StQ0
Ldl = Q1
Ldd = Q2
Sh = Q3 + C 'Q4 + C 'Q5
Su = CQ5 + CQ6
V = CQ4
Cm1 = C 'QnegQ6

For S0 = 0000000, change all instances of Q0 in above equations to Q0':


Q0+ = St' Q0' + CQ4 + C 'Q6
Q1+ = StQ0'
Rdy = Q0'
Ldu = StQ0'
Lds = StQ0'
All other equations unchanged

6.39 S0: Q3Q2Q1Q0 = 0000, S1: 1100, S2: 1010, S3: 1001

To create a one-hot encoding, if Q3 is 0 in the reset state it must be 1 in all other states.

6.40 (a) Q0+ = X2 Q1 + X4 Q3 Z1 = Q0 + Q2


Q 1+ = X 1 Q 0 Z2 = Q1 + Q3
Q 2+ = X 1 ' Q 0 + X 2 ' Q 1 + X 3 ' Q 2 + X 4' Q 3
Q 3+ = X 3 Q 2

155
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
(b) 5 Total:
1 Slice: Q0 (one LUT4 and FF), Q1 (one LUT4 and FF)
2.5 Slices: Q2: (each AND term in one half-slice, one half-slice combines 4 product terms, one
FF)
1 Slice: Q3 (one LUT4 and FF), Z1 (one LUT4)
½ Slice: Z2 (one LUT4)

6.41 To ensure proper synthesis, amend the code for Figure 4-15 as follows:
- Within the first process, ensure that all If-Then statements include an Else portion.

6.42 Using the Xilinx ISE, targeted for a Spartan 3 FPGA:

Settings Figure 4-35 Figure 4-40


Goal: Speed 25 Slices 13 Slices
FSM Encoding: Auto 11 Flip-Flops 14 Flip-Flops
47 LUT4s 24 LUT4s
Max Speed: 188.656 MHz Max Speed: 194.714MHz
Goal: Area 25 Slices 13 Slices
FSM Encoding: Auto 18 Flip-Flops 21 Flip-Flops
45 LUT4s 23 LUT4s
Max Speed: 146.307MHz Max Speed: 110.252MHz
Goal: Area 25 Slices 13 Slices
FSM Encoding: One-Hot 18 Flip-Flops 21 Flip-Flops
45 LUT4s 23 LUT4s
Max Speed: 146.307MHz Max Speed: 110.252MHz
Goal: Area 25 Slices 13 Slices
FSM Encoding: Compact 18 Flip-Flops 21 Flip-Flops
45 LUT5s 23 LUT4s
Max Speed: 146.307MHz Max Speed: 110.252MHz

Figure 4-40 uses fewer resources then Figure 4-35, and each synthesis option uses about the same
amount of resources. The solution to this problem may change depending on what synthesis tool
and target device is used.

6.43 (a) A 4-to-1 mux for each bit of b:

(b) Gate network:

156
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A1 A0 B1 B0
0 0 1 1
0 1 1 0
1 0 0 1
1 1 0 1

By inspection, B1 = A1' and B0 = A1 + A0'

6.44 (a) Arithmetic Right Shift register:

(b)

C1 C0 D1 D0
0 0 1 1
0 1 1 0
1 0 0 0
1 1 - -

D0 = C1'C0'
D1 = C1'

(c)

157
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.45 (a) Naïve implementation uses an 8-to-1 mux, 3 inverters (for not A), a 3-bit adder, and a 3-bit
register. The arithmetic right shift can be accomplished by feeding in C2C2C1.

An alternate implementation is possible if Co, Ad, and Sh will not become active at the same
time: use 3 tri-state buffers with tri-state controls Co, Ad, and Sh instead of the mux.

(b) The circuit is a basic ALU, with register. If Co is true, A is complemented and loaded into
register C. If Ad is true, A and B are added and loaded into C. If Sh is true, C is shifted right by
1. Sh has the highest priority, followed by Ad, and then by Co. Note that else clauses are not
used.

6.46 (a)

The circuit will result in 4 flip-flops.

(b) If Cmd =1, then C = A + B, else C = A – B.

158
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.48 (a) Unoptimized: Two 4-to-1 muxes

Optimized: 1 inverter. Write truth table and reduce as follows:

a1 a0 b1 b0
0 0 1 0
0 1 0 0
1 0 1 1
1 1 0 1

b 1 = a 0'
b 0 = a1

(b)

6.49

159
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6.50

6.51

6.52

160
© 2018 Cengage Learning®. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Another random document with
no related content on Scribd:
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About Project


Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.

Project Gutenberg™ eBooks are often created from several printed


editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.

You might also like