ECE 550D
Fundamentals of Computer Systems and Engineering
Fall 2016
Storage and Clocking
Tyler Bletsch Duke University Slides are derived from work by Andrew Hilton (Duke)
ECE 550D Fundamentals of Computer Systems and Engineering Fall 2016 - - PowerPoint PPT Presentation
ECE 550D Fundamentals of Computer Systems and Engineering Fall 2016 Storage and Clocking Tyler Bletsch Duke University Slides are derived from work by Andrew Hilton (Duke) VHDL: Behavioral vs Structural A few words about VHDL
Tyler Bletsch Duke University Slides are derived from work by Andrew Hilton (Duke)
2
3
4
5
6
“flip flop” = device that holds one bit (0 or 1) bit to be written bit currently being held bit to control when we write
7
Q Q R S D E Q Q R S
D latch
D Q E Q
D latch
D Q E
D latch
D Q E !Q !Q Q D C
DFF
D Q E Q
32 bit reg
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
(too awkward) (bad timing) (okay but only one bit) (nice!)
8
R S Q Q 1 1 R S Q Q 1 1
Don’t set both S & R to 1. Seriously, don’t do it.
9
R S Q Q 1 1 R S Q Q 1 1 1
Time S 0
1
R
1
1
10
R S Q Q 1 1 R S Q Q 1 1 1
Time S 0
1
R
1
1
Set Signal Goes High Output Signal Goes High
11
R S Q Q 1 1 R S Q Q 1 1 1
Time S 0
1
R
1
1
Set Signal Goes Low Output Signal Stays High
12
R S Q Q 1 1 R S Q Q 1 1 1
Time S 0
1
R
1
1
Until Reset Signal Goes High Then Output Signal Goes Low
13
14
Q Q R S D E Q Q R S
D latch
D Q E Q
D latch
D Q E
D latch
D Q E !Q !Q Q D C
DFF
D Q E Q
32 bit reg
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
(too awkward) (bad timing) (okay but only one bit) (nice!)
15
Q Q R S
16
17
Time D 0
1
E
1
1
E goes high D “latched” Stays as output R S
18
Time D 0
1
E
1
1
Does not affect Output E goes low Output unchanged By changes to D R S
19
Time D 0
1
E
1
1
E goes high D “latched” Becomes new output R S
20
Time D 0
1
E
1
1
Slight Delay (Logic gates take time) R S
21
22
23
D latch
D Q E Q
D latch
D Q E Q
3 3
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
24
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
25
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
26
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
27
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
28
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
29
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
30
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
31
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
32
D latch
D Q E Q
D latch
D Q E Q
3 3
Clk
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
33
D latch
D Q E Q
3
This slide describes how D-latches can malfunction because they were level triggered. Real D-flip-flops are edge-triggered, and we’re showing you why that’s important.
34
Q Q R S D E Q Q R S
D latch
D Q E Q
D latch
D Q E
D latch
D Q E !Q !Q Q D C
DFF
D Q E Q
32 bit reg
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
(too awkward) (bad timing) (okay but only one bit) (nice!)
35
36
D latch
D Q E
D latch
D Q E Q Q Q D C
37
D latch
D Q E
D latch
D Q E Q Q Q D C
38
D latch
D Q E
D latch
D Q E Q Q Q D C
39
D latch
D Q E
D latch
D Q E Q D C
D latch
D Q E
D latch
D Q E Q C
40
41
42
DFF
D Q E Q
DFF
D Q Q
DFF
D Q > Q
43
44
x x_d x_q
45
46
47
Q Q R S D E Q Q R S
D latch
D Q E Q
D latch
D Q E
D latch
D Q E !Q !Q Q D C
DFF
D Q E Q
32 bit reg
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
(too awkward) (bad timing) (okay but only one bit) (nice!)
48
32 bit reg
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q in0 in1 in2 in31
enable
49
32 bit reg
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
DFF
D Q E Q
(nice!)
En0 En1 En30 En31
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q WrData En0 En1 En30 En31
…
(Tremendous!)
50
51
Register File rnumA rnumB rnumW Wval Aval Bval
52
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
53
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
WrData En0 En1 En30 En31
54
Decoder
1
55
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q WrData En0 En1 En30 En31
…
56
57
58
59
60
61
E Output E D
E D Output 1 1 1 1
62
E Output E D
E D Output 1 1 0 1 1 1 0
63
E Output E D
E D Output 0 Z 1 Z 1 0 1 1 1 0
64
X=“Don’t care”
65
a b c d BAD!
66
D0 E0 D1 E1 Dn-2 En-2 Dn-1 En-1
67
Decoder
1
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
68 En0 En1 En30 En31
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q
32 bit reg
D Q E Q WrData En0 En1 En30 En31
…
69
70
71