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

Similar documents
ELCT201: DIGITAL LOGIC DESIGN

ELCT201: DIGITAL LOGIC DESIGN

Chapter 5 Synchronous Sequential Logic

Chapter 7. Sequential Circuits Registers, Counters, RAM

Decoding A Counter. svbitec.wordpress.com 1

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Chapter 7 Sequential Logic

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

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

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

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

PGT104 Digital Electronics. PGT104 Digital Electronics

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Design of Sequential Circuits

Synchronous Sequential Logic

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

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

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

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

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

Time Allowed 3:00 hrs. April, pages

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

Digital Circuits and Systems

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

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

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

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

Sequential vs. Combinational

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

Lecture 17: Designing Sequential Systems Using Flip Flops

Sequential Circuits Sequential circuits combinational circuits state gate delay

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

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

Fundamentals of Digital Design

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

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

Topics for Lecture #9. Button input processor

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

ECE 341. Lecture # 3

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

Sequential Circuit Design

FSM model for sequential circuits

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

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

Digital Electronics Sequential Logic

I. Motivation & Examples

Chapter 4. Sequential Logic Circuits

CHW 261: Logic Design

SYNCHRONOUS SEQUENTIAL CIRCUITS

Unit 7 Sequential Circuits (Flip Flop, Registers)

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Lecture 7: Logic design. Combinational logic circuits

Sequential Logic Circuits

Philadelphia University Student Name: Student Number:

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Philadelphia University Student Name: Student Number:

Layout of 7400-series Chips Commonly Used in. CDA 3101: Introduction to Computer Hardware and Organization

Sequential Circuit Analysis

Chapter 7 Logic Circuits

Synchronous Sequential Logic. Chapter 5

Lecture 10: Synchronous Sequential Circuits Design

Chapter 7. Synchronous Sequential Networks. Excitation for

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

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

Synchronous Sequential Logic Part I. BME208 Logic Circuits Yalçın İŞLER

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

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

EE141- Spring 2007 Digital Integrated Circuits

Sample Test Paper - I

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

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

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

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Exam for Physics 4051, October 31, 2008

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

Digital Design. Sequential Logic

Fundamentals of Boolean Algebra

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

Sequential Logic Worksheet

ALU, Latches and Flip-Flops

Topic 8: Sequential Circuits

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Experiment 9 Sequential Circuits

Lecture (08) Synchronous Sequential Logic

Adders, subtractors comparators, multipliers and other ALU elements

ELE2120 Digital Circuits and Systems. Tutorial Note 9

Integrated Circuits & Systems

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

Chapter #7: Sequential Logic Case Studies Contemporary Logic Design

Digital Circuits ECS 371

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

Digital Logic Design - Chapter 4

EECS150 - Digital Design Lecture 16 Counters. Announcements

Shift Register Counters

Vidyalankar S.E. Sem. III [EXTC] Digital Electronics Prelim Question Paper Solution ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD = B

EE 209 Spiral 1 Exam Solutions Name:

Synchronous Sequential Logic Part I

Lecture 3 Review on Digital Logic (Part 2)

Transcription:

EE 224: INTROUCTION TO IGITAL CIRCUITS & COMPUTER ESIGN Lecture 6: Sequential Logic 3 Registers & Counters 05/10/2010 Avinash Kodi, kodi@ohio.edu Introduction 2 A Flip-Flop stores one bit of information when a set of n Flip Flops is used to store n bits of data, we refer to them as REGISTER Common usage includes Holding an output value from an arithmetic circuit (data registers) Holding a count value in a counter circuit (Program Counter) Keeping addresses for memory locations (Index Registers) Many more. A common clock signal is typically used for each FF in a register 1

ata Transfer 3 ata transfer is a common function in computer systems Parallel transfer: n-bits (full register contents) at a time Serial transfer: 1-bit at a time (bit-by-bit) It is possible to convert transfer types in special registers: Parallel-to-serial: load data into a register in one clock cycle (in parallel) but send out in series in n clock cycles Serial-to-parallel: receive data in n clock cycles but can be accessed to all contents in parallel (n-bits) ata Transfer 4 Serial Registers ata In ata Out ata Out ata In Serial In-Shift Right-Serial Out Serial In-Shift Left-Serial Out Parallel Registers ata In ata In ata In ata Out Parallel In-Serial Out ata Out Serial In-Parallel Out ata Out Parallel In-Parallel Out Rotate Registers Rotate Right Rotate Left 2

