CprE 281: Digital Logic

Similar documents
Different encodings generate different circuits

Sequential Circuit Analysis

Models for representing sequential circuits

ECE380 Digital Logic. Synchronous sequential circuits

CprE 281: Digital Logic

CprE 281: Digital Logic

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Sequential Synchronous Circuit Analysis

ELE2120 Digital Circuits and Systems. Tutorial Note 10

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

Lecture 10: Synchronous Sequential Circuits Design

Synchronous Sequential Circuit Design

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Finite State Machine. By : Ali Mustafa

Chapter 6. Synchronous Sequential Circuits

CPE100: Digital Logic Design I

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Finite State Machine (FSM)

Synchronous Sequential Circuit Design. Digital Computer Design

Counters. We ll look at different kinds of counters and discuss how to build them

ELE2120 Digital Circuits and Systems. Tutorial Note 9

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Sequential Circuits Sequential circuits combinational circuits state gate delay

Chapter 5 Synchronous Sequential Logic

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

EEE2135 Digital Logic Design

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

CprE 281: Digital Logic

CpE358/CS381. Switching Theory and Logical Design. Class 16

Lecture 17: Designing Sequential Systems Using Flip Flops

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

ELCT201: DIGITAL LOGIC DESIGN

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

CprE 281: Digital Logic

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Digital Circuits and Systems

FYSE420 DIGITAL ELECTRONICS

CprE 281: Digital Logic

Sequential logic and design

Week-5. Sequential Circuit Design. Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA.

Clocked Synchronous State-machine Analysis

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Synchronous Sequential Logic Part I. BME208 Logic Circuits Yalçın İŞLER

Synchronous Sequential Logic Part I

CprE 281: Digital Logic

Logical design of digital systems

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Digital Logic Design - Chapter 5

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

EXPERIMENT Traffic Light Controller

Design of Sequential Circuits

Digital Design. Sequential Logic

or 0101 Machine

6. Finite State Machines

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Topic 8: Sequential Circuits

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

CPE100: Digital Logic Design I

FSM model for sequential circuits

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

14.1. Unit 14. State Machine Design

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

ELCT201: DIGITAL LOGIC DESIGN

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

Sequential vs. Combinational

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

EGR224 F 18 Assignment #4

ECE 341. Lecture # 3

Clocked Sequential Circuits UNIT 13 ANALYSIS OF CLOCKED SEQUENTIAL CIRCUITS. Analysis of Clocked Sequential Circuits. Signal Tracing and Timing Charts

Lecture 13: Sequential Circuits, FSM

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

CPE100: Digital Logic Design I

Digital Control of Electric Drives

Synchronous Sequential Logic

Digital Logic Appendix A

Fundamentals of Digital Design

EE 209 Logic Cumulative Exam Name:

Synchronous Sequential Logic. Chapter 5

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1

Lecture 8: Sequential Networks and Finite State Machines

Sequential Circuit Design

CprE 281: Digital Logic

Lecture 14 Finite state machines

Mealy & Moore Machines

Chapter 6 Introduction to state machines

Analysis and Design of Sequential Circuits: Examples

CSE370 HW6 Solutions (Winter 2010)

Digital Electronics Sequential Logic

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

Chapter 15 SEQUENTIAL CIRCUITS ANALYSIS, STATE- MINIMIZATION, ASSIGNMENT AND CIRCUIT IMPLEMENTATION

Last lecture Counter design Finite state machine started vending machine example. Today Continue on the vending machine example Moore/Mealy machines

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

Lecture 13: Sequential Circuits, FSM

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

Transcription:

CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/

Synchronous Sequential Circuits Basic Design Steps CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev

First Design Pattern: Moore Machines

Moore Machine: A Type of Finite State Machine (FSM) Reset w = 0 A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1 [ Figure 6.3 from the textbook ]

Reset w = 1 w = 0 A: z = 0 B: z = 0 w = 0 w = 0 w = 1 C: z = 1 Finite number of states (nodes). w = 1 Discrete state transitions (edges). Only in one state at a time. One reset state Every state has an outgoing state transition for each possible input. [ Figure 6.3 from the textbook ]

