Synchronous Sequential Circuit Design. Digital Computer Design

Similar documents
Finite State Machine (FSM)

Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

CPE100: Digital Logic Design I

Different encodings generate different circuits

Chapter 3. Chapter 3 :: Topics. Introduction. Sequential Circuits

Lecture 10: Synchronous Sequential Circuits Design

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

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

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

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

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

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

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

EGR224 F 18 Assignment #4

Models for representing sequential circuits

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

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

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

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

CPE100: Digital Logic Design I

Sequential logic and design

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

EXPERIMENT Traffic Light Controller

Synchronous Sequential Logic

Clocked Synchronous State-machine Analysis

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Finite State Machine. By : Ali Mustafa

Sequential Synchronous Circuit Analysis

Topic 8: Sequential Circuits

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

CPE100: Digital Logic Design I

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

Sequential Circuit 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

ECE 341. Lecture # 3

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

EEE2135 Digital Logic Design

Digital Design. Sequential Logic

CprE 281: Digital Logic

Lab #10: Design of Finite State Machines

Philadelphia University Student Name: Student Number:

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

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

EECS150 - Digital Design Lecture 16 Counters. Announcements

ENGG 1203 Tutorial_9 - Review. Boolean Algebra. Simplifying Logic Circuits. Combinational Logic. 1. Combinational & Sequential Logic

Example: vending machine

Exam for Physics 4051, October 31, 2008

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Generalized FSM model: Moore and Mealy

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

or 0101 Machine

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

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

ELCT201: DIGITAL LOGIC DESIGN

6. Finite State Machines

ASYNCHRONOUS SEQUENTIAL CIRCUITS

FYSE420 DIGITAL ELECTRONICS

Digital Logic Design - Chapter 4

Philadelphia University Student Name: Student Number:

Problem Set 9 Solutions

14.1. Unit 14. State Machine Design

Simplify the following Boolean expressions and minimize the number of literals:

State & Finite State Machines

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

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

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

ALU, Latches and Flip-Flops

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

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Sample Test Paper - I

Digital Logic Design - Chapter 5

Synchronous Sequential Circuit

Fundamentals of Digital Design

Adders, subtractors comparators, multipliers and other ALU elements

Total time is: 1 setup, 2 AND, 3 XOR, 1 delay = (1*1) + (2*2) + (3*3) + (1*1) = 15ns

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

Lecture 7: Logic design. Combinational logic circuits

State and Finite State Machines

Chapter 5 Synchronous Sequential Logic

Digital Electronics Sequential Logic

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

Lecture 8: Sequential Networks and Finite State Machines

UNIVERSITY OF WISCONSIN MADISON

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

State & Finite State Machines

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Adders, subtractors comparators, multipliers and other ALU elements

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

Synchronous Sequential Circuit Design

Chapter 6. Synchronous Sequential Circuits

Digital Design 2010 DE2 1

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

FSM model for sequential circuits

Chapter 4 Part 2 Sequential Circuits

Transcription:

Synchronous Sequential Circuit Design Digital Computer Design

Races and Instability Combinational logic has no cyclic paths and no races If inputs are applied to combinational logic, the outputs will always settle to the correct value within a propagation delay. Sequential circuits with cyclic paths If there is a cyclic path, undesirable races or unstable behavior might occur. 2

Example-1: Asynchronous Sequential Circuit A problematic circuit: (no clock) X Y Z X Y Z 0 1 2 3 4 5 6 7 8 time (ns) No inputs and 1-3 outputs Astable circuit, oscillates Period depends on inverter delay It has a cyclic path: output fed back to input The behavior of the asynchronous circuit depends on the gate delays. 3

Example-2: Asynchronous Sequential Circuit A problematic circuit (with clock): Suppose CLK=D= 1. Keeps Q=1. Bur if the inverter delay is longer than that of the AND and OR gates: When CLK becomes 0, Q becomes stuck at 0. 4

Synchronous Sequential Circuits Breaks cyclic paths by inserting registers Registers contain state of the system All registers receive the same clock signal Every cyclic path contains at least one register State changes at clock edge: system synchronized to the clock CLK S S Next State Current State A flip-flop is the simplest synchronous sequential circuit. 5

