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

Similar documents
EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

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

EECS150 - Digital Design Lecture 23 - FSMs & Counters

EECS150 - Digital Design Lecture 16 Counters. Announcements

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

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

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

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

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

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

CHW 261: Logic Design

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

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

ECE 341. Lecture # 3

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

Digital Fundamentals

Digital Circuits ECS 371

Lecture 10: Synchronous Sequential Circuits Design

Professor Fearing EECS150/Problem Set Solution Fall 2013 Due at 10 am, Thu. Oct. 3 (homework box under stairs)

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

Sample Test Paper - I

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

Models for representing sequential circuits

Example: vending machine

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

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

Synchronous Sequential Circuit Design. Digital Computer Design

Philadelphia University Student Name: Student Number:

Philadelphia University Student Name: Student Number:

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

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

PGT104 Digital Electronics. PGT104 Digital Electronics

Logic Design II (17.342) Spring Lecture Outline

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

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

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

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

Digital Fundamentals

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

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

Chapter 6. Synchronous Sequential Circuits

Digital Electronics Circuits 2017

Shift Register Counters

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

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

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

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

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

Finite State Machine (FSM)

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

EEE2135 Digital Logic Design

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

Digital Logic Design - Chapter 5

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

DE58/DC58 LOGIC DESIGN DEC 2014

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

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

CPE100: Digital Logic Design I

Lecture 7: Logic design. Combinational logic circuits

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

Digital Logic Design - Chapter 4

Preparation of Examination Questions and Exercises: Solutions

Fundamentals of Boolean Algebra

EGR224 F 18 Assignment #4

Unit 7 Sequential Circuits (Flip Flop, Registers)

CPE100: Digital Logic Design I

ELCT201: DIGITAL LOGIC DESIGN

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

Chapter 7. Sequential Circuits Registers, Counters, RAM

Different encodings generate different circuits

EECS150 - Digital Design Lecture 15 SIFT2 + FSM. Recap and Outline

Digital Logic Appendix A

Design of Sequential Circuits

EECS150 - Digital Design Lecture 21 - Design Blocks

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

EE 209 Logic Cumulative Exam Name:

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

Chapter 5 Synchronous Sequential Logic

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

04. What is the Mod number of the counter circuit shown below? Assume initially reset.

Synchronous Sequential Circuit Design

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Analysis of clocked sequential networks

課程名稱 : 數位邏輯設計 P-1/ /6/11


Generalized FSM model: Moore and Mealy

Sequential logic and design

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

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

EXPERIMENT Bit Binary Sequential Multiplier

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

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

ECE380 Digital Logic. Synchronous sequential circuits

FSM model for sequential circuits

6 Synchronous State Machine Design

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Transcription:

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters) March 19&21, 2002 John Wawrzynek Spring 2002 EECS150 - Lec13-seq3 version 2 Page 1

Counters Special sequential circuits (FSMs) that sequence though a set outputs. Examples: binary counter: 000, 001, 010, 011, 100, 101, 110, 111, 000, 001, gray code counter: 000, 010, 110, 100, 101, 111, 011, 001, 000, 010, 110, one-hot counter: 0001, 0010, 0100, 1000, 0001, 0010, BCD counter: 0000, 0001, 0010,, 1001, 0000, 0001 pseudo-random sequence generators: 10, 01, 00, 11, 10, 01, 00,... Moore machines with ring structure to STD: S3 S0 S2 S1 Spring 2002 EECS150 - Lec13-seq3 version 2 Page 2

What are they used? Examples from this semester: Clock divider for UART circuit 16MHz 64 UART control (count to 8 between bit capture). Bit-serial multiplier control circuitry (from HW and quiz) In general: counters simplify controller design by providing a specific number of cycles of action, sometimes used in with a decoder to generate a sequence of control signals. Spring 2002 EECS150 - Lec13-seq3 version 2 Page 3

