CSE140: Digital Logic Design Registers and Counters

Similar documents
ALU, Latches and Flip-Flops

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Timing Constraints in Sequential Designs. 63 Sources: TSR, Katz, Boriello & Vahid

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Lecture 8: Sequential Networks and Finite State Machines

CSE 140: Components and Design Techniques for Digital Systems. Lecture 9: Sequential Networks: Implementation

Finite State Machine. By : Ali Mustafa

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

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

Finite State Machine (FSM)

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

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

CSE 140 Midterm 3 version A Tajana Simunic Rosing Spring 2015

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Digital Circuits and Systems

FSM model for sequential circuits

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

Generalized FSM model: Moore and Mealy

Fundamentals of Digital Design

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

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

Review for Final Exam

Lecture 13: Sequential Circuits, FSM

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

Sequential Circuit Analysis

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

CSE140: Design of Sequential Logic

Synchronous Sequential Logic

Analysis of clocked sequential networks

CPE100: Digital Logic Design I

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

Design at the Register Transfer Level

Sequential logic and design

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

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

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

Lecture (08) Synchronous Sequential Logic

Chapter 4 Part 2 Sequential Circuits

CPE100: Digital Logic Design I

Sequential Synchronous Circuit Analysis

Adders allow computers to add numbers 2-bit ripple-carry adder

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Chapter 7. Synchronous Sequential Networks. Excitation for

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

State and Finite State Machines

Analysis and Design of Sequential Circuits: Examples

Lecture 10: Synchronous Sequential Circuits Design

CSE370 HW6 Solutions (Winter 2010)

Lecture 7: Sequential Networks

Lecture 13: Sequential Circuits, FSM

Sequential Logic Circuits

Adders, subtractors comparators, multipliers and other ALU elements

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

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

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

Lecture 10: Sequential Networks: Timing and Retiming

EEE2135 Digital Logic Design

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

Synchronous Sequential Circuit Design. Digital Computer Design

ECE 341. Lecture # 3

Digital Circuits ECS 371

CPE100: Digital Logic Design I

Lecture 17: Designing Sequential Systems Using Flip Flops

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

UNIVERSITY OF WISCONSIN MADISON

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

Digital Logic Design. Midterm #2

State & Finite State Machines

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

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

Sequential Circuits Sequential circuits combinational circuits state gate delay

ELCT201: DIGITAL LOGIC DESIGN

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Chapter 4. Sequential Logic Circuits


Sequential Logic Worksheet

Sequential Circuit Design

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

Lecture 3 Review on Digital Logic (Part 2)

Adders, subtractors comparators, multipliers and other ALU elements

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Different encodings generate different circuits

Digital Design. Sequential Logic

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

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

CprE 281: Digital Logic

Review for B33DV2-Digital Design. Digital Design

Latches. October 13, 2003 Latches 1

ENGG 1203 Tutorial. Solution (b) Solution (a) Simplification using K-map. Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives

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

State & Finite State Machines

Midterm review session tomorrow 4:15 EEB125 Midterm 2 in class (45min long, starts at 10:35am) Today Abi bigger example: Hungry Robot Ant in Maze

14:332:231 DIGITAL LOGIC DESIGN

Preparation of Examination Questions and Exercises: Solutions

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

EGR224 F 18 Assignment #4

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

Transcription:

CSE14: Digital Logic Design Registers and Counters Prof. Tajana Simunic Rosing 38

Where we are now. What we covered last time: ALUs, SR Latch Latches and FlipFlops (FFs) Registers What we ll do next FSMs Upcoming deadlines: ZyBook today: Sec 5.1-6, Thursday: Sec 5.7-11 HW#4 due today, HW#5 due next Tuesday Quiz #5 Thursday Midterm #2 coming up next week Discussion session next Monday will help prepare for midterm Textbook references: chap 3, Sec 6.3 Prof. office hours this week: Tuesday 5-6pm Thursday 1:3-2:3pm (instead of starting at 2:2pm) TA/Tutor office hours back to full schedule starting Thursday

