D Flip Flops-Digital Logic Design-Solution Manual, Exercises of Digital Logic Design and Programming

This is solution manual for Digital Logic Design course. It was helpful for assignment Dr. Archan Singh gave us at Punjab Engineering College. It includes: Reset, D, Flip, Flop, Decoder, Synchronous, Multiplexer, IEEE, Time, Wave, Signals, Output

Typology: Exercises

2011/2012

Uploaded on 07/20/2012

annapurna
annapurna 🇮🇳

4.4

(21)

91 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
8-2.
8-5.
01
S0 00
X2
Z1 = 0
Z2 = 0
0
1
S1 01
X1
Z1 = 0
Z2 = 1
01
X2
01
S2 10
X1
Z1 = 1
Z2 = 0
Inputs: X2,X1
A:011011
B:111100
C:010101
State: ST1 ST1 ST2 ST3 ST1 ST2 ST3
Z:001100
0
1
STD
X
STE
Z
1
0X
0
1
STB
X
STC
Z
01
X
STA
01
X
Reset
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download D Flip Flops-Digital Logic Design-Solution Manual and more Exercises Digital Logic Design and Programming in PDF only on Docsity!

8-2.

8-5.

0 1

S0 00

X 2

Z 1 = 0

Z 2 = 0

0

1

S1 01

X 1

Z 1 = 0

Z 2 = 1

0 1

X 2

0 1

S2 10

X 1

Z 1 = 1

Z 2 = 0

Inputs: X 2 ,X 1

A: 0 1 1 0 1 1

B: 1 1 1 1 0 0

C: 0 1 0 1 0 1

State: ST1 ST1 ST2 ST3 ST1 ST2 ST Z: 0 0 1 1 0 0

0

1

STD

X

STE Z

(^0) X 1

0

1

STB

X

STC Z

0 X^1

STA

0 1 X

Reset

8-8.

8-9.

8-12.

ST1(t + 1) = ST1⋅A + ST2⋅B⋅C + ST3, ST2(t + 1) = ST1⋅A, ST3(t + 1)= ST2⋅(B + C), Z = ST2⋅B + ST

For the D flip-flops, DSTi = STi(t + 1) and STi = Q(STi).Reset initializes the flip-flops: ST1 = 1, ST2 = ST3 = 0.

DECODER

2 1

0 1 2 3

2

4

2 2

STA

STB STC STD STE

D C R D C R D C R

X Y

Y

Y DY

DY

DY

DY

DY

DY

Z

Y2 Y1 Y

STA 0 0 0

STB

STC

STD

STE

State Assignment

Reset

× 110101 (× 53)

000000 Init PP

100110 Add

100110 After Add

0100110 After Shift

00100110 After Shift

100110 Add

10111110 After Add

010111110 After Shift

0010111110 After Shift

100110 Add

1100011110 After Add

01100011110 After Shift

100110 Add

11111011110 After Add

011111011110 After Shift

8-20. library IEEE; use IEEE.std_logic_1164.all; entity asm_820 is port ( A, B, C, CLK, RESET: in STD_LOGIC; Z: out STD_LOGIC ); end asm_820; architecture asm_820_arch of asm_820 is type state_type is (ST1, ST2, ST3); signal state, next_state : state_type; begin state_register: process (CLK, RESET) begin if RESET='1' then --asynchronous RESET active High state <= ST1; elsif (CLK'event and CLK='1') then --CLK rising edge state <= next_state; end if; end process; next_state_func: process (A, B, C, state) begin case (state) is when ST1 => if A = '0' then next_state <= ST1; else next_state <= ST2; end if; when ST2 => if ((B = '1') and (C = '1')) then next_state <= ST1; else next_state <= ST3; end if; when ST3 => next_state <= ST1; end case; end process; --Output Z only depends on the state and input 'B' output_func: process (B, state) begin case (state) is when ST1 => Z <= '0'; when ST2 => if (B = '1') then Z <= '1'; else Z <= '0'; end if; when ST3 => Z <= '1'; end case; end process; end asm_820_arch;

NOTE: State hex value 4 cooresponds to ST1, 2 to ST2 and 1 to ST3.

8-21. Errata: A, B, C should be ST1, ST2, ST3.

8-28.

8-32.

module asm_821 (CLK, RESET, A, B, C, Z) ; input CLK, RESET, A, B, C ; output Z ; reg [1:0] state, next_state; parameter ST1=2'b00, ST2=2'b01, ST3=2'b10, ST4=2'b11; reg Z; always @(posedge CLK or posedge RESET) begin if (RESET) //asynchronous RESET active High state <= ST1; else //use CLK rising edge state <= next_state; end //Next state function always @(A or B or C or state) begin case (state) ST1: next_state <= A? ST2: ST1; ST2: next_state <= (B && C)? ST1: ST3; ST3: next_state <= ST1; ST4: next_state <= ST1; // Next state ST1 is assigned to unused state ST4. endcase end //Output function always @(B or state) begin case (state) ST1: Z <= 1'b0; ST2: Z <= B? 1'b1: 1'b0; ST3: Z <= 1'b1; ST4: Z <= 0'b0; endcase end endmodule

NOTE: State hex value 0 cooresponds to ST1, 1 to ST2 and 2 to ST3.

8 7 4 3 0

NXTADD1NXTADD0 SEL DATAPATH

27 1817

28 bits/word

Total = 1024 words x 28 bits/word = 28,672 bits

a) Opcode = 8 bits , b) 16 bits c) 65,536 d) –32768 to +