Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann



Similar documents
Systems I: Computer Organization and Architecture

Counters are sequential circuits which "count" through a specific state sequence.

Digital Logic Design Sequential circuits

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Module 3: Floyd, Digital Fundamental

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Counters & Shift Registers Chapter 8 of R.P Jain

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Asynchronous Counters. Asynchronous Counters

Lecture 8: Synchronous Digital Systems

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Counters and Decoders

Flip-Flops, Registers, Counters, and a Simple Processor

Contents COUNTER. Unit III- Counters

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

Registers & Counters

Memory Elements. Combinational logic cannot remember

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

ASYNCHRONOUS COUNTERS

BINARY CODED DECIMAL: B.C.D.

DEPARTMENT OF INFORMATION TECHNLOGY

Asynchronous counters, except for the first block, work independently from a system clock.

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

Chapter 8. Sequential Circuits for Registers and Counters

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Lecture-3 MEMORY: Development of Memory:

Chapter 9 Latches, Flip-Flops, and Timers

Counters. Present State Next State A B A B

CpE358/CS381. Switching Theory and Logical Design. Class 10

Chapter 5. Sequential Logic

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Operating Manual Ver.1.1

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Sequential Logic Design Principles.Latches and Flip-Flops

DATA SHEET. HEF40193B MSI 4-bit up/down binary counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

Systems I: Computer Organization and Architecture

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

(Refer Slide Time: 00:01:16 min)

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

Wiki Lab Book. This week is practice for wiki usage during the project.

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

CHAPTER 11 LATCHES AND FLIP-FLOPS

Lesson 12 Sequential Circuits: Flip-Flops

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Cascaded Counters. Page 1 BYU

Let s put together a Manual Processor

DM74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

Engr354: Digital Logic Circuits

DM74LS191 Synchronous 4-Bit Up/Down Counter with Mode Control

CSE140: Components and Design Techniques for Digital Systems

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

Lab 1: Study of Gates & Flip-flops

Modeling Registers and Counters

Standart TTL, Serie Art.Gruppe

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

74AC191 Up/Down Counter with Preset and Ripple Clock

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

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

The components. E3: Digital electronics. Goals:

74F168*, 74F169 4-bit up/down binary synchronous counter

BASIC COMPUTER ORGANIZATION AND DESIGN

Copyright Peter R. Rony All rights reserved.

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

Set-Reset (SR) Latch

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

CHAPTER 3 Boolean Algebra and Digital Logic

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

Fig1-1 2-bit asynchronous counter

Design Verification & Testing Design for Testability and Scan

[ 4 ] Logic Symbols and Truth Table

ECE380 Digital Logic

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

CONTENTS PREFACE 1 INTRODUCTION 1 2 NUMBER SYSTEMS AND CODES 25. vii

A New Paradigm for Synchronous State Machine Design in Verilog

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

Theory of Logic Circuits. Laboratory manual. Exercise 3

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

54191 DM54191 DM74191 Synchronous Up Down 4-Bit Binary Counter with Mode Control

Combinational Logic Design Process

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

SN54/74LS192 SN54/74LS193

8254 PROGRAMMABLE INTERVAL TIMER

Manchester Encoder-Decoder for Xilinx CPLDs

CSE140 Homework #7 - Solution

6-BIT UNIVERSAL UP/DOWN COUNTER

Upon completion of unit 1.1, students will be able to

Transcription:

Chapter 7 Registers & Register Transfers J. J. Shann J.J. Shann

Chapter Overview 7- Registers and Load Enable 7-2 Register Transfers 7-3 Register Transfer Operations 7-4 A Note for VHDL and Verilog Users Only 7-5 Microoperations 7-6 Microoperatrions on a Single Register 7-7 Register Cell Design 7-8 Multiplexer and Bus-Based Transfer for Multiple Registers 7-9 Serial Transfer and Microoperations 7- HDL Representation for Shift Registes and Counters VHDL 7- HDL Representation for Shift Registes and Counters Verilog 7-2 Chapter Summary J.J. Shann 7-2

Part I: Registers and Counters 7- Registers and Load Enable 7-6 Microoperatrions on a Single Register (Shift registers, Ripple counter, Synchronous binary counters, other counters) Part II: Register Transfers 7-2 Register Transfers 7-3 Register Transfer Operations 7-5 Microoperations 7-7 Register Cell Design 7-6 Microoperatrions on a Single Register (Multiplexer-Based Transfers) 7-8 Multiplexer and Bus-Based Transfer for Multiple Registers 7-9 Serial Transfer and Microoperations 7-2 Chapter Summary J.J. Shann 7-3