Design of a Universal Shift Register left_in left_out clear s s1 output input right_out right_in clock clear s s1 new value 1 output 1 output value of FF to left (shift right) 1 output value of FF to right (shift left) 1 1 input Nth cell to N-1th cell Q D to N+1th cell CLEAR 1 2 3 s and s1 control mux Q[N-1] (left) Input[N] Q[N+1] (right)

Counters Sequences through a fixed set of patterns OUT1 OUT2 OUT3 OUT4 IN D Q D Q D Q D Q 41

General Counters Default operation: count up QA-QD counter output A-D parallel load data LOAD enables data load RCO ripple carry out CLR clears data EN counter enable "1" "" "1" "1" "" "" EN RCO D QD C QC B QB A QA LOAD CLR "1" "" "" "" "" EN RCO D QD C QC B QB A QA LOAD CLR 42

Finite State Machines 43

Circuit Specifications Combinational Logic Truth tables, Boolean equations, logic diagrams (no feedback) Sequential Networks: State Diagram (Memory) State and Excitation Tables Characteristic Expression Logic Diagram (FFs and feedback loops) Y A B C D Combinational X RTL: Register-Transfer Level Description 44

Finite State Machines: Two Bit Counter Example Symbol/ Circuit Current state Next State 2 bit Counter S S 1 S 1 S 2 S 2 S 3 S 3 S S Q 1 (t) Q (t) Q 1 (t+1) Q (t+1) S 3 S 1 S 2 State Diagram State Table

Which is the most likely circuit realization of the two bit counter? State Table Q 1 (t) Q (t) Q 1 (t+1) Q (t+1) 1 1 1 1 1 1 1 1 A. Combinational circuit Circuit with no flip flops B. C. Q (t) Combinational circuit Q 1 (t) D Q Q D Q Q Q (t) Q 1 (t) Combinational circuit D Q Q Circuit with 2 flip flops Circuit with one flip flop

Two Bit Counter Circuit State Table Q 1 (t) Q (t) Q 1 (t+1) Q (t+1) 1 1 1 1 1 1 1 1 Q D Q (t) Q Q D Q Q 1 (t) We store the current state using D-flip flops so that: Inputs to the combinational circuit don t change while the next output is computed The transition to the next state only occurs at the rising edge of the clock D (t) = Q (t) D 1 (t) = Q (t) Q 1 (t) + Q (t) Q 1 (t) Implementation of 2-bit counter

FSM Definition FSM consists of Set of states Set of inputs, set of outputs I a b A B Initial state Set of transitions Only one can be true at a time FSM representations: State diagram State table 48

FSM Example Wait u= s s ar ab ag ar Inputs: s,r,g,b,a; Outputs: u Is this FSM fully defined? A. Yes B. No Start a u= ar Red1 u= ab Blue ag Green ar Red2 a u= a u= a u=1 u= s Wait s Watch for transition properties! (note that more transitions need to be added) Start u= ar Red1 u= a ab ag ar Blue Green Red2 a a a u= u= u=1

FSM Controller Design Process with a Three Bit Counter Example 1. State Diagram 2. State Table 3. State Assignments 111 4. Excitation Table (present state, inputs; next state, outputs) 5. Circuit State Table with Assigned State Patterns C3 C2 C1 N3 N2 N1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "1" 1 1 3-bit up-counter FSM 11 Circuit 11 11 DQ DQ DQ 1 OUT1 OUT2 OUT3 5

Mealy and Moore Machines Mealy Machine: y i (t) = f i (X(t), S(t)) Moore Machine: y i (t) = f i (S(t)) s i (t+1) = g i (X(t), S(t)) x(t) C1 C2 y(t) x(t) C1 C2 y(t) Mealy Machine S(t) Moore Machine S(t)

A. Moore machine B. Mealy machine C. None of the above This Counter Design Is: OUT1 OUT2 OUT3 D Q D Q D Q "1"

Life on Mars? Mars rover has a binary input x. When it receives the input sequence x(t-2, t) = 1 from its life detection sensors, it means that the it has detected life on Mars and the output y(t) = 1, otherwise y(t) = (no life on Mars ). This pattern recognizer should have A.One state because it has one output B.One state because it has one input C.Two states because the input can be or 1 D.More than two states because. E.None of the above 53