Bit-serial multiplier: shifta A register Controller using Counters shiftb B register FA sum carry D-FF reset 0 1 HI register shifthi shiftlow LOW register Control Algorithm: selectsum repeat n cycles { // outer (i) loop repeat n cycles{ // inner (j) loop shifta, selectsum, shifthi } shiftb, shifthi, shiftlow, reset Note: The occurrence of a control } signal x means x=1. The absence of x means x=0. Spring 2002 EECS150 - Lec13-seq3 version 2 Page 4

Controller using Counters State Transition Diagram: Assume presence of two counters. An i counter for the outer loop and j counter for inner loop. CLK RST START IDLE CE i,ce j RST i START CE counter TC TC i TC i INNER <inner contol> TC j TC is assured with the counter reaches it maximum count value. CE is clock enable. The counter increments its value on the rising edge of the clock if CE is asserted. OUTER <outer contol> CE i,ce j RST j CE i,ce j TC j Spring 2002 EECS150 - Lec13-seq3 version 2 Page 5

Controller using Counters Controller circuit implementation: Outputs: CE i = q 2 START IDLE S R q 0 CE j = q 1 RST i = q 0 RST j = q 2 TCi INNER S R q 1 creset shifta = q 1 shiftb = q 2 shiftlow = q 2 shifthi = q 1 + q 2 reset = q 2 TCj OUTER S R q 2 selectsum = q 1 Spring 2002 EECS150 - Lec13-seq3 version 2 Page 6

How do we design counters? For binary counters (most common case) incremented circuit would work: 1 + register In Verilog, a counter is specified as: x = x+1; This does not imply an adder An incrementer is simpler than an adder And a counter is simpler yet. In general, the best way to understand counter design is to think of them as FSMs, and follow general procedure. But before that... Spring 2002 EECS150 - Lec13-seq3 version 2 Page 7

Ripple counters A 3 A 2 A 1 A 0 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 time Each stage is 2 of previous. Look at output waveforms: CLK A 0 A 1 A 2 A 3 Often called asynchronous counters. Spring 2002 EECS150 - Lec13-seq3 version 2 Page 8

Synchronous Counters Binary Counter Design: Start with 3-bit version and generalize: c b a c + b + a + 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 0 0 a + = a b + = a b cb a 00 01 11 10 0 0 0 1 1 1 0 1 0 1 c + = a c + abc + b c = c(a +b ) + c (ab) = c(ab) + c (ab) = c ab a + b + c + a b c Spring 2002 EECS150 - Lec13-seq3 version 2 Page 9

How do we extend to n-bits? Synchronous Counters Extrapolate c + : d + = d abc, e + = e abcd a + b + c + d + a b c Has difficulty scaling (AND gate inputs grow with n) d CE TC a + b + c + d + a b c d CE is count enable, allows external control of counting, TC is terminal count, is asserted on highest value, allows cascading, external sensing of occurrence of max value. Spring 2002 EECS150 - Lec13-seq3 version 2 Page 10

Synchronous Counters CE a + b + c + d + TC How does this one scale? Delay grows α n a b c Generation of TC signals very similar to generation of carry signals in adder. Parallel Prefix circuit reduces delay: d a b c d e f g h log 2 n log 2 n TC a TC b TC c TC c TC d TC e TC f TC g Spring 2002 EECS150 - Lec13-seq3 version 2 Page 11

Binary Counter from JK FFs Spring 2002 EECS150 - Lec13-seq3 version 2 Page 12

Up-Down Counter c b a c + b + a + 0 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 Down-count Spring 2002 EECS150 - Lec13-seq3 version 2 Page 13

With Parallel Load Spring 2002 EECS150 - Lec13-seq3 version 2 Page 14

Odd Counts Extra combinational logic can be added to terminate count before max value is reached: Example: count to 12 reset 4-bit binary counter Alternative: load 4 4-bit binary counter TC = 11? = 11? Spring 2002 EECS150 - Lec13-seq3 version 2 Page 15

Ring Counters one-hot counters 0001, 0010, 0100, 1000, 0001, q 3 q 2 q 1 What are these good for? q 0 D Q D Q D Q D Q S R S R S R S R reset 0 0 0 0 Self-starting version: q 3 q 2 q 1 q 0 D Q D Q D Q D Q Spring 2002 EECS150 - Lec13-seq3 version 2 Page 16

Ring Counters Spring 2002 EECS150 - Lec13-seq3 version 2 Page 17

Johnson Counter Spring 2002 EECS150 - Lec13-seq3 version 2 Page 18

Register Summary All register (this semester) based on Flip-flops: q 3 q 2 q 1 q 0 D Q D Q D Q D Q S R S R S R S R reset 0 0 0 0 d 3 d 2 d 1 d 0 Load-enable is a popular option: q 3 q 2 q 1 q 0 reset load D Q D Q D Q D Q S R S R S R S R 0 0 0 0 0 0 0 0 1 1 1 1 Xilinx flip-flops employ a clock enable (CE) for same purpose. d 3 d 2 d 1 d 0 Spring 2002 EECS150 - Lec13-seq3 version 2 Page 19

Shift-registers Parallel load shift register: Parallel-to-serial converter Also, works as Serial-to-parallel converter, if q values are connected out. Also get used as controllers (ala ring counters ) Spring 2002 EECS150 - Lec13-seq3 version 2 Page 20

Universal Sift-register Spring 2002 EECS150 - Lec13-seq3 version 2 Page 21