Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instructor: Alexander Stoytchev

Similar presentations


Presentation on theme: "Instructor: Alexander Stoytchev"— Presentation transcript:

1 Instructor: Alexander Stoytchev
CprE 281: Digital Logic Instructor: Alexander Stoytchev

2 Registers CprE 281: Digital Logic Iowa State University, Ames, IA
Copyright © Alexander Stoytchev

3 Administrative Stuff Homework 8 is due next Monday.
The second midterm exam is next Friday.

4 Administrative Stuff Midterm Exam #2 When: Friday October 26 @ 4pm.
Where: This classroom What: Chapters 1, 2, 3, 4 and The exam will be open book and open notes (you can bring up to 3 pages of handwritten notes).

5 Midterm 2: Format The exam will be out of 130 points
You need 95 points to get an A for this exam It will be great if you can score more than 100 points. but you can’t roll over your extra points 

6 Midterm 2: Topics Binary Numbers and Hexadecimal Numbers
1’s complement and 2’s complement representation Addition and subtraction of binary numbers Circuits for adders and fast adders Single and Double precision IEEE floating point formats Converting a real number to the IEEE format Converting a floating point number to base 10 Multiplexers (circuits and function) Synthesis of logic functions using multiplexers Shannon’s Expansion Theorem

7 Midterm 2: Topics Decoders (circuits and function) Demultiplexers
Encoders (binary and priority) Code Converters K-maps for 2, 3, and 4 variables Synthesis of logic circuits using adders, multiplexers, encoders, decoders, and basic logic gates Synthesis of logic circuits given constraints on the available building blocks that you can use Latches (circuits, behavior, timing diagrams) Flip-Flops (circuits, behavior, timing diagrams) Registers and Register Files

8 Review of Flip-Flops

9 A simple memory element with NOT Gates
x x x

10 A simple memory element with NAND Gates
x

11 A simple memory element with NOR Gates
x

12 Basic Latch

13 A simple memory element with NOR Gates

14 A simple memory element with NOR Gates

15 A simple memory element with NOR Gates
Set Reset

16 A memory element with NOR gates
Reset Set Q [ Figure 5.3 from the textbook ]

17 Two Different Ways to Draw the Same Circuit
[ Figure 5.3 & 5.4 from the textbook ]

18 SR Latch: Circuit and Truth Table
Q a b 1 0/1 1/0 (a) Circuit (b) Truth table (no change) (Undesirable) [ Figure 5.4a,b from the textbook ] NOR Gate Truth table NOR Gate x1 x2 f 1

19 Gated SR Latch

20 Circuit Diagram for the Gated SR Latch
[ Figure 5.5a from the textbook ]

21 Circuit Diagram for the Gated SR Latch
This is the “gate” of the gated latch

22 Circuit Diagram for the Gated SR Latch
Notice that these are complements of each other

23 Gated SR Latch: Circuit Diagram, Characteristic Table, and Graphical Symbol
(Undesirable) [ Figure 5.5 from the textbook ]

24 Gated SR latch with NAND gates
Clk Q [ Figure 5.6 from the textbook ]

25 Gated SR latch with NAND gates
Clk Q In this case the “gate” is constructed using NAND gates! Not AND gates.

26 Gated SR latch with NAND gates
Clk Q Also, notice that the positions of S and R are now swapped.

27 Gated SR latch with NAND gates
Clk = 1 Q S 1 1 R Finally, notice that when Clk=1 this turns into the basic latch with NAND gates, i.e., the SR Latch.

28 Gated SR latch with NOR gates Gated SR latch with NAND gates
Clk Q

29 Gated SR latch with NOR gates Gated SR latch with NAND gates
Clk Q Graphical symbols are the same

30 Gated SR latch with NOR gates Gated SR latch with NAND gates
(undesirable) Gated SR latch with NAND gates S R Clk Q (undesirable) Characteristic tables are the same