Mars Life Recognizer FSM Which of the following diagrams is a correct Mealy solution for the 1 pattern recognizer on the Mars rover? 1/1 A. 1/ S / S1 / S2 / 1/ B. 1/ / S / S1 1/1 S2 1/ C. Both A and B are correct / D. None of the above 54

Pattern Recognizer 1 1/ S / 1/ Mars Life Recognizer FFs 1/1 S1 / S2 / x(t) C1 Mealy Machine What does state table need to show to design controls of C1? A.(current input x(t), current state S(t) vs. next state, S(t+1)) B.(current input, current state vs. current output y(t)) C.(current input, current state vs. current output, next state) D.None of the above C2 S(t) 55 y(t)

State Diagram => State Table with State Assignment 1/1 x(t) 1/ S / 1/ S1 / S2 / C1 C2 S(t) Mealy Machine y(t) S(t)\x 1 S S1, S, S1 S2, S, S2 S2, S,1 State Assignment S: S1: 1 S2: 1 S(t)\x 1 1,, 1 1,, 1 1,,1 Q 1 (t+1)q (t+1), y 56

State Diagram => State Table => Excitation Table => Circuit Q 1 (t) Q (t)\x 1 1,, 1 1,, 1 1,,1 x(t) C1 C2 S(t) Mealy Machine y(t) id Q 1 Q x D 1 D y 1 1 1 2 1 1 3 11 4 1 1 5 11 1 6 11 X X X 7 111 X X X 57

State Diagram => State Table => Excitation Table => Circuit id Q 1 Q x D 1 D y 1 1 1 2 1 1 3 11 4 1 1 5 11 1 6 11 X X X 7 111 X X X D1(t): x(t) Q 2 6 4 1 X 1 1 3 7 5 X D1(t) = x Q + x Q1 D (t)= Q 1Q x y= Q 1 x Q 1 58

State Diagram => State Table => Excitation Table => Circuit Q 1 Q x x Q D D1 D D Q Q Q Q Q Q1 y Q1 x x(t) D1(t) = x Q + x Q1 D (t)= Q 1Q x y= Q 1 x C1 C2 S(t) Mealy Machine y(t) 59

Moore FSM for the Mars Life Recognizer Which of the following diagrams is a correct Moore solution to the 1 pattern recognizer? 1/1 A. 1/ S / S1 / S2 / B. 1 S 1/ S1,1 S2 1 S3 1 1 C. Both A and B are correct D. None of the above 6

Moore Mars Life Recognizer: FF Input Specs Pattern Recognizer 1 1 S S1,1 S2 1 S3 1 x(t) C1 C2 S(t) y(t) 1 Moore Machine What does state table need to show to design controls of C2? A.(current input x(t), current state S(t) vs. next state, S(t+1)) B.(current input, current state vs. current output y(t)) C.(current state vs. current output y(t) and next state) D.(current state vs. current output y(t) ) E.None of the above 61

1 S Moore Mars Life Recognizer: State Table,1 S1 1 S(t)\x 1 S S1, S, S1 S2, S, S2 S2, S3, S3 S,1 S,1 Q 1 Q \x 1 1,, 1 1,, 1 1, 11, 11,1,1 Q 1 (t+1)q (t+1), y S2 1 S3 1 ID Q 1 Q x D 1 D y 1 1 1 2 1 1 3 11 4 1 1 5 11 1 1 6 11 1 7 111 1

Mars Life Recognizer: Combinational Circuit Design id Q 1 Q x D 1 D y 1 1 1 2 1 1 3 11 4 1 1 5 11 1 1 6 11 1 7 111 1 D1(t): D(t): y(t): x(t) x(t) x(t) Q 2 6 4 1 1 1 3 7 5 1 Q 1 Q 2 6 4 1 1 3 7 5 1 Q 1 Q 2 6 4 1 1 3 7 5 1 Q Sources: TSR, Katz, 1 Boriello & Vahid

Mars Life Recognizer Circuit Implementation State Diagram => State Table => Excitation Table => Circuit D D1 D D Q Q Q Q Q Q1 y x(t) C1 C2 y(t) S(t) Moore Machine 64