Registers with Parallel Loading 5 The simplest register consists of only FFs without external gates The transfer of data is referred to as loading the data Parallel loading if all the bits are loaded simultaneously with a common clock pulse 0 Q Q 0 R CLEAR 1 Q Q 1 R CLEAR REG 2 Q Q 2 0 Q 0 R 1 2 3 Q 1 Q 2 Q 3 Q 3 Q 3 R Registers with Parallel Loading 6 The master clock generator supplies a continuous train of clock pulses. When the register contents are to remain same the clock must be prevented from reaching the clock input. Thus, a separate control signal is used to activate register loading. Load Clock C inputs (Clock inputs of fff FFs) A 4-bit register with a control load input 3

Shift Registers 7 Capable of shifting its storage bits laterally in one or both directions. They consist of a chain of flip-flops in cascade, with the output of one FF connected to input of the next FF. All FF receive a common clock pulse, which activates the shift from each stage to the next. Serial In (SI) Q Q Q Q Serial Out (SO) Serial In-Serial Out A 4-bit register SRG 4 SI SO Serial ata Transfer 8 A digital system is said to operate in a serial mode when information in the system in transferring one bit at a time Shift Clock Shift Control Register A SRG 4 Register B SRG 4 Input 0 SO SI Output 4

9 Shift Example Assume that binary content of registers A before the shift is 1011 and that of B is 0010 and SI of register A is 0 Clock Shift Control Register A SRG 4 Register B SRG 4 Input 0 SO SI Output Registers with Serial Loading 10 Serial In (SI) Q Q Q Q Serial Out (SO) Serial In-Parallel Out Q 0 Q 1 Q 2 Q 3 A 4-bit register SRG 4 ata Input Q 0 Q 1 Q 2 Q 3 5

Registers with Parallel Loading 11 Parallel In Serial Out Shift Register with Shift/Load Control 12 Bidirectional Shift Registers The data can be shifted either left or right. It can be implemented by using gating logic that enables the transfer direction of a data bit from one stage to the next stage (to the right or to the left), depending on the level of control signal (R/L ). 6

Example Flip Flop Summary 14 Flip-Flop Characteristic Table K Flip-Flop K Q + Operation 0 0 Q No Change 0 1 0 Reset 1 0 1 Set 1 1 Q Complement Flip-Flop Q + Operation 0 0 Reset 1 1 Set SR Flip-Flop S R Q + Operation 0 0 Q No Change 0 1 0 Reset 1 0 1 Set 1 1? Undefined T Flip-Flop T Q + Operation 0 Q No Change 1 Q Complement 7

FF Transition Input Codes 15 Using FF state tables we can derive the input conditions that will cause specific transitions in each FF output 4 possible transitions: & T FFs have welldefined input conditions in each case -K FF has on t Care (X) conditions FF Outputs FF Inputs Q(t) Q(t+1) T -K 0 0 0 0 0-X 1 1-X Key to follow sequential logic circuit design examples (i.e. counters) 1 0 1 0 X-1 1 1 0 1 X-0 FF Excitation Table 16 Flip-Flop Excitation Table K Flip-Flop Q Q + K 0 0 0 X X 1 0 X 1 1 1 X 0 Flip-Flop Q Q + 0 0 0 1 0 0 1 1 1 SR Flip-Flop Q Q + S R 0 0 0 X 0 1 1 1 X 0 T Flip-Flop Q Q + T 0 0 0 1 0 1 1 1 0 8

Counters 17 A register that goes through a prescribed sequence of states upon the application of input pulses. The input pulses may be clock pulses or other sources, occurring at fixed or random intervals. An n-bit binary counter consists of n FF and can count in binary from 0 through 2 n -1. Counters can be of two types: Ripple counters: the FF output transition serves as a source for triggering other FF. Synchronous counter: the clock triggers all of the FFs Binary counters are most efficiently constructed with complementing T or K FFs. They also can be designed with FFs. 00 01 11 10 Two-bit backward counter Two-bit forward counter 11 10 00 01 17 Synchronous Counters: Example 1 18 The binary counters are constructed from T FFs All FFs are initially set to 0 T Flip-Flop The sequence of states are: Q Q + T 000, 001, 010, 011, 100, 101, 110, 111 Present Next State State C B A C + B + A + 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 FF Inputs T C T B T A 1 1 1 1 1 1 C BA 0 1 00 01 11 10 0 0 1 1 1 1 0 0 T B = A 0 0 0 1 0 1 1 1 0 C BA 0 1 00 01 11 10 0 0 0 0 1 1 0 0 T C = BA T A = 1 T B = A T C = BA 9

