Professional Documents
Culture Documents
Problem Solutions To Problems Marked With A in Logic Computer Design Fundamentals, Ed. 2
Problem Solutions To Problems Marked With A in Logic Computer Design Fundamentals, Ed. 2
Problem Solutions To Problems Marked With A in Logic Computer Design Fundamentals, Ed. 2
4-4.
D
R Q
C
S Q
4-5.
S
C Q
Q
R
4-6.
Q
Reset Complement Set No Change
J=0 , K=1 J=1 , K=1 J=1 , K=0 J=0 , K=0
1
Problem Solutions – Chapter 4
4-10.
J K Q(t) Q(t+1) S R Q(t) Q(t+1) D Q(t) Q(t+1) T Q(t) Q(t+1)
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 1 1 0 1 0 0 1 1
0 1 0 0 0 1 0 0 1 0 1 1 0 1
0 1 1 0 0 1 1 0 1 1 1 1 1 0
1 0 0 1 1 0 0 1
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 X Q (t + 1 ) = D Q(t + 1) = T ⊕ Q
1 1 1 0 1 1 1 X
JA = B KA = BX
JB = X KB = AX + AX
Q ( t + 1 ) = JQ + KQ Q ( t + 1 ) = S + RQ
4-12.
Present state Input Next state X=0
4-17.
1/1
Present state Input Next state Output 0/0
0 1
A B X A B Y
0 0 0 0 1 0 0/1
0/1 1/0
0 0 1 0 0 1
1/0
0 1 0 1 0 1
0 1 1 1 1 0 2 3
1 0 0 0 0 1 1/1
0/0
1 0 1 0 1 0
1 1 0 1 1 0
Format: X/Y
1 1 1 1 0 1
2
Problem Solutions – Chapter 4
4-19.
DA B DB B
Present state Input Next state
1 1
A B X A B
A 1 1 1 A 1 1 1
0 0 0 0 0
0 0 1 1 0 X X
0 1 0 0 1
DA = AB + AX + BX D B = AX + BX
0 1 1 0 0
1 0 0 1 0
1 0 1 1 1
1 1 0 1 1
1 1 1 0 1
4-20.
Format: XY/Z (x = unspecified)
4-24.
DA B DB B Y B
Present state Input Next state Output
1 1 1 1 1 1
A B X A B Y
A 1 1 1 A 1 A
0 0 0 0 1 1
0 0 1 0 0 1 X X X
0 1 0 0 1 0
DA = AX + BX DB = BX + A X Y=AB
0 1 1 1 1 0
1 0 0 1 0 0
1 0 1 0 0 0
1 1 0 1 0 0
1 1 1 1 1 0
4-25.
DA J
Present state Input Next state
1 1
A J K A
A 1 1
0 0 0 0
0 0 1 0 K
0 1 0 1
DA = AJ+ AK
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
3
Problem Solutions – Chapter 4
4-30.
4-33.
4-36.
TA = ABX + ABX
Present state Input Next state FF Inputs TB = ABX + ABX + BX
A B X A B TA TB
0 0 0 0 0 0 0
0 0 1 0 1 0 1
0 1 0 1 0 1 1 T A
0 1 1 0 1 0 0 C A
1 0 0 1 0 0 0 X
1 0 1 1 1 0 1
1 1 0 1 1 0 0
1 1 1 0 0 1 1
T B
C B
Clock
4
Problem Solutions – Chapter 4
4-37
library IEEE; architecture mux_4to1_arch of mux_4to1 is
use IEEE.std_logic_1164.all; begin
4-40.
library IEEE; case J is
use IEEE.std_logic_1164.all; when '0' =>
entity jkff is if K = '1' then
port ( q_out <= '0';
J,K,CLK: in STD_LOGIC; end if;
Q: out STD_LOGIC when '1' =>
); if K = '0' then
end jkff; q_out <= '1';
else
architecture jkff_arch of jkff is q_out <= not q_out;
signal q_out: std_logic; end if;
begin when others => null;
end case;
state_register: process (CLK) end if;
begin end process;
if CLK'event and CLK='0' then --CLK falling edge
Q <= q_out;
-- (continued in the next column) end jkff_arch;
4-45.
module problem_4_45 (S, D, Y) ; always @(S or D)
begin
input [1:0] S ;
input [3:0] D ; if (S == 2'b00) Y <= D[0];
output Y; else if (S == 2'b01) Y <= D[1];
reg Y ; else if (S == 2'b10) Y <= D[2];
else Y <= D[3];
// (continued in the next column)
end
endmodule
5
Problem Solutions – Chapter 4
4-47.
module JK_FF (J, K, CLK, Q) ; always @(negedge CLK)
case (J)
input J, K, CLK ; 0'b0: Q <= K ? 0: Q;
output Q; 1'b1: Q <= K ? ~Q: 1;
reg Q; endcase
endmodule
// (continued in the next column)