0% found this document useful (0 votes)
2 views

Class Notes CH03 Part 2

Uploaded by

kaludaniel2005
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Class Notes CH03 Part 2

Uploaded by

kaludaniel2005
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 59

Chapter

3
Boolean Algebra
and Digital Logic

Part 2—Sequential
Circuits

Last update: Oct , 2020


Objectives

• Understand the relationship between Boolean


logic and digital computer circuits.
• Learn how to design simple logic circuits.
• Understand how digital circuits work together
to form complex computer systems.
Sequential
Circuits
• Introduction—What’s a sequential circuit
• Basic memory cells--Latches and Flip Flops
• Analysis of Sequential Circuits
3.7 Sequential Circuits
• Combinational logic circuits are perfect for
situations when we require the immediate
application of a Boolean function to a set of inputs.
• There are other times, however, when we need a
circuit to change its value with consideration to its
current state as well as its inputs.
• These circuits have to “remember” their current state.
• Sequential logic circuits provide this functionality
for us.
Sequential Circuits--
Example
• Example combinational circuits
• Adder
• Subtractor
• multiplier etc.
• ALU (Arithmetic and Logic Unit)
Sequential Circuits--
Example
• A binary counter
• counters are used in several applications e.g. digital
clock

Enable
b
0
3-bit Binary Counter
b
1

b
2
Clock
Sequential Circuits--
Example
• State diagram

Enable
3-bit Binary Counter b
0
b
1
b
Clock 2
Combinational Circuits
x
1 z
1
x

... ...
2
Combinational
x Circuit
n Z
m

• z = f (x , x , …,x )
i i 1 2 n

03/03/2025 A. Berrached 8
Sequential Circuits
X

...
1 Z
X 1

...
2
Combinational Z
X m
n Circuit

...
1

Memory Cells ...


y
r

Clock
• z = f (x , x , …,x y
i i 1 2
y)
n, 1, …, r
03/03/2025 A. Berrached 9
3.7 Sequential Circuits
• Combinational circuits don’t remember anything about
past inputs. Output depends only on the current input
• Sequential circuits: Output is a function of the input
and the present state of the circuit i.e. y1…yr

Present state: Y(t) = y1…yr

Next state: Y(t+1) Also labeled: Y+

Y(t+1) = f(x1, x2, …, xn, y1, …,yr)

time: t and t+1 are often indicated by a clock signal


3.7 Sequential Circuits

• As the name implies, sequential logic circuits


require a means by which events can be sequenced.
• State changes are controlled by clocks.
• A “clock” is a special circuit that sends electrical pulses
through a circuit.
• Clocks produce electrical waveforms such as the
one shown below.
3.7 Sequential Circuits
• State changes occur in sequential circuits only
when the clock ticks.
• Circuits can change state on the rising edge, falling
edge, or when the clock pulse reaches its highest
voltage.
3.7 Sequential Circuits (4
of 30)
• Circuits that change state on the rising edge, or
falling edge of the clock pulse are called edge-
triggered.
• Level-triggered circuits change state when the
clock voltage reaches its highest or lowest level.
Sequential Circuits
X

...
1 Z
X 1

...
2
Combinational Z
X m
n Circuit

...
1

Memory Cells ...


y
r

Clock
• z = f (x , x , …,x y
i i 1 2
y)
n, 1, …, r
03/03/2025 A. Berrached 14
Sequential Circuits

Latches and Flip


Flops
Latches
• A latch is a bistable device (i.e. a device with two stable states)
that remains in a given state until input signals are applied to
cause its output to change.
• A latch is the most basic memory cell that’s capable of storing
a 0, storing a 1, or holding its data unchanged

Operations Q(t+1)
Q
Set state to 1 (store 1) 1
Set state to 0 (store 0) 0
Hold state (latch) Q(t)

Q represents the state of the memory i.e.

what’s stored in the cell 3 operations  need 2 input bits

03/03/2025 Ali Berrached--CS2425 16


Next State
• Q or Q(t) denotes the present state of a memory
device, i.e., the state at the time the input signals
are applied,
• Q+ or Q(t+1) denotes the next state, i.e., the new
state assumed by the device in response to the
input signals.

03/03/2025 Ali Berrached--CS2425 17


SR Latches
Q
R S R Q(t+1)
0 0 Q(t)
S Q 0 1 0
1 0 1
1 1 X

03/03/2025 Ali Berrached--CS2425 18


SR Latches
S R Q(t+1)
R Q

