EECS150 - Digital Design Lecture 18 - Counters

Similar documents
EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (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.

CHW 261: Logic Design

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

ECE 341. Lecture # 3

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

Digital Circuits ECS 371

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

Digital Fundamentals

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

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.

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

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Digital Fundamentals

Models for representing sequential circuits

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

Sample Test Paper - I

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

PGT104 Digital Electronics. PGT104 Digital Electronics

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

Philadelphia University Student Name: Student Number:

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

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

Philadelphia University Student Name: Student Number:

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

Logic Design II (17.342) Spring Lecture Outline

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

Shift Register Counters

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

Example: vending machine

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

Chapter 6. Synchronous Sequential Circuits

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

EGR224 F 18 Assignment #4

Digital Electronics Circuits 2017

Finite State Machine (FSM)

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

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

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

Lecture 7: Logic design. Combinational logic circuits

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

Fundamentals of Boolean Algebra

ELCT201: DIGITAL LOGIC DESIGN

Preparation of Examination Questions and Exercises: Solutions

Unit 7 Sequential Circuits (Flip Flop, Registers)

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

CPE100: Digital Logic Design I

Different encodings generate different circuits

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

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

Digital Logic Appendix A

Chapter 7. Sequential Circuits Registers, Counters, RAM

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

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

Chapter #7: Sequential Logic Case Studies Contemporary Logic Design

EECS150 - Digital Design Lecture 21 - Design Blocks

Written exam with solutions IE Digital Design Friday 21/

DE58/DC58 LOGIC DESIGN DEC 2014

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

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

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

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

Analysis of clocked sequential networks

Generalized FSM model: Moore and Mealy

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

Digital Logic Design - Chapter 4

Sequential Logic Worksheet

EXPERIMENT Bit Binary Sequential Multiplier

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.

EEE2135 Digital Logic Design

FSM model for sequential circuits

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

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

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

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

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

EE 209 Logic Cumulative Exam Name:

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Decoding A Counter. svbitec.wordpress.com 1

Synchronous Sequential Circuit Design

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

I. Motivation & Examples

FYSE420 DIGITAL ELECTRONICS


Transcription:

EECS150 - Digital Design Lecture 18 - Counters October 24, 2002 John Wawrzynek Fall 2002 EECS150 - Lec18-counters 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 Fall 2002 EECS150 - Lec18-counters Page 2

What are they used? Examples from this semester: Clock divider circuits 16MHz 64 Network packet parser/filter control. Bit-serial multiplier control circuitry (from HW) 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. Fall 2002 EECS150 - Lec18-counters 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. Fall 2002 EECS150 - Lec18-counters 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 asserted when 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 Fall 2002 EECS150 - Lec18-counters 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 Fall 2002 EECS150 - Lec18-counters Page 6

How do we design counters? For binary counters (most common case) incrementer 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... Fall 2002 EECS150 - Lec18-counters 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. A T flip-flop is a toggle flip-flop. Flips it state on cycles when T=1. Fall 2002 EECS150 - Lec18-counters Page 8

Synchronous Counters All outputs change with clock edge. 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 Fall 2002 EECS150 - Lec18-counters Page 9

Synchronous Counters How do we extend to n-bits? 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. Fall 2002 EECS150 - Lec18-counters 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 Fall 2002 EECS150 - Lec18-counters Page 11

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 Fall 2002 EECS150 - Lec18-counters Page 12

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? Fall 2002 EECS150 - Lec18-counters Page 13

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 Fall 2002 EECS150 - Lec18-counters Page 14

Ring Counters Fall 2002 EECS150 - Lec18-counters Page 15

Johnson Counter Fall 2002 EECS150 - Lec18-counters Page 16

Register Summary All registers (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 Fall 2002 EECS150 - Lec18-counters Page 17

Parallel load shift register: Shift-registers 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 ) Fall 2002 EECS150 - Lec18-counters Page 18

Universal Sift-register Fall 2002 EECS150 - Lec18-counters Page 19