Reset w = 0 A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1 Key: The next state depends on both the current state and the current input. [ Figure 6.3 from the textbook ]

Reset w = 0 A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1 Key: The output depends only on the current state. [ Figure 6.3 from the textbook ]

Reset w = 0 A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1

Reset w = 0 A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1 In general, we need to start tracing from the beginning to know which state the FSM is in. It may not be clear from a short sequence of outputs.

Reset w = 0 A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 What is the meaning of each state? w = 1

What is a State? It is not really a memory of every past input (We might run out of space to remember it all!) Rather, it is a characterization or snapshot of the pattern of inputs that have come before.

Moore Machine Implementation The state diagram is just an illustration to help us describe and reason about how the FSM will behave in each of its states. So, how do we turn it into a circuit?

Moore Machine Implementation W Combinational circuit Memory Elements Combinational circuit Z Clock Note: The W and Z lines need not be wires. They can be buses. [ Figure 6.1 from the textbook ]

State Storage W Combinational circuit Q(t+1) Flip-Flop Array Q(t) Combinational circuit Z Clock Any usable memory of the preceding input sequence is encoded in the flip-flop array.

FSM States The Flip-Flop array stores an encoding of the current state. Q(t) Q(t+1) Clock

State Encoding Each of the states in our design is identified by a distinct code. If we use 3 flip-flops, then the FSM can have up to 2 3 = 8 distinct states. So, when the flip-flop array contains the code 011, we say that the machine is in state 011.

Synchronous Design W Combinational circuit Q(t+1) Flip-Flop Array Q(t) Combinational circuit Z Clock Every active clock edge causes a state transition.

Synchronous Design W Combinational circuit Q(t+1) Flip-Flop Array Q(t) Combinational circuit Z Clock We expect the input signals to be stable before the active clock edge occurs.

Synchronous Design W Combinational circuit Q(t+1) Flip-Flop Array Q(t) Combinational circuit Z Clock There is a whole other class of sequential circuits which are asynchronous, but we will not study them in this course.

Sequential Circuits: Key Ideas The current output depends on something about the preceding sequence of inputs (and maybe the current output). Using memory elements (i.e., flip-flops), we design the circuit to remember some relevant information about the prior inputs.

Example

Reset w = 1 w = 0 A: z = 0 B: z = 0 w = 0 w = 0 w = 1 C: z = 1 w = 1 We need to find both the next state logic and the output logic implied by this machine. [ Figure 6.3 from the textbook ]

w = 0 Reset A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1 Present Next state Output state w = 0 w = 1 z A B C

w = 0 Reset A: z = 0 w = 1 w = 0 B: z = 0 w = 0 w = 1 C: z = 1 w = 1 Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1 [ Figure 6.4 from the textbook ]

How to represent the States? One way is to encode each state with a 2-bit binary number A ~ 00 B ~ 01 C ~ 10

How to represent the states? One way is to encode each state with a 2-bit binary number A ~ 00 B ~ 01 C ~ 10 How many flip-flops do we need?

Let s use two flip flops to hold the machine s state

Y 1 y 1 Y 2 y 2 Clock

Y 1 y 1 Y 2 y 2 Clock We will call y 1 and y 2 the present state variables. We will call Y 1 and Y 2 the next state variables. [ Figure 6.5 from the textbook ]

0 Y 1 y 1 Y 2 y 2 0 Clock Two zeros on the output JOINTLY represent state A.

1 Y 1 y 1 Y 2 y 2 0 Clock This flip-flop output pattern represents state B.

0 Y 1 y 1 Y 2 y 2 1 Clock This flip-flop output pattern represents state C.

1 Y 1 y 1 Y 2 y 2 1 Clock What does this flip-flop output pattern represent?

1 Y 1 y 1 Y 2 y 2 1 Clock This would be state D, but we don't have one in this example. So this is an impossible state.

w Next State Logic Y 1 y 1 Output Logic z Y 2 y 2 Clock [ Figure 6.5 from the textbook ]

Q(t+1) = Y 2 Y 1 Q(t) = y 2 y 1 w Next State Logic Y 1 y 1 Output Logic z Y 2 y 2 Clock We will call y 1 and y 2 the present state variables. We will call Y 1 and Y 2 the next state variables. [ Figure 6.5 from the textbook ]