Part I Registers and Counters J.J. Shann

Clocked seq ckt: sync seq ckt consists of a group of flip-flops and combinational gates connected to form a feedback path. Flip-flops + Combinational gates (essential) (optional) Register: consists of a group of flip-flops capable of storing binary information and gates that determine how the information is transferred into the register. Counter: is essentially a register that goes through a predetermined sequence of states. J.J. Shann 7-5

Lecture Contents A. Simplest register ( 7-) B. Register with parallel load ( 7-) C. Shift registers ( 7-6) D. Ripple counter ( 7-6) E. Synchronous binary counters ( 7-6) F. Other counters ( 7-6) J.J. Shann 7-6

A. Simplest Register ( 7-) Simplest register: consists of only flip-flops w/o any gates. E.g.: a 4-bit register with asynchronous clear input J.J. Shann 7-7

B. Register w/ Parallel Load ( 7-) Load Approach : Load control input through the C inputs of the f-fs clock gating Approach 2: Load control input through the D inputs of the f-fs J.J. Shann 7-8

Approach : Load control input through the C inputs of the f-fs clock gating prevent the clock from reaching the clock input to the ckt if the contents of the reg are to be left unchanged C inputs = Load + Clock * Inserting gates in the clock pulse path produces different propagation delays b/t clock and the inputs of f-fs w/ and w/o clock gating. clock skew J.J. Shann 7-9

Approach 2: Load control input through the D inputs of the f-fs D i = Load I i + Load i (Load) E.g.: 4-bit register w/ parallel load J.J. Shann 7-

C. Shift Registers ( 7-6) Shift register: a register capable of shifting its binary information in one or both direction Simplest shift register: unidirectional J.J. Shann 7-

Shift Register w/ Parallel Load Shift register w/ parallel load: Functional table: D i = Shift Load i + Shift Load Ii + Shift i Clock J.J. Shann 7-2

E.g.: 4-bit shift register w/ parallel load D i = Shift Load + Shift Load + Shift i i I i J.J. Shann 7-3

Bidirectional Shift Register Bidirectional shift register direction = shl = shr direction SI of shr SO of shl CLK i + i i D i = direction A i+ + direction A i SO of shr SI of shl J.J. Shann 7-4

Bidirectional Shift Reg w/ Parallel Load Bidirectional shift register w/ parallel load: Mode control Register S S operation No change Shift down Shift up Parallel load J.J. Shann 7-5

D. Ripple Counters ( 7-6) Counter: a register that goes through a prescribed sequence of states upon the application of input pulses: Input pulses: may be clock pulses or originate from some external source Timing: may occur at regular or irregular intervals of time The sequence of states: may follow the binary number sequence ( Binary counter) or any other sequence of states J.J. Shann 7-6

Categories of counters:. Ripple counters: The flip-flop output transition serves as a source for triggering other flip-flops. The C input of some or all flip-flops are triggered not by the common clock pulses. (not synchronous) 2. Synchronous counters: (E) The C inputs of all flip-flops receive the common clock. * T or JK flip-flops J.J. Shann 7-7

Binary Ripple Counter Binary count-up counter: E.g.: 4-bit binary count-up ripple counter J.J. Shann 7-8

Observations: FF : C = Clock pulse D = FF : C = ( ) ( ) D = FF 2 : FF 3 : C 2 = ( ) ( ) D 2 = 2 C 3 = 2 ( ) 2 ( ) D 3 = 3 2 3 J.J. Shann 7-9

2 3 J.J. Shann 7-2

* Problem of ripple counter: Accumulation of propagation delay E.g.: 2-bit binary count-up ripple counter CP 2 2 3 3 J.J. Shann 7-2

Binary count-down counter: E.g.: 4-bit binary count-down ripple counter Downward Counting Sequence * Modify the figure in p.7-9: Connect the true output of each f-f to the C input of the next f-f. J.J. Shann 7-22

Summary: are asynchronous ckts Adv.: simple hardware Disadv.: become ckt w/ delay dependence and unreliable op large ripple counters can be slow ckts the length of time required for the ripple to finish J.J. Shann 7-23

E. Synchronous Counters ( 7-6) Sync counter: A common clock triggers all flip-flops simultaneously. Symbol: Design procedure: We can apply the same procedure of sync seq ckts. Sync counter is simpler than general sync seq ckts. No need to go through a sync seq logic design process. J.J. Shann 7-24

Example E.g.: 4-bit sync count-up binary counter w/ count enable line Approach : design procedure of sync seq ckt (Ch6) Present state Nest state EN = EN = Output CO D EN = + EN = EN D = ( EN) D2 = 2 ( EN) D3 = 3 ( 2 EN) CO = 3 2 CO: is used to extend the counter to more stages J.J. Shann 7-25

J.J. Shann 7-26 Approach 2: observation ) ( EN D = ) ( 2 2 EN D = ) ( 2 3 3 EN D = 2 3 CO = EN EN D = + = EN

Approach 3: an incrementer (Ch5) + D f-fs D 3 D 2 D D = 3 2 + EN Incrementer D = EN D = ( EN ) D2 = 2 ( EN) D3 = 3 ( 2 EN) CO = 3 2 J.J. Shann 7-27

Alternative Designs for Binary Counters Two alternative designs for binary counters: Serial counter: serial gating (p.7-27) Parallel counter: parallel gating lookahead * analogous to the ripple carry adder C C 2 * analogous to the carry lookahead adder ripple C 3 J.J. Shann 7-28

Binary Counter by Using JK Flip-Flops E.g.: 4-bit count-up binary counter w/ JK f-fs Binary count sequence: 3-bit A 2 A A J.J. Shann 7-29

A 2 A A J = K = EN J = K = EN A J 2 = K 2 = EN A A J 3 = K 3 = EN A 2 A A J.J. Shann 7-3

Up-Down Binary Counter Up-down binary counter: E.g.: 4-bit up-down binary counter J.J. Shann 7-3

Up-ward counting: (p.7-24) Down-ward counting: D = EN D ) D = EN = ( EN D ) = ( EN D2 = 2 ( EN) D3 = 3 ( 2 EN) D2 = 2 ( EN) D3 = 3 ( 2 EN) J.J. Shann 7-32

J.J. Shann 7-33 EN D = ) ) (( EN S S D + = ) ) (( 2 2 EN S S D + = ) ) (( 2 2 3 3 EN S S D + = S = up-counting down-counting EN D = ) ( EN D = ) ( 2 2 EN D = ) ( 2 3 3 EN D = EN D = ) ( EN D = ) ( 2 2 EN D = ) ( 2 3 3 EN D = Up-ward counting: Down-ward counting: Up-down counter:

Binary Counter w/ Parallel Load E.g.: 4-bit count-up binary counter w/ parallel load Function table: Load Count 3+ 2+ + + 3 2 3 2 + I 3 I 2 I I J.J. Shann 7-34

E.g.: 4-bit count-up binary counter w/ parallel load D = EN D = ( EN) D2 = 2 ( EN) D3 = 3 ( 2 EN) w/o parallel load J.J. Shann 7-35

E.g.: 4-bit count-up binary counter w/ parallel load D () w/o parallel load J.J. Shann 7-36

Generating Other Count Sequences Generate any count sequence: E.g.: design a BCD counter by using a counter w/ parallel load & async clear J.J. Shann 7-37

J.J. Shann 7-38

F. Other Counters ( 7-6) Counters: can be designed to generate any desired sequence of states Binary counter (D, E) BCD counter Divide-by-N counter: modulo-n counter a counter that goes through a repeated sequence of N states The sequence may follow the binary count or may be any other arbitrary sequence. J.J. Shann 7-39

BCD Counter State diagram & Count sequence: 8 4 2 J.J. Shann 7-4

補 充 資 料 : BCD ripple counter (p.7-37~7-38) 8 4 2 Observations: : 2 : 4 : 8 : C = Count J = K = C 2 = ( ) 8 =, J 2 =, K 2 = (Toggle) 8 =, J 2 =, K 2 = (Reset) J 2 = 8, K 2 = C 4 = 2 ( ) J = K = C 8 = ( ) 4 2 =, J 2 =, K 2 = (Toggle) 4 2 =, J 2 =, K 2 = (Reset) J 2 = 4 2, K 2 = J.J. Shann 7-4

Observations: : 2 : C = Count J = K = C 2 = ( ) 8 =, J 2 =, K 2 = (Toggle) 8 =, J 2 =, K 2 = (Reset) J 2 = 8, K 2 = 8 4 : 8 : C 4 = 2 ( ) J = K = C 8 = ( ) 4 2 =, J 2 =, K 2 = (Toggle) 4 2 =, J 2 =, K 2 = (Reset) J 2 = 4 2, K 2 = 2 4 J.J. Shann 7-42

Synchronous BCD Counter Synchronous BCD counter: E.g.: 4-bit sync BCD counter w/ D-type f-f D = D D 2 = 2 8 4 = 4 2 D = ( + 4) 8 8 8 2 Y = 8 J.J. Shann 7-43

E.g.: 4-bit sync BCD counter w/ T-type f-f T =, T 2 = 8, T 4 = 2, T 8 = 8 + 4 2, y = 8 J.J. Shann 7-44

Three-decade BCD counter: J.J. Shann 7-45

Counter w/ Unused States n flip-flops 2 n binary states Unused states: states that are not used in specifying the sequential ckt may be treated as don t-care conditions or may be assigned specific next states Self-correcting counter: Ensure that when a ckt enter one of its unused states, it eventually goes into one of the valid states after one or more clock pulses so it can resume normal operation. Analyze the ckt to determine the next state from an unused state after it is designed. J.J. Shann 7-46

Example: The simplified f-f input eqs: D A = A B D B = C D C = B C Two unused states: & J.J. Shann 7-47

The logic diagram & state diagram of the ckt: Analysis Unused states * Self-correcting! J.J. Shann 7-48

補 充 資 料 :Ring Counter Ring counter: a circular shift register w/ only one flip-flop being set at any particular time, all others are cleared (initial value = ) The single bit is shifted from one flip-flop to the next to produce the sequence of timing signals. E.g.: 4-bit ring counter T T T 2 T 3 J.J. Shann 7-49

Application of counters: Counters may be used to generate timing signals to control the sequence of operations in a digital system. Approaches for generation of 2 n timing signals:. a shift register (ring-counter) w/ 2 n flip-flops 2. an n-bit binary counter + an n-to-2 n -line decoder J.J. Shann 7-5

J.J. Shann 7-5

補 充 資 料 :Johnson Counter Ring counter vs. Switch-tail ring counter: Ring counter: a k-bit ring counter circulates a single bit among the flip-flops to provide k distinguishable states. Switch-tail ring counter: is a circular shift register w/ the complement output of the last flip-flop connected to the input of the first flip-flop a k-bit switch-tail ring counter will go through a sequence of 2k distinguishable states. (initial value = ) J.J. Shann 7-52

E.g.: 4-bit switch-tail ring counter C E A E AB CE T T 8 T 7 T. T 8 T 3 T 2 T 6 T 5 T 4 J.J. Shann 7-53

Johnson counter: a k-bit switch-tail ring counter + 2k 2-input decoding gates provide outputs for 2k timing signals E.g.: 4-bit Johnson counter T 8 T 7 T 6 T 5 T 4 T 3 T 2 T 8 2-input decoding gates A B C E 4-bit switch-tail ring counter The decoding follows a regular pattern: 2 inputs per decoding gate J.J. Shann 7-54

Disadv. of the switch-tail ring counter: If it finds itself in an unused state, it will persist to circulate in the invalid states and never find its way to a valid state. Not self-correcting! Unused states: 8 J.J. Shann 7-55

Analysis of the ckt: A + = D A = E B + = D B = A C + = D C = B E + = D E = C Binary-coded state table State diagram J.J. Shann 7-56

CE AB CE AB (Unused states) A + = E B + = A CE AB C + = B CE AB E + = C J.J. Shann 7-57

CE AB CE AB * Self-correcting! A + = E B + = A CE AB C + = (A + C)B CE AB E + = C J.J. Shann 7-58

Summary: Johnson counters can be constructed for any # of timing sequences: # of flip-flops = /2 (the # of timing signals) # of decoding gates = # of timing signals 2-input per gate J.J. Shann 7-59

7-2 Chapter Summary Registers Simplest register ( 7-) Register with parallel load ( 7-) Shift registers ( 7-6) Counters Ripple counter ( 7-6) Synchronous binary counters ( 7-6) Other counters ( 7-6) J.J. Shann 7-6

Homework Sections Exercises 7- ~ 2 7-6 7 ~ 22 Homework: 2, 5 Homework: 9, 4, 8, 2, 22 J.J. Shann 7-6