Stop Watch (System Controller Approach)

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

CHW 261: Logic Design

EXPERIMENT Bit Binary Sequential Multiplier

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

Sequential Logic Design: Controllers

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

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

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

Digital Fundamentals

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

ALU, Latches and Flip-Flops

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

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

Metastability. Introduction. Metastability. in Altera Devices

CSE140: Design of Sequential Logic

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

EET 310 Flip-Flops 11/17/2011 1

Lecture 10: Synchronous Sequential Circuits Design

Exercise booklet - Logic

Preparation of Examination Questions and Exercises: Solutions

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

Digital Electronics Final Examination. Part A

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

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Sequential Logic Worksheet

ELCT201: DIGITAL LOGIC DESIGN

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

EEE2135 Digital Logic Design

Digital Fundamentals

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Digital Circuits ECS 371

Digital Electronics Circuits 2017

Digital Electronics. Part A

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

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

Models for representing sequential circuits

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

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

Chapter 7. Sequential Circuits Registers, Counters, RAM

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

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Topics for Lecture #9. Button input processor

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

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

Synchronous Sequential Circuit Design. Digital Computer Design

7 Multipliers and their VHDL representation

5. Sequential Logic x Computation Structures Part 1 Digital Circuits. Copyright 2015 MIT EECS

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Digital Electronics Sequential Logic

Topic 8: Sequential Circuits

Adders, subtractors comparators, multipliers and other ALU elements

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

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

UNIVERSITY OF CALIFORNIA

Fundamentals of Digital Design

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

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

Digital Logic Design - Chapter 5

Logic Design II (17.342) Spring Lecture Outline

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

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

Counters. Clocked sequential circuit whose state diagram contains a single cycle. Modulus number of states in the cycle. Counters with nonpower

Analysis of clocked sequential networks

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

Chapter 7 Sequential Logic

Adders, subtractors comparators, multipliers and other ALU elements

Shift Register Counters

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

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

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

CHAPTER 9: SEQUENTIAL CIRCUITS

Experiment 9 Sequential Circuits

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

Decoding A Counter. svbitec.wordpress.com 1


State Graphs FSMs. Page 1

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

6 Synchronous State Machine Design

Issues on Timing and Clocking

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

Clock Strategy. VLSI System Design NCKUEE-KJLEE

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

Chapter 6. Synchronous Sequential Circuits

Sample Test Paper - I

Spiral 2-1. Datapath Components: Counters Adders Design Example: Crosswalk Controller

Digital Logic Design - Chapter 4

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Timing Issues. Digital Integrated Circuits A Design Perspective. Jan M. Rabaey Anantha Chandrakasan Borivoje Nikolić. January 2003

EE201l Homework #8. Datapath Design

Sequential vs. Combinational

State and Finite State Machines

Transcription:

Stop Watch (System Controller Approach)

Problem Design a stop watch that can measure times taken for two events Inputs CLK = 6 Hz RESET: Asynchronously reset everything X: comes from push button First Push: Start timer Second Push: Store the time taken for the first event Third Push: Store the time taken for the second event SEL: select output (High: first event time, Low: second event time) Outputs Two decimal digits to be connected to two seven segment displays Can display ~ 99

Overall Architecture Design CLK TENSEC SEC RESET X SEL Which LBB (among those we learn in the class) and how many? How to decompose the whole system into data part and control part?

Design System Architecture First step: divide the system into a control unit and data unit Data unit stores, routes, combines, and generally process data Control unit starting & stopping the process, testing conditions, and deciding what to do next

System controller design

Table (Variable Entered Table) P.S. N.S. Output State symbol Q Q D D S S ENCNT A B C unused

Excitation Eqs, Output Eqs Q Q D= D= Q Q Q S= S= ENCNT=

Alternative (VHDL program)

4-bit Serial Adder (Decomposing state machines, synchronous design methodology, system controller design)

Review of combinational adders -bit full adder and 4-bit ripple adder

Binary serial adder Serial input feed (two data streams A and B) Generate serial output CLR clear the previous carry synchronously A i CLR HOLD S i HOLD hold the previous value of the carry B i Carry

Binary serial adder implementation LS83: dual bit full adders carry A B Q(Carry) S

Problem Statement Design a 4-bit adder based on a serial approach Parallel feed of X and X2 Parallel out of Y comes out after few cycles Final carry available X X 2 4 4 START may be long (External guy will negate START only after detecting DONE) START CONTROL 4-bit adder 4 DONE if CONTROL=, X plus X 2 Y if CONTROL=, X plus Y Y CARRY Y

Start from LBB Here, we have some basic building blocks in mind 4-bit shift registers, binary serial adder, etc Tie these elements together and make them controllable from the outside world We want to take maximum advantage of common building blocks (MSI chips that are available)

Design System Architecture First step: divide the system into a control unit and data unit Data unit stores, routes, combines, and generally process data Control unit starting & stopping the process, testing conditions, and deciding what to do next

Data unit & Control unit X X 2 4 4 START Shift register Shift register 4 Y CONTROL Binary serial adder Carry Control unit Data unit DONE