w Next State Logic Y 1 y 1 Output Logic z Y 2 y 2 Clock We need to find logic expressions for Y 1 (w, y 1, y 2 ), Y 2 (w, y 1, y 2 ), and z(y 1, y 2 ). [ Figure 6.5 from the textbook ]

w Next State Logic Y 1 y 1 Output Logic z Y 2 y 2 Clock We need to find logic expressions for Y 1 (w, y 1, y 2 ), Y 2 (w, y 1, y 2 ), and z(y 1, y 2 ). [ Figure 6.5 from the textbook ]

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1 Suppose we encoded our states in the same order in which they were labeled: A ~ 00 B ~ 01 C ~ 10 [ Figure 6.4 from the textbook ]

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1 Present Next state state w = 0 w = 1 Output z A 00 B 01 C 10 11 The finite state machine will never reach a state encoded as 11. [ Figure 6.6 from the textbook ]

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1 We arbitrarily chose these as our state encodings. We could have used others. Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 A 00 00 01 0 B 01 00 10 0 C 10 00 10 1 11 dd dd d [ Figure 6.6 from the textbook ]

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 y 2 y 1 z 0 0 0 1 1 0 [ Figure 6.6 from the textbook ] 1 1

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 0 1 0 0 0 1 1 d 1 0 0 1 0 1 1 1 0 1 1 1 y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 0 1 0 0 0 1 1 d 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 d y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 0 1 0 0 0 1 1 d 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 d y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 0 0 1 0 0 0 0 1 1 d d 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 d y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 0 0 1 0 0 0 0 1 1 d d 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 d d y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 w y 2 y 1 Y 2 Y 1 0 0 0 0 0 Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 00 00 01 0 01 00 10 0 10 00 10 1 11 dd dd d 0 0 1 0 0 0 1 0 0 0 0 1 1 d d 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 d d y 2 y 1 z 0 0 0 0 1 0 1 0 1 [ Figure 6.6 from the textbook ] 1 1 d

Note that the textbook draws these K-Maps differently from all previous K-maps (the least significant bits index the columns, instead of the most significant bits). Q(t) = y 2 y 1 and Q(t+1) = Y 2 Y 1 Y 1 y 2 y 1 w y 2 y 1 Y 2 Y 1 w 00 01 11 10 0 0 0 0 0 0 0 0 d 0 0 0 1 0 0 1 1 0 d 0 0 1 0 0 0 0 1 1 d d Y 2 y 2 y 1 1 0 0 0 1 w 00 01 11 10 1 0 1 1 0 0 0 0 d 0 1 1 0 1 0 1 0 1 d 1 1 1 1 d d y 2 y 1 z z y 1 0 0 0 y 2 0 0 1 0 0 0 1 0 1 0 1 1 1 d 1 1 d

Don t care conditions simplify the combinatorial logic Y 1 y 2 y 1 w 00 01 11 10 Ignoring don't cares Using don't cares 0 0 0 d 0 Y = wy y 1 1 2 Y = wy y 1 1 2 1 1 0 d 0 Y 2 w y 2 y 1 00 01 11 10 0 0 0 d 0 Y = wy y + wy y 2 1 2 1 2 Y = wy + wy 2 1 2 1 0 1 d 1 = w ( y + y ) 1 2 z y 1 y 2 0 1 0 0 0 z = y y 1 2 z = y 2 1 1 d [ Figure 6.7 from the textbook ]

[ Figure 6.8 from the textbook ]

Y 2 = w (y1 + y2) z = y2 Y 1 = w y1 y2 [ Figure 6.8 from the textbook ]

Lastly, we add a reset signal, which forces the machine back to its start state, which is state 00 in this case. [ Figure 6.8 from the textbook ]

Clock w y 1 y 2 z 1 0 1 0 1 0 1 0 1 0 t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 [ Figure 6.9 from the textbook ]

Summary: Designing a Moore Machine Obtain the circuit specification. Derive a state diagram. Derive the state table. Decide on a state encoding. Encode the state table. Derive the output logic and next-state logic. Add a reset signal.

Questions?

THE END