SR Latch 0 0 Q(t)
S Q
0 1 0
1 0 1
1 1 X

• S = 1  store 1
• R = 1  store 0
• S & R both 0  hold (also called latch)
• Does what it’s supposed to do in Slide #2
• S & R both 1  Q(t+1) is unpredictable
• Also, when is t+1?
03/03/2025 Ali Berrached--CS2425 19
JK Flip Flop
C J K Q+
↑ 0 0 Q
0
↑ 0 1 1
Q’
↑ 1 0

↑ 1 1

• Circuit is active only on the positive edge of the clock  positive


edge triggered flip flop
• t+1 is the time after the next edge of the clock signal
• Flip flop: timing of state changes are controlled by a clock
signal
• When k and J are both on, the state toggles
03/03/2025 Ali Berrached--CS2425 20
JK Flip Flop
J
Q
C J K Q+
C
J-K

Flip Flop
↑ 0 0 Q
0
↑ 0 1 1
Q
Q’
K

↑ 1 0

↑Characteristic
1 1 Table
C J K Q Q+
Characteristic Equation: ↑ 0 0 0 0
↑ 0 0 1 1
Q+ = J.Q’ + K’.Q ↑ 0 1 0 0
00, 01

10, 11
↑ 0 1 1 0
00, 10 ↑ 1 0 0 1
0 1 ↑ 1 0 1
↑ 1 1 0 1
↑ 1 1 1 1
11, 01 0
Finite State Machine (FSM)
03/03/2025 Ali Berrached--CS2425 21
State Diagram
Timing Diagram
C

Assume initial state Q = 0


0

03/03/2025 Ali Berrached--CS2425 22


Timing Diagram
C

03/03/2025 Ali Berrached--CS2425 23


Flip Flops
• There are two common flip-flops: JK & D flip flops.

Q
D
Q
J
D J-K
D Flip Flop

C Flip Flop

C
Q
K Q

D Q(t+1)
Characteristic Equation:
0 0
1 1 Q(t+1) = D

03/03/2025 Ali Berrached--CS2425 24


Timing Diagram
C

Assume initial state Q = 0


0

03/03/2025 Ali Berrached--CS2425 25


Sequential Circuits--
Registers
• This illustration shows a
4-bit register consisting
of D flip-flops. You will
usually see its block
diagram (below)
instead.
Sequential Circuits--
Registers
• A 4-bit shift-register
Sequential Circuits--
Registers _Exercise
C

In
0

Out
0

Out
1

Out
2

Out
3

03/03/2025 Ali Berrached--CS2425 28


Sequential Circuits--
Counters
• A binary counter is another
example of a sequential
circuit.
• The low-order bit is
complemented at each
clock pulse.
• Whenever it changes from
0 to 1, the next bit is
complemented, and so on
through the other flip-flops.
Sequential Circuits—
Counters_Exercise
C

Count

Enable

b
0

b
1

b
2

b
3

Output

03/03/2025 Ali Berrached--CS2425 30


C

b
0

b
1

b
2

b
3
Sequential Circuits—
Counters_Exercise
Draw the state diagram of the 4-bit counter.

03/03/2025 Ali Berrached--CS2425 32


Analysis of
Sequential
Circuits
Analysis of Sequential
Circuits X Z

X
1
.. 1

2
.. . Z

.
Combinational m
X
n Circuit

..
1

. Flip Flops ..
Y
r .
Clock

03/03/2025 A. Berrached 34
Analysis of Sequential
Circuits
• Zi = fi(X1, X2, …,Xn, Y1, Y2, …,Yr, )

• Yi+ = gi(X1, X2, …,Xn, Y1, Y2, …,Yr, )

03/03/2025 A. Berrached 35
Analysis of Sequential
Circuits
1. Identify the inputs, the outputs, and the state
variables. Are outputs synchronous?
2. Derive an expression for each output
3. Derive the F/Fs input equations
4. Derive the next state equations
5. Derive the CKT's State Transition
6. FSM if needed
7. Timing diagrams if needed

03/03/2025 A. Berrached 36
State Transition Table
PresentState Input NextState Output

03/03/2025 A. Berrached 37
Finite State Machine
• The behavior of sequential circuits can be expressed
using state transition tables or finite state machines
(FSMs).
• FSMs consist of a set of nodes that hold the states of the
machine and a set of arcs that connect the states.
• FSM is a graphical depiction of State Transition Table

0/0 1/0
0/0
A B

1/1

1/0
0/1 C

Finite State Machine (FSM) or State


Finite State Machine
• Moore and Mealy models are two types of FSMs
that are equivalent.
• They differ only in how they express the outputs of the
machine.
• Moore machines place outputs on each node, while
Mealy machines present their outputs on the
transitions.
• Moore Machine: output is associated with the state
Finite State Machine--
Example
0 1 0/0 1/0
0 0/0
A/0 B/1 A B

1 1/1

1 1 1/0
D/1 0 C/0 C
0/1

0 Mealy Finite State Machine

Moore Finite State Machine


Analysis of
Sequential
Circuits
Example 1
X A
D Q
C

B
D Q
C

03/03/2025 A. Berrached 42
Example1 Cont.
Step1: Input is X output is Z state variables: A & B
Step 2: Output equations: Z = AX' + BX’ (Mealy or Moore?)
Step 3: FF input equations:
DA = AX + BX
DB = A'X
Step 4: D flip flop characteristic eq: Q+= D
 A+ = DA  A+ = AX + BX
B+ = DB  B+ = A'X
03/03/2025 A. Berrached 43
Example 1 Cont.
Step 4: State Transition Table

Present State Input Next State Output


A B X A+ B+ Z
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 0 1
0 1 1 1 1 0
1 0 0 0 0 1
1 0 1 1 0 0
1 1 0 0 0 1
1 1 1 1 0 0

03/03/2025 A. Berrached 44
Analysis of Sequential
Circuits--Exercise
Draw FSM
Note: Is this a Mealy or Moore machine?

03/03/2025 A. Berrached 45
Analysis of Sequential
Circuits--Exercise
Assume Input Sequence: 00101110
What’s the output?

03/03/2025 A. Berrached 46
Analysis of
Sequential
Circuits
Example 2
Example 2
A
J Q

Z
X
K Q

B
J Q

K Q

03/03/2025 A. Berrached 48
Example2: Analysis
Step 1: Inputs: X outputs: Z State Variables: A & B
Step 2: output equations: Z = AB’ Mealy or Moore?
Step 3: Flip Flop Input Equations:
JA = B KA = BX'
JB = X’ KB = AX' + A’X
Step 4: Use J-K Flip Flop characteristic table to get circuit
state table
J K Q+
0 0 Q
0 1 0
1 0 1
1 1 Q’
03/03/2025 A. Berrached 49
State Transition Table

Present State Input JK Input Next State Output


A B X Ja Ka Jb Kb A+ B+ Z
0 0 0 0 0 1 0 0 1 0
0 0 1 0 0 0 1 0 0 0
0 1 0 1 1 1 0 1 1 0
0 1 1 1 0 0 1 1 0 0
1 0 0 0 0 1 1 1 1 1
1 0 1 0 0 0 0 1 0 1
1 1 0 1 1 1 1 0 0 0
1 1 1 1 0 0 0 1 1 0

03/03/2025 A. Berrached 50
Analysis of Sequential
Circuits--Exercise
Draw FSM
Note: Is it Mealy or Moore?

03/03/2025 A. Berrached 51
Analysis of Sequential
Circuits-Exercise
Input sequence: 010110

03/03/2025 A. Berrached 52
Analysis of Sequential
Circuits-Exercise
Draw state transition table of the following circuit

Positive Edge Triggered JK

Flip Flop

Positive edge-

triggered

J-K Flip Flop


Analysis of Sequential
Circuits-Exercise
Draw state transition table of the following circuit

J = X’A K = X’A+A’
X A J K A+
0 0 0 1 0
0 1 1 1 0
1 0 0 1 0
1 1 0 0 1
Analysis of Sequential
Circuits-Exercise
• Suppose the state machine shown below is in State
A and receives the string 1001001. What is its
output?
Analysis of Sequential
Circuits-Exercise
Time 1 2 3 4 5 6 7 8

Input 1 0 0 1 0 0 1

State A D C D A B B C

Output 00 10 11 10 00 0 01 11
Conclusion
Sequential Circuits
Conclusion
• The output of a sequential circuits depends on the input and
the state of the circuit.
• Sequential circuits require clocks to control their changes of
state.
• The state of a sequential circuit is stored using flip flops
• The basic sequential circuit unit is the flip-flop: The behaviors
of the SR, JK, and D flip-flops are the most important to know.
• The behavior of sequential circuits can be expressed using
state transition tables or finite state machines (State
Diagrams) .
• Common examples of sequential circuits include memory,
counters, sequence detectors etc.

You might also like