Synchronous Counters: Example 1 19 000 001 111 010 State iagram C B A C + B + A + 0 0 0 T C T B T A 110 011 0 1 0 0 1 0 101 100 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 State Table Note that there is NO external input variable in this circuit (besides Clk signal) and FF outputs determine counter output Synchronous Counter: Example 2 20 Use FFs instead of T FF 000, 001, 010, 011, 100, 101, 110, 111 Present Next State State C B A C + B + A + FF Inputs C B A Flip-Flop Q Q + 0 0 0 1 0 0 1 1 1 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 A = A + = A B = B + = BA +B A C = C + = C BA+CB +CA = C BA+C(B +A )= C BA+C(BA) 10

Synchronous Counters: Example 2 21 A B C = A = B + + ' = A ' ' = BA + B A = B A = C + = C ' BA + CB ' + CA ' = C ' BA + C( BA) ' = C BA Synchronous up-counter Note that XOR of FF output and input is equivalent to T FF (see previous notes on FF) Example 3: Up and own Counters 22 Up-down binary counter with FFs, with U & select bits for direction. Based on earlier examples, consider the modification: + A = A = A ( U + ) ) CBA C + B + + + U=1 =1 B = B = B ( UA + A') 000 001 111 + C = C = C ( UBA + B' A') 001 010 000 When U=0 and =1 down-counter, 010 011 001 (instead of A & BA we get A & B A ) 011 100 010 100 101 011 + ' 101 110 100 A = A = A 1 = A + ' 110 111 101 B = B = B A 111 000 110 + ' ' = C = C B A C When U=1 and =0 up-counter. See earlier When U=0 and =0 no change. ABC preserved When U=1 and =1 is not to be used 11

Example 3: Up and own Counters 23 Logic Circuit CBA C + B + A + U=1 =1 000 001 111 001 010 000 010 011 001 011 100 010 100 101 011 101 110 100 110 111 101 111 000 110 State Table State iagram Example 4: Synchronous Counters 24 esign a 4-bit synchronous counter using K FF K Flip-Flop Q Q + K 0 0 0 X X 1 0 X 1 1 1 X 0 12

Example 4: Synchronous Counters 25 on t care states It may be necessary to control the operation of the counter with a count-enable input. When EN=0, all and K inputs are equal to 0 and FFs remain in the same state. Example 4: Synchronous Counters 26 Q0 Q1 Q2 Q3 = K = K = K = K Q0 Q1 Q2 Q3 = EN = Q EN 0 = Q Q EN 0 = Q Q Q EN The FF in the least significant position of a synchronous binary counter is complemented with a clock pulse transition. 0 1 1 2 13

Example 4: Synchronous Counters 27 Logic Circuit Symbol Input Equations Q0 Q1 Q2 Q3 = K = K = K = K Q0 Q1 Q2 Q3 = EN = Q EN 0 = Q Q EN 0 = Q Q Q EN 0 1 1 2 28 Example 5: Arbitrary Counters with T FF Counters for other sequences with T FFs. Arbitrary Count Sequence. Present Next State State C B A C + B + A + FF Inputs T C T B T A 0 0 0 - - - 0 1 0 0 0 0 1 0 1 1 0 1 - - - 1 0 0 X X X X X X If these numbers represent a given pattern (say on a screen), then such arbitrary counting sequences may be useful for display purposes 1 1 0 - - - 1 1 1 0 1 0 X X X 1 0 1 on t care states Not completely specified 14

29 Example 5: Arbitrary Counters with T FF T Flip-Flop Q Q + T C B A C + B + A + 0 0 0 State Table T C T B T A 1 0 0 0 0 0 1 0 1 1 1 0 - - - 0 1 0 0 0 0 1 0 1 X X X C BA 0 1 00 1 0 1 0 1 - - - X X X C C BA 0 1 BA 1 0 - - - X X X 00 0 1 00 0 1 1 1 1 0 1 0 1 0 1 01 X X 01 X X 01 X X 11 0 1 11 1 0 11 1 1 10 0 X 10 0 X 10 1 X T C = C B + CB T B = C A + CB T A = C+ B 30 Example 5: Arbitrary Counters with T FF 001 state used to simplify X case: If occurs (initially) it will lead to 111 state. All else same FFs change state following the falling clock edge. 15

31 Example 6: Arbitrary Counters with K FF Input Equations = B K = B A B C = C = B K K A B C = 1 = 1 State iagram 16