Circuit Examples Which of the circuits are synchronous sequential circuits? Sequential circuits that are not synchronous are asynchronous. 6

Synchronous Sequential Circuit Design Synchronous sequential circuits can be drawn in FSM form. A FSM consists of two blocks of combinational logic: next state logic output logic Moore FSM inputs M next state logic k next state CLK k state output logic N outputs Moore FSM: outputs depend only on current state Mealy FSM inputs M next state logic k next state CLK k state output logic N outputs Mealy FSM: outputs depend on current state and inputs 7

Traffic Light Controller Design Traffic sensors: T A, (TRUE when there s traffic) Lights:, Academic Labs T A Bravado Blvd. Dining Hall T A Fields Ave. Dorms 8

1- Determine Input and Output Signals Traffic sensors: T A, (TRUE when there s traffic) Lights:, CLK Academic Labs T A Bravado Blvd. Dining Hall T A Fields Ave. Dorms T A Traffic Light Controller Inputs: CLK,, T A, Outputs:, 9

2- Obtain State Transition Diagram Moore FSM: outputs labeled in each state States: Circles Transitions: Arcs Academic Labs T A Bravado Blvd. Dining Hall T A Fields Ave. Dorms S0 : green : red 10

2- Obtain State Transition Diagram Moore FSM: outputs labeled in each state States: Circles Transitions: Arcs Academic Labs T A Bravado Blvd. Dining Hall T A Fields Ave. Dorms S0 : green : red S3 : red : yellow T A TA S1 : yellow : red S2 : red : green 11

3- From State Transition Diagram to State Transition Table State Transition Table Current State Inputs Next State S T A S' S0 0 X S1 S0 1 X S0 S1 X X S2 S2 X 0 S3 S2 X 1 S2 S3 X X S0 S0 : green : red S3 : red : yellow T A TA S1 : yellow : red S2 : red : green 12

4- State Encoding The state transition diagram is abstract in that it uses states labeled S0, S1, S2, S3. To build a real circuit, the states and outputs must be assigned binary encodings. Each state is encoded with two bits: S 1:0 State Encoding S0 00 S1 01 S2 10 S3 11 13

5- Encoded State Transition Table State Transition Table Current State Inputs Next State S T A S' S0 0 X S1 S0 1 X S0 S1 X X S2 S2 X 0 S3 S2 X 1 S2 S3 X X S0 State Encoding S0 00 S1 01 S2 10 S3 11 Encoded State Transition Table Current State Inputs Next State S 1 S 0 T A S' 1 S' 0 0 0 0 X 0 1 0 0 1 X 0 0 0 1 X X 1 0 1 0 X 0 1 1 1 0 X 1 1 0 1 1 X X 0 0 14

6- Register (Flip-Flop) Input Equations (Next State Logic) Current State Inputs Next State S 1 S 0 T A S' 1 S' 0 0 0 0 X 0 1 0 0 1 X 0 0 0 1 X X 1 0 1 0 X 0 1 1 1 0 X 1 1 0 1 1 X X 0 0 Flip-Flop (register) Input Equations: S 1 = (S 1 S 0 ) + (S 1 S 0 ) + (S 1 S 0 ) S 0 = (S 1 S 0 T A ) + (S 1 S 0 ) The equations can also be simplified using Karnaugh maps: S 1 = S 1 xor S 0 15

Circuit Schematic: Next State Logic CLK S' 1 S 1 S' 0 r S 0 state register 16

Circuit Schematic: Next State Logic CLK S' 1 S 1 T A S' 0 r S 0 S 1 S 0 inputs next state logic state register 17

7- Output Table and Output Equations (Output Logic) S0 : green : red T A TA S1 : yellow : red Output Encoding green 00 yellow 01 red 10 Output Table Current State Outputs S 1 S 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 1 0 S3 : red : yellow S2 : red : green 1 0 1 0 0 0 1 1 1 0 0 1 Output Equations: 1 = S 1 0 = S 1 S 0 1 = S 1 0 = S 1 S 0 18

Circuit Schematic: Output Logic CLK 1 S' 1 S 1 0 T A S' 0 r S 0 1 S 1 S 0 0 inputs next state logic state register output logic outputs 19

One-Hot State Encoding Binary encoding: i.e., for four states, 00, 01, 10, 11 K states only needs log 2 K bits of state One-hot encoding One state bit per state K states only needs K bits of state Only one state bit HIGH at once i.e., for 4 states, 0001, 0010, 0100, 1000 Requires more flip-flops Often next state and output logic is simpler State Binary Encoding S0 00 S1 01 S2 10 State One Hot Encoding S 2 S 1 S 0 S0 0 0 1 S1 0 1 0 S2 1 0 0 20

A divide-by-n Counter Design With One Hot State Encoding The output Y is HIGH for one clock cycle out of every N. Divide-by-3 counter State Transition Table Current State S0 S1 S2 Next State S1 S2 S0 Output Table Current State Output S0 1 S1 0 S2 0 21

State Table, Output Table, State Encoding State One Hot Encoding S 2 S 1 S 0 S0 0 0 1 S1 0 1 0 S2 1 0 0 State Encoding Current State Next State S 2 S 1 S 0 S 2 S 1 S 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 Encoded State Table Current State Output S 2 S 1 S 0 Y 0 0 1 1 0 1 0 0 1 0 0 0 Encoded Output Table 22

Register Input Equations and Output Equations Current State Next State S 2 S 1 S 0 S 2 S 1 S 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 Encoded State Table Flip-Flop (register) Input Equations: S 2 =S 1 Current State Output S 2 S 1 S 0 Y 0 0 1 1 0 1 0 0 1 0 0 0 Output Table Output Equations: Y=S 0 S 1 =S 0 S 0 =S It is easy to derive boolean equations with One-Hot encoding. 23

Pattern Recognizer Design A synchronous sequential circuit that recognizes the occurrence of 01 by observing a given sequence. 0010101000101010001010010001 Outputs 1 when the patter is found. Design Steps: 1. Determine Input and Output Signals 2. Draw State Transition Diagram 3. State Transition Table 4. Encoded State Transition Table 5. Register Input Equations 6. Encoded Outputs 7. Output Equations 8. Draw Schematic 24

State Transition Diagrams Moore FSM 0 1 S0 1 0 0 S1 0 0 1 S2 1 Mealy FSM 0/0 S0 1/0 0/0 S1 1/1 25

Moore State Transition and Output Tables Moore FSM 0 1 S0 1 0 0 S1 0 0 1 S2 1 Current State Input Next State S A S S0 0 S1 S0 1 S0 S1 0 S1 S1 1 S2 S2 0 S1 S2 1 S0 Current State Output S Y S0 0 S1 0 S2 1 26

State Transition and Output Tables with State Encoding Moore FSM 0 1 S0 1 0 0 S1 0 0 Current State S2 1 1 Current State Input Next State S 1 S 0 A S' 1 S' 0 0 0 0 0 1 Output S 1 S 0 Y 0 0 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 0 27

Register Input Equations and Output Equations Moore FSM 0 1 S0 1 0 0 S1 0 0 1 S2 1 Current State Input Next State Current State Output S 1 S 0 Y 0 0 0 0 1 0 1 0 1 Y = S 1 S 1 S 0 A S' 1 S' 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 0 S 1 = S 0 A S 0 = A 28

Mealy State Transition and Output Tables Mealy FSM 0/0 S0 1/0 0/0 S1 1/1 Current State Input Next State Output S A S Y S0 0 S1 0 S0 1 S0 0 S1 0 S1 0 S1 1 S2 1 29

State Transition and Output Tables with State Encodings Mealy FSM 0/0 S0 1/0 0/0 S1 1/1 Current State Input Next State Output S A S Y 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 30

Register Input Equations and Output Equations Mealy FSM 0/0 S0 S1 1/0 0/0 1/1 Current State Input Next State Output S A S Y 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 S 0 = A Y = S 0 A 31

Circuit Schematic A CLK S' 1 S 1 Y A CLK S' 0 S 0 Y S' 0 S 0 r r Moore Machine Mealy Machine 32

Further Reading These slides are sufficient to understand the design of the synchronous sequential circuits. You can read Chapter 3 of your book Sections 3.2, 3.3, 3.5 33