Architecture X RIN A B C D S S LIN SYSCLK CLR Q A Q B Q C Q D 74LS94 CLR HOLD X2 Ai Bi Binary Serial Adder Si RIN A B C D S S LIN SYSCLK CARRY SYSCLK CLR Q A Q B Q C Q D 74LS94 CARRY Y START Control Unit DONE CONTROL

Decomposing state machine Second step: the state machine part (control unit) can be decomposed into several parts Main machine (system controller) provides the primary inputs and outputs and does top level control Submachines perform lower-level steps under control of main machine Typical submachine counter Saves 2 n states in main machine Easier to follow the control 2 bit counter to count # of bits added Our system controller

Architecture X S S RIN A B C D S S LIN CLR_L HOLD_L SYSCLK CLR Q A Q B Q C Q D 74LS94 CLR HOLD X 2 S 2 S 2 SYSCLK Ai Bi Binary Serial Adder Si RIN A B C D S S LIN SYSCLK CLR Q A Q B Q C Q D 74LS94 CARRY Y 3 Y 2 Y Y C4 START CONTROL System Controller DONE CLRCNTR CLRCNTR_L SYSCLK D C B A CLR 74LS63 RCO Q D Q C Q B Q A LOAD EnP EnT S S S 2 S 2 CLR HOLD C4

System controller design a b c d START CLRCNTR HOLD DONE,, START CLR X CONTROL S S X S S else Hold),, Load (if ), (Load 2 2 2 ), (Shift ), (Shift 2 2 2 X S S X S S C4 C4 START (?),, CLRCNT HOLD DONE START

Example results (5) + () ------------- (6) Sate Carry Reg Reg 2 Counter a - - - b - - - c c 2 c 3 c 4 d 5

State assignment and Transition Table QQ QQ (DD) DONE CLRCNTR CLR HOLD S S S2 S2 a ST x x b x CONT CONT c C4 d ST x x x

Excitation and Output Eqs. ST ST C4 D = Q + ST Q D = QQ + Q ST + Q C 4 x x DONE = CLRCNTR = CLR = HOLD = x x c c x x S = S = S 2 = Q Q CONTROL S + 2 = Q CONTROL QQ

Logic Diagram

Asynchronous Inputs and Output Glitches Things to watch out for in synchronous design Clock skew Gating the clock Asynchronous inputs Output glitches

Example Binary counting order for our previous state SS(Load X), assignment DONE, HOLD, CLRCNTR START START CLR a b S S (if CONTROL Load X, else Hold), 2 2 2 START DONE, HOLD d c S S (Shift X ), S S (Shift X ), 2 2 2 START C4 C4 QQ QQ (DD) DONE CLRCNTR CLR HOLD S S S2 S2 a ST x x b x CONT CONT c C4 d ST ST x x x

Focus on part of solution ST - ST C4 ST - D = Q Q + QQ + ST Q D = ST Q Q + ST QQ + C4 Q Q DONE = Q Q + QQ S = Q ST SYSCLK D DONE ST D S ST SYSCLK C4

Asynchronous START Is START synchronous or asynchronous? Could be either Assume asynchronous (comes from another system not using same SYSCLK) Look at transition from to by negating START What happens if t s, t h of D f/fs are not satisfied due to asynchronous START? Usually stay at or go to Problem? early change to START= => late change to START= => Problem: unexpected results can happen Delays not equal, f/fs different Generally could do either if t s, t h not satisfied on occasion

Synchronize START (Synchronizer) START D START _ SYNC SYSCLK Change right after SYSCLK edge, so START_SYNC will satisfy t s, t h of f/fs ST Q SYSCLK D DONE ST D S ST SYSCLK C4

Additional Problem? What else besides START_SYNC= or? Metastable stuck in middle for a while What happen if START does not satisfy t s, t h of Synchronizer D f/f START_SYNC not or not for a while Metastability real problem (early versions of several microprocessor chips had this problem!) Synchronizer Failure and Metastability Solutions?

Output Glitch on DONE Look at transition between b= and c= One f/f change at a time because slightly different delay s For a moment in the transition from to = or DONE= between states b ( ) and c ( ) SYSCLK DONE Problem? May or may not. DONE is used for synchronous inputs of other parts not likely the problem What if DONE is used for asynchronous CLR of other parts?

START Put a register (Stabilizer) on output One D f/f on DONE START _ SYNC DONE _ REG D D SYSCLK SYSCLK ST Q SYSCLK D DONE ST D S ST SYSCLK C4

Work? DONE_REG delayed usually no problem SYSCLK DONE DONE_REG Register output not always needed Good state assignment (compare this with our first state assignment) Some good output logics (e.g., S)

Synchronous Design Methodology (Summary) All LBBs and f/fs are clocked by the same common clock signal We use guaranteed LBBs and f/fs by the manufacturer (critical race free!!) Glitches on combinational circuits connecting LBBs and f/fs have no effect, since the control inputs are sampled only after the glitches have had a chance to settle out Three tasks to ensure reliable system operation Minimize and determine the amount of clock skew Ensure that f/fs have positive setup- and hold-time margins Identifying asynchronous inputs, synchronize them with the clock Filter any problematic output glitches with output stabilizers