31 Gated D Latch

32 Circuit Diagram for the Gated D Latch
[ Figure 5.7a from the textbook ]

33 Gated D Latch: Alternative Design
Clk [

34 Gated D Latch: Circuit Diagram, Characteristic Table, and Graphical Symbol
Note that it is now impossible to have S=R=1. When Clk=1 the output follows the D input. When Clk=0 the output cannot be changed. [ Figure 5.7a,b from the textbook ]

35 Setup and hold times for Gated D latch
su h Clk D Q Setup time (tsu) – the minimum time that the D signal must be stable prior to the the negative edge of the Clock signal Hold time (th) – the minimum time that the D signal must remain stable after the the negative edge of the Clock signal [ Figure 5.8 from the textbook ]

36 Master-Slave D Flip-Flop

37 Constructing a Master-Slave D Flip-Flop
From Two D Latches Master Slave

38 Constructing a Master-Slave D Flip-Flop
From Two D Latches Master Slave

39 Constructing a Master-Slave D Flip-Flop
From Two D Latches Master Slave

40 Constructing a Master-Slave D Flip-Flop
From Two D Latches [ Figure 5.9a from the textbook ]

41 Constructing a Master-Slave D Flip-Flop
From one D Latch and one Gated SR Latch (This version uses one less NOT gate) Master Slave

42 Constructing a Master-Slave D Flip-Flop
From one D Latch and one Gated SR Latch (This version uses one less NOT gate) Master Slave

43 Edge-Triggered D Flip-Flops

44 Master-Slave D Flip-Flop
Q Master Slave Clock m s Clk (a) Circuit [ Figure 5.9a from the textbook ]

45 Negative-Edge-Triggered Master-Slave D Flip-Flop
Q Master Slave Clock m s Clk Positive-Edge-Triggered Master-Slave D Flip-Flop D Q Master Slave Clock m s Clk

46 Negative-Edge-Triggered Master-Slave D Flip-Flop
Q Master Slave Clock m s Clk Positive-Edge-Triggered Master-Slave D Flip-Flop D Q Master Slave Clock m s Clk

47 Negative-Edge-Triggered Master-Slave D Flip-Flop
Q Master Slave Clock m s Clk D Q Positive-Edge-Triggered Master-Slave D Flip-Flop D Q Master Slave Clock m s Clk D Q

48 T Flip-Flop

49 T Flip-Flop [ Figure 5.15a from the textbook ]

50 Positive-edge-triggered
T Flip-Flop Positive-edge-triggered D Flip-Flop [ Figure 5.15a from the textbook ]

51 T Flip-Flop What is this? [ Figure 5.15a from the textbook ]

52 What is this? Q T D

53 What is this? Q T D + = ?

54 T Flip-Flop T D Q 1 Clock

55 T Flip-Flop T Q D Q 1 Q Clock Note that the two inputs to the multiplexer are inverses of each other.

56 Another Way to Draw This
Q D Q 1 Q Clock

57 Another Way to Draw This
Q D Q 1 Q Clock What is this?

58 What is this? Q T D

59 What is this? Q T D D = QT + QT

60 It is an XOR Q T D D = Q + T

61 It is an XOR D Q T D = Q + T

62 What is this? + = ?

63 T Flip-Flop T D Q Clock

64 (circuit, truth table and graphical symbol)
T Flip-Flop (circuit, truth table and graphical symbol) [ Figure 5.15a-c from the textbook ]

65 T Flip-Flop (How it Works)
If T=0 then it stays in its current state If T=1 then it reverses its current state In other words the circuit “toggles” its state when T=1. This is why it is called T flip-flop.

66 JK Flip-Flop

67 JK Flip-Flop D = JQ + KQ [ Figure 5.16a from the textbook ]

68 JK Flip-Flop ( ) (b) Truth table (c) Graphical symbol (a) Circuit J Q
1 t + ( ) (b) Truth table (c) Graphical symbol D Clock (a) Circuit [ Figure 5.16 from the textbook ]

69 JK Flip-Flop (How it Works)
A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it stays in the same state Just like SR It can be set and reset J=S and K=R If J=K=1 then it behaves as a T flip-flop

70 Complete Wiring Diagrams

71 Positive-Edge-Triggered D Flip-Flop

72 Negative-Edge-Triggered D Flip-Flop

73 The Complete Wiring Diagram for a Positive-Edge-Triggered D Flip-Flop
Clock Q

74 The Complete Wiring Diagram for a Negative-Edge-Triggered D Flip-Flop
Q D Clock

75 The Complete Wiring Diagram for a Negative-Edge-Triggered D Flip-Flop
Q D Clock

76 Positive-Edge-Triggered T Flip-Flop
Q Clock

77 Negative-Edge-Triggered T Flip-Flop
Q Clock

78 The Complete Wiring Diagram for a Positive-Edge-Triggered D Flip-Flop
Clock Q

79 The Complete Wiring Diagram for a Negative-Edge-Triggered D Flip-Flop
Clock Q

80 Positive-Edge-Triggered JK Flip-Flop
Q Q K Q Q Clock

81 Negative-Edge-Triggered JK Flip-Flop
Q Q K Q Q Clock

82 The Complete Wiring Diagram for a Positive-Edge-Triggered JK Flip-Flop
Q Clock J K

83 The Complete Wiring Diagram for a Negative-Edge-Triggered JK Flip-Flop
Q Clock J K

84 Registers

85 Register (Definition)
An n-bit structure consisting of flip-flops.

86 Parallel-Access Register

87 1-Bit Parallel-Access Register
D Q Clock In Out Load 1

88 1-Bit Parallel-Access Register
D Q Clock In Out Load 1 The 2-to-1 multiplexer is used to select whether to load a new value into the D flip-flop or to retain the old value. The output of this circuit is the Q output of the flip-flop.

89 1-Bit Parallel-Access Register
D Q Clock In Out Load 1 If Load = 0, then retain the old value.

90 1-Bit Parallel-Access Register
D Q Clock In Out Load 1 1 If Load = 1, then load the new value from In.

91 1-Bit Parallel-Access Register
D Q Clock In Out Load 1 If Load = 0, then retain the old value. If Load = 1, then load the new value from In.

92 2-Bit Parallel-Access Register
D Q Clock Load 1 In_1 Out_0 Out_1 In_0

93 2-Bit Parallel-Access Register
Parallel Output D Q Clock Load 1 In_1 Out_0 Out_1 In_0 Parallel Input

94 3-Bit Parallel-Access Register
D Q Clock Load 1 In_2 Out_1 Out_2 In_1 Out_0 In_0 Notice that all flip-flops are on the same clock cycle.

95 3-Bit Parallel-Access Register
Parallel Output D Q Clock Load 1 In_2 Out_1 Out_2 In_1 Out_0 In_0 Parallel Input

96 4-Bit Parallel-Access Register
Clock Load D Q 1 In_3 Out_3 In_2 Out_2 In_1 Out_1 In_0 Out_0

97 4-Bit Parallel-Access Register
Parallel Output Clock Load D Q 1 In_3 Out_3 In_2 Out_2 In_1 Out_1 In_0 Out_0 Parallel Input

98 4-Bit Parallel-Access Register
Clock Load D Q 1 In_3 Out_3 In_2 Out_2 In_1 Out_1 In_0 Out_0

99 4-Bit Parallel-Access Register
Clock Load D Q 1 In_3 Out_3 In_2 Out_2 In_1 Out_1 In_0 Out_0

100 4-Bit Parallel-Access Register
Clock Load D Q 1 In_3 Out_3 In_2 Out_2 In_1 Out_1 In_0 Out_0 1

101 Shift Register

102 A simple shift register
D Q Clock In Out 1 2 3 4 [ Figure 5.17a from the textbook ]

103 A simple shift register
D Q Clock In Out 1 2 3 4 Positive-edge-triggered D Flip-Flop

104 A simple shift register
D Q Clock In Out 1 2 3 4 D Q Master Slave Clock m s Clk

105 A simple shift register
D Q Clock In Out 1 2 3 4 D –Flip-Flop D Q Master Slave Clock m s Clk Gated D-Latch Gated D-Latch

106 A simple shift register
D Q Clock In Out 1 2 3 4

107 A simple shift register
D Q Clock In Out 1 2 3 4 D Q Master Slave Clk Clock In

108 A simple shift register
D Q Clock In Out 1 2 3 4 D Q Master Slave Clk Clock In

109 A simple shift register
D Q Clock In Out 1 2 3 4 D Q Master Slave Clk Clock In

110 A simple shift register
D Q Clock In Out 1 2 3 4 D Q Master Slave Clk Clock In

111 A simple shift register
D Q Clock In Out 1 2 3 4 D Q Master Slave Clk Clock In

112 A simple shift register
D Q Master Slave Clk Clock In

113 A simple shift register
D Q Master Slave Clk Clock In Clock

114 A simple shift register
D Q Master Slave Clk Clock In Clock

115 A simple shift register
D Q Master Slave Clk Clock In Clock

116 A simple shift register
D Q Master Slave Clk Clock In Clock

117 A simple shift register
D Q Clock In Out t 1 2 3 4 5 6 7 = (b) A sample sequence (a) Circuit [ Figure 5.17 from the textbook ]

118 Parallel-Access Shift Register

119 Parallel-access shift register
[ Figure 5.18 from the textbook ]

120 Parallel-access shift register
When Load=0, this behaves like a shift register. [ Figure 5.18 from the textbook ]

121 Parallel-access shift register
1 When Load=1, this behaves like a parallel-access register. [ Figure 5.18 from the textbook ]

122 Parallel Load and Enable
Shift Register With Parallel Load and Enable

123 A shift register with parallel load and enable control inputs
[ Figure 5.59 from the textbook ]

124 A shift register with parallel load and enable control inputs
The directions of the input and output lines are switched relative to the previous slides. [ Figure 5.59 from the textbook ]

125 A shift register with parallel load and enable control inputs
Parallel Input Parallel Output [ Figure 5.59 from the textbook ]

126 A shift register with parallel load and enable control inputs
[ Figure 5.59 from the textbook ]

127 A shift register with parallel load and enable control inputs
1 [ Figure 5.59 from the textbook ]

128 A shift register with parallel load and enable control inputs
1 [ Figure 5.59 from the textbook ]

129 A shift register with parallel load and enable control inputs
1 1 [ Figure 5.59 from the textbook ]

130 shift left / right register
Parallel-access shift left / right register

131 Parallel-access shift left/right register
Complete the following circuit diagram to implement a 4-bit register that has both parallel load and shift left/right functionality. The register has two control inputs (C1 and C0), four parallel input lines (I3, I2, I1, and I0), and four output lines (Q3, Q2, Q1, and Q0). Depending on the values of C1 and C0, the register performs one of the following four operations:

132 Parallel-access shift left/right register
D Q D Q D Q D Q

133 Parallel-access shift left/right register
D Q D Q D Q D Q Clock

134 Parallel-access shift left/right register
00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 D Q D Q D Q D Q Clock

135 Parallel-access shift left/right register
Out_3 Out_2 Out_1 Out_0 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 D Q D Q D Q D Q Clock

136 Parallel-access shift left/right register
Out_3 Out_2 Out_1 Out_0 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 D Q D Q D Q D Q Clock In_0

137 Parallel-access shift left/right register
Out_3 Out_2 Out_1 Out_0 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 D Q D Q D Q D Q Clock In_3 In_0

138 Parallel-access shift left/right register
Out_3 Out_2 Out_1 Out_0 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 D Q D Q D Q D Q Clock In_0 In_3 In_2 In_1

139 Parallel-access shift left/right register
Out_3 Out_2 Out_1 Out_0 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 D Q D Q D Q D Q Clock In_0 In_3 In_2 In_1

140 Parallel-access shift left/right register
Out_3 Out_2 Out_1 Out_0 C0 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 C1 D Q D Q D Q D Q Clock In_0 In_3 In_2 In_1

141 Parallel-access shift left/right register
Clock 00 01 10 11 D Q Out_3 Out_2 Out_1 Out_0 In_0 In_3 In_2 In_1 C0 C1

142 (select one of two 2-bit numbers)
Multiplexer Tricks (select one of two 2-bit numbers)

143 Select Either A=A1A0 or B=B1B0
1 s F0 F1 A0 B0 A1 B1

144 Select Either A=A1A0 or B=B1B0
1 s F0 F1 A0 B0 A1 B1 = A0 = A1

145 Select Either A=A1A0 or B=B1B0
1 s F0 F1 A0 B0 A1 B1 = B0 = B1

146 (select one of four 2-bit numbers)
Multiplexer Tricks (select one of four 2-bit numbers)

147 Select A=A1A0 or B=B1B0 or C=C1C0 or D=D1D0
00 01 10 11 A0 B0 C0 D0 F0 A1 B1 C1 D1 F1 1

148 Select A=A1A0 or B=B1B0 or C=C1C0 or D=D1D0
s 00 01 10 11 A0 B0 C0 D0 F0 A1 B1 C1 D1 F1 1 = A0 = A1

149 Select A=A1A0 or B=B1B0 or C=C1C0 or D=D1D0
1 s 00 01 10 11 A0 B0 C0 D0 F0 A1 B1 C1 D1 F1 1 = B0 = B1

150 Select A=A1A0 or B=B1B0 or C=C1C0 or D=D1D0
s 00 01 10 11 A0 B0 C0 D0 F0 A1 B1 C1 D1 F1 1 = C0 = C1

151 Select A=A1A0 or B=B1B0 or C=C1C0 or D=D1D0
00 01 10 11 A0 B0 C0 D0 F0 A1 B1 C1 D1 F1 1 = D0 = D1

152 Register File

153 one read port, and one write enable line.
Complete the following circuit diagram to implement a register file with four 2-bit registers, one write port, one read port, and one write enable line.

154

155 Register 0 Register 1 Register 2 Register 3

156 Register A Register B Register C Register D

157 Register A Register B Register C Register D A1 A0 B1 B0 C1 C0 D1 D0

158 Register A Register B Register C Register D A1 A0 B1 B0 C1 C0 D1 D0
In1 In0

159 Register A Register B Register C Register D A1 A0 B1 B0 C1 C0 D1 D0
In1 In0 Write_enable Write_address_0 Write_address_1

160 Register A Register B Register C Register D A1 A0 B1 B0 C1 C0 D1 D0
In1 In0 Write_enable Write_address_0 Write_address_1

161 Register A Register B Register C Register D A1 A0 B1 B0 C1 C0 D1 D0
In1 In0 Out1 Out0 Write_enable Write_address_0 Write_address_1 Read_address_1 Read_address_0

162 Register A Register B Register C Register D A1 A0 B1 B0 C1 C0 D1 D0
In1 In0 Out1 Out0 Write_enable Write_address_0 Write_address_1 Read_address_1 Read_address_0 Clock

163 A1 A0 B1 B0 C1 C0 D1 D0 In1 In0 Out1 Out0 Clock Write_address_0
Write_enable Write_address_0 Write_address_1 Read_address_1 Read_address_0 Clock

164 Questions?

165 THE END


Download ppt "Instructor: Alexander Stoytchev"

Similar presentations


Ads by Google