Introduction To Sequential Circuits: Digital Logic Design
Introduction To Sequential Circuits: Digital Logic Design
Sequential Circuits
COE 202
Digital Logic Design
❖ Latches
❖ Flip-Flops
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 2
Combinational versus Sequential
❖ Two classes of digital circuits
Combinational Circuits
Sequential Circuits
❖ Combinational Circuit
Outputs = F(Inputs)
Combinational
Function of Inputs only Inputs Outputs
Circuit
NO internal memory
❖ Sequential Circuit
Outputs is a function of Inputs and internal Memory
There is an internal memory that stores the state of the circuit
Time is very important: memory changes with time
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 3
Introduction to Sequential Circuits
A Sequential circuit consists of:
Next State also depends on the Inputs and the Present State
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 4
Two Types of Sequential Circuits
1. Synchronous Sequential Circuit
Uses a clock signal as an additional input
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 5
Synchronous Sequential Circuits
Inputs Outputs
Combinational
Logic
Present Next
State Memory State
Elements
Clock
❖ Synchronous sequential circuits use a clock signal
❖ The clock signal is an input to the memory elements
❖ The clock determines when the memory should be updated
❖ The present state = output value of memory (stored)
❖ The next state = input value to memory (not stored yet)
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 6
The Clock
Positive Negative
Clock cycle Clock cycle Pulse Pulse
Time
Time
❖ Latches
❖ Flip-Flops
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 10
SR Latch
❖ A latch is a memory element that can store 0 or 1
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 11
SR Latch Operation
Set Operation Store Operation
R (Reset) 0 1 R (Reset) 0 1
Q Q
0 Q 0 Q
S (Set) 1 S (Set) 0
R (Reset) 1 0 R (Reset) 0 0
Q Q
1 Q 1 Q
S (Set) 0 S (Set) 0
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 12
SR Latch Invalid Operation
Invalid Operation Race Condition
0 Q Q
S (Set) 1 S (Set) 1→0
0→1
S 1 0 0 0 1 1 0 0 0 1
R 0 0 1 0 0 1 0 1 0 0
Q 1 1 0 0 1 0 0 0 1
Q 0 0 1 1 0 0 1 1 0
Time
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 14
Gated SR Latch with Clock Enable
R (Reset) CR
Q
C (Clock)
CS Q
S (Set)
Known as
the 𝑆 𝑅 Latch
S (Set) 0 1 S (Set) 1 1
Q Q
0 Q 0 Q
R (Reset) 1 R (Reset) 1
S (Set) 1 0 S (Set) 1 0
Q Q
1 Q 1 Q
R (Reset) 0 R (Reset) 1
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 17
S R Latch Invalid Operation
Invalid Operation Race Condition
1 Q Q
R (Reset) 0 R (Reset) 0→1 1→0
❖ No undefined state
❖ Inverter can be removed Q
C
❖ When 𝐶 = 1, 𝑅 = 𝑆ҧ = 𝐷
ഥ R
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 20
Timing of a D-Latch with Clock Enable
D S
Q
D-Latch with
Clock Input
Q
C R
Q
Time
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 21
Graphic Symbols for Latches
𝑆 𝑄 𝑆ҧ 𝑄 𝐷 𝑄
𝑆𝑅 𝑆𝑅 𝐷
𝐶 𝐶
𝐿𝑎𝑡𝑐ℎ 𝐿𝑎𝑡𝑐ℎ 𝐿𝑎𝑡𝑐ℎ
𝑅 𝑄 𝑅ത 𝑄 𝐶 𝑄
Indicates that logic-0 is used (not logic-1) to set (or reset) the
latch (as in the NAND latch implementation)
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 22
Problem with Latches
❖ A latch is level-sensitive (sensitive to the level of the clock)
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 23
Next . . .
❖ Latches
❖ Flip-Flops
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 24
Flip-Flops
❖ A Flip-Flop is a better memory element for synchronous circuits
Time
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 25
Edge-Triggered D Flip-Flop
❖ Built using two latches in a master-slave configuration
❖ A master latch (D-type) receives external inputs
❖ A slave latch (SR-type) receives inputs from the master latch
❖ Only one latch is enabled at any given time
When Clk=0, the master is enabled and the D input is latched (slave disabled)
When Clk=1, the slave is enabled to generate the outputs (master is disabled)
𝑄𝑚
Outputs
Master Slave
𝑄𝑚 change when
Clk
Clk changes
from 0 to 1
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 26
Negative Edge-Triggered D Flip-Flop
❖ Similar to positive edge-triggered flip-flop
❖ The first inverter at the Master C input is removed
❖ Only one latch is enabled at any given time
When Clk=1, the master is enabled and the D input is latched (slave disabled)
When Clk=0, the slave is enabled to generate the outputs (master is disabled)
𝑄𝑚
Outputs
Master Slave change when
𝑄𝑚
Clk Clk changes
from 1 to 0
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 27
D Flip-Flop Timing Diagram
❖ The diagram shows the timing of a positive-edge D Flip-Flop
❖ Notice the slight delay in the output Q after the rising edge
Clk
Qm
Time
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 28
Graphic Symbols for Flip-Flops
𝐷𝑎𝑡𝑎 𝐷 𝑄 𝐷𝑎𝑡𝑎 𝐷 𝑄
Flip Flip
Flop Flop
𝐶𝑙𝑘 𝑄 𝐶𝑙𝑘 𝑄
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 29
Asynchronous Set and Reset
❖ When Flip-Flops are powered, their initial state is unknown
❖ Some flip-flops have an asynchronous Set and Reset inputs
❖ Set forces Q to become 1, independently of the clock
❖ Reset forces Q to become 0, independently of the clock
𝑆𝑒𝑡
Inputs Outputs
𝑆𝑒𝑡 𝑅𝑒𝑠𝑒𝑡 𝐷𝑎𝑡𝑎 𝐶𝑙𝑘 𝑄 𝑄
𝐷𝑎𝑡𝑎 𝐷 𝑄
0 1 X X 1 0
Flip
Flop 1 0 X X 0 1
𝐶𝑙𝑘 𝑄 1 1 0 ↑ 0 1
1 1 1 ↑ 1 0
Master Slave
𝑄1
𝑆 𝑆 𝑄
SR Latch
SR Latch
𝐽
𝐶𝑙𝑘 𝐶 𝐶
𝐾 𝑄1
𝑅 𝑅 𝑄
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 31
T Flip-Flop
❖ The T (Toggle) flip-flop has inputs: T and Clk
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 32
Flip-Flop Characteristic Table
❖ Defines the operation of a flip-flop in a tabular form
❖ Next state is defined in terms of the current state and the inputs
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 33
Flip-Flop Characteristic Equation
❖ The characteristic equation defines the operation of a flip-flop
❖ For D Flip-Flop: 𝑄 𝑡 + 1 = 𝐷
❖ For JK Flip-Flop: 𝑄 𝑡 + 1 = 𝐽 𝑄 ′ 𝑡 + 𝐾 ′ 𝑄(𝑡)
❖ For T Flip-Flop: 𝑄 𝑡 + 1 = 𝑇 ⨁ 𝑄(𝑡)
❖ Clearly, the D Flip-Flop is the simplest among the three
❖ Hold Time (Th): Time duration for which the data input must
not be changed after the clock transition occurs.
Rising
Edge Clock
Ts Th
Introduction to Sequential Circuits COE 202 – Digital Logic Design © Muhamed Mudawar – slide 35
Summary
❖ In a sequential circuit there is internal memory
Output is a function of current inputs and present state
The stored memory value defines the present state
Similarly, the next state depends on current inputs and present state