Docsity

Realizing Sequential Circuits - Lecture Slides | CIT 595, Study notes of Computer Science

Toggle sidebar
bg1
1
CIT 595 1
Sequential Logic Circuits – Part II
(Realizing Sequential Circuits)
CIT 595
Spring 2008
CIT 595 2
Sequential Circuits
Output depends on stored information
(current state) and may be on current inputs
Built out of combinational logic and one or
more memory/storage elements
Examples seen so far: n-bit Register and m x
n Memory
Like combinational logic, we want a
systematic way of analyzing/designing a
sequential circuit
CIT 595 3
Describing Behavior of Sequential Circuits
With 1-bit storage, 2 possible states (values)
that can be stored i.e. 0 or 1
With n-bits, there are 2n possible states
The amount of information to be stored is finite
So total number of different possible states the
information can be in also finite
Thus sequential circuit is also known as Finite
State Machine(FSM)
The behavior of the circuit can be described
using FSM model CIT 595 4
Finite State Machine (FSM)
A Finite State Machine is an abstract
model consisting:
Finite set of states
The transitions between those states
Along with the actions to be performed while
in those state or during transitions
The state reflects input changes from the
time system started to present moment
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Realizing Sequential Circuits - Lecture Slides | CIT 595 and more Study notes Computer Science in PDF only on Docsity!

CIT 595

1

Sequential Logic Circuits – Part II

(Realizing Sequential Circuits)

CIT 595

Spring 2008

CIT 595

2

Sequential Circuits

„^

Output depends on stored information(current state) and may be on current inputs

„^

Built out of combinational logic and one ormore memory/storage elements

„^

Examples seen so far: n-bit Register and m xn Memory

„^

Like combinational logic, we want asystematic way of analyzing/designing asequential circuit

CIT 595

3

Describing Behavior of Sequential Circuits „^

With 1-bit storage, 2 possible states (values)that can be stored i.e. 0 or 1^ „

With n-bits, there are 2

n^ possible states

„^

The amount of information to be stored is finite^ „

So total number of different possible

states

the

information can be in also finite

„^

Thus sequential circuit is also known as FiniteState Machine(FSM)

„^

The behavior of the circuit can be describedusing FSM model

CIT 595

4

Finite State Machine (FSM)

„^

A Finite State Machine is an abstractmodel consisting:^ „

Finite set of states „ The

transitions

between those states

„^

Along with the

actions

to be performed while

in those state or during transitions

„^

The

state

reflects input changes from the

time system started to present moment

CIT 595

5

FSM Terminology

„^

State Diagram:

Illustrates the form and function of a

state machine^ „

Usually drawn as a circle-and-arrow diagram

„^

State:

is a unique configuration of information in a

machine „^

Current/Present State:

configuration in which the

machine is currently in „^

Next State:

The state to which the state machine makes

the next transition, determined by the inputs present „^

Transition Arc:

A change from present state to next state

CIT 595

6

State Diagram, State, Next State, Transition Arc^ State 6 Note: From this diagram it can be deduced that if thepresent state is State 5, then the previous state was eitherState 4 or 5 and the next state must be either 5, 6, or 7.

State 7

State 4 State 5

„^ For any given state, there is a finite number of possiblenext states „^ One of the possible next statesbecomes the new present state,depending on the inputs present

„^ For digital system, statechanges on the clock cycle

Each state isgiven somename/symbol

CIT 595

7

Two Kinds of FSM Model

„^

Both machine model types stated below^ „

Follow the basic characteristics of state machines „ But differ in the way that outputs are produced

„^

Moore Machine^ „

Outputs are independent of the inputs i.e.dependent on present state only

„^

Mealy Machine^ „

Outputs are function of the present/currentstate and the present inputs

CIT 595

8

Moore FSM

„^

Each state is associated with the output of themachine^ „

Outputs are only dependent upon current state

„^

E.g. JK Flip-Flop as Moore Machine

If in state A then

Output 0

State Diagram

CIT 595

13

State Table: Moore Sequence Detector

Output

NextState

CurrentState

Input

C
C
A
C
C
B
A
B
B
A
A
A

z

Q(t + 1)

Q(t)

y

Independent of y,only depends oncurrent state

y

z

CIT 595

14

State Encoding

„^

We need to convert letters A, B, C toparticular binary combination of values suchthat they can be stored in flip-flops^ „

Remember that our digital flip-flop is storing binaryinformation

„^

Since there are 3 states, we can encode themin 2 bits^ „

Implies that we have 2 Flip-Flops in sequentialcircuit

„^

Let A = 00, B = 01, C = 10^ „

In this example we don’t care about state 11

CIT 595

15

State Table: Moore Sequence Detector (contd..)

x

x^

x

x

x^

x

z

Q(t + 1)q1 q

Q(t)Q^

Q

y

C
C
A
C
C
B
A
B
B
A
A
A

z

Q(t + 1)

Q(t)

y Q1 Q0: current state variablesq1 q0: next state variablesx – don’t care

CIT 595

16

Finding the Output and Next State Function

„^

Draw up Kmaps, just like for combinationallogic circuits, to come up the function foroutput and next state

„^

But before that:^ „

Need to pick the

type of flip-flop

to be used

„^

The most straight forward choice is D Flip-Flops^ ¾

State of the flop is simply the inputs

„^

Other than D Flip-Flop, need to do somethingextra – see an example later

CIT 595

17

Kmap for Moore Sequence Detector (Using D Flip-Flop)

x 1 0

x 0 0 Q y

1 Q^0^0001

q^1

x

x^

x

x

x^

x

z

Q(t + 1)q1 q

Q(t)Q^1

Q^0

y

q1 = yQ

0 + yQ

= y(Q

0 + Q

1 ) 0 x 0 1

x 0 0 Q y

1 Q^0^0001

q^0

q0 = yQ

1 Q

x 1

Q^1
Q^0 0 1

z

z = Q

CIT 595

18

Logic Diagram of Moore Sequence Detector

q1 = y(Q

0 + Q

1 )

q0 = yQ

1Q

z = Q

CIT 595

19

State Table: Mealy Sequence Detector

B
B
A
B
B
A
A
A

z

Q(t + 1)

Q(t)

y^

Dependent on yand current state

Inputs:

y - 1 bit input, Q(t)- Current State of the Circuit

Outputs: z - output , Q(t + 1) - Next State of the Circuit

CIT 595

20

State Table: Mealy Sequence Detector (contd..)

z

Q(t + 1)

q

Q(t)Q

y

B
B
A
B
B
A
A
A

z

Q(t + 1)

Q(t)

y

Q = current state variablesq = next state variables

Need only 1 flip-flopto represent 2 states.Let A = 0 and B = 1.

CIT 595

25

Sequence Detector Using JK Flip-Flop

x^

x x^

x 0

x 0

x x^

x^

x 0

x Forq^0 JK^0

0

x^

x x^

x x^

x^

x 0

x 0

x 0

x Forq^1 JK^1

1

x

x^

x

x

x^

x

z

Q(t + 1)q^1

q 0

Q(t)Q^1

Q^0

y

x x 1 0

x x 0 0 Q y 1 Q

0 0 1

J^1

J^1

= yQ

0

x x x

x x x Q y 1 Q

0 0 1

K^1

K^1

= yQ

1

x x 1

x x 0 Q y

1 Q^0^0001

J^0

= yQ

1

J^0

x x 1 x

x x 1 x q y 1 q^0^0001

K^0

= 1

K^0

CIT 595

26

Summary of Steps for Designing Sequential Circuits „^

Translate the state diagram into

State Table

„^

Decide the kind of

Flip-Flop

you want to use in

order to determine next state function

„^

Draw the Kmaps to determine the function

„^

Draw the logic circuit based on Kmapexpression „^

i.e. with flip-flops and combinational logic

CIT 595

27

Traffic Light Example

„^

A blinking traffic sign is controlled by aswitch^ „

No lights if switch is off „ If switch is on then

¾^ 1 & 2 on ¾^ 1, 2, 3, & 4 on ¾^ 1, 2, 3, 4, & 5 on ¾^ All off ¾^ repeat as long as switchis turned on

DANGER

MOVERIGHT 1 2

3

4

5

CIT 595

28

Traffic Sign State Diagram – Moore Machine State bit Q

1

State bit Q

0

Switch on

Switch off

Outputs

Transition on each clock cycle

CIT 595

29

Traffic Sign State Diagram: State 00

Transition on each clock cycle

CIT 595

30

Traffic Sign State Diagram: State 01

Transition on each clock cycle

CIT 595

31

Traffic Sign State Diagram: State 10

Transition on each clock cycle

CIT 595

32

Traffic Sign State Diagram: State 11

Transition on each clock cycle

CIT 595

37

Programmable State Machines

„^

Change to a two-state pattern: „^ All off „^ All on

State

[2] [1:0]

Input

Output(Z, Y, X)

S/Q^1011100

/Q

0

qq^1 0 --

X/Y/Z

q^1

q 0

State: 00

State: 10

State: 00

by 2-bit

by 3-bit

CIT 595

38

Other uses of Finite State Machines

„^

Machine respond to set of events bygenerating predictable responses based onthe history of prior events (current state) „^

Besides logic design, broadly usedcomputer science^ „

E.g. Compiler and Programming languagesTheory „ Known as Deterministic Finite Automata(DFA) „ E.g. FSM for accepting variable name inprogramming language

CIT 595

39

Designing Digital Circuits

„^

Designing Digital Circuits:^ „

Analysis

explores the relationship between a circuits

inputs and its outputs „^

Synthesis

creates logic diagrams using the values

specified in a truth/stable table

„^

Digital systems designers must also be mindfulof the physical behaviors of electroniccomponents^ „

E.g. Propagation delays

¾^ Occur between the time when a circuit’s inputs areenergized and when the output is accurate andstable

CIT 595

40

Designing Digital Circuits (contd..)

„^

Digital designers rely on specialized software^ „

After few states Mealy and Moore Modelsbecome cumbersome „ Thus, software is an enabler for theconstruction of better hardware „ E.g. Verilog is Hardware DescriptiveLanguage (HDL) where you can synthesizehardware components as if you writing ahigh-level language

CIT 595

41

Example of Verilog Language

module toplevel(clock,reset);input clock;input reset;reg flop1; //declare a 1-bit memory unitreg flop2;always @ (posedge reset or posedge clock) begin

if (reset)begin

flop1 <= 0;flop2 <= 1;end

else

begin

flop1 <= flop2;flop2 <= flop1;

end

endendmodule

CIT 595

42

Designing Digital Circuits (contd..)

„^

To implement a simple, specialized algorithmand have execution speed as fast as possible^ „

Hardware solution is often preferred

„^

This is the idea behind

embedded systems

,

which are small special-purpose computers^ „

Carry out limited set of tasks with the domain of alarger system „ E.g. microwaves, aircrafts & automobile controls, cellphones (???) „^

Embedded systems use configurable or custom madehardware

CIT 595

43

Aside: Potential Project Topic

„^

Embedded Systems^ „

Software Tools for digital circuit designs e.g. Verilog,VHDL „ Programmable (Configurable) Logic Devices and thecompanies that make them „ Embedded Operating System e.g. Windows CE „ Selling hardware designs as Open Source Hardware(HDL code sharing)

¾^ What about IP (intellectual property)?

CIT 595

44

From Logic to Data Path

„^

The data path of a computer is all the logicused to process information^ „

See the data path of the LC-3 on next slide

„^

Combinational Logic^ „

Decoders help convert instructions into controlsignals „ Multiplexers help select inputs and outputs „ ALU (Arithmetic and Logic Unit) performoperations on data

„^

Sequential Logic^ „

Memory for storage „ State machine (Control Unit)