Registers and Counters

Similar documents
Registers and Counters

Registers and Counters

Registers and Counters

MC9211 Computer Organization

Chapter 6 Registers and Counters

Synchronous Sequential Logic

Register Transfer Level in Verilog: Part II

Registers & Counters. BME208 Logic Circuits Yalçın İŞLER

Lecture 12. Amirali Baniasadi

Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

CSC Computer Architecture and Organization

Synchronous Sequential Logic

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Chapter 3 Unit Combinational

Sequencing and Control

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

CHAPTER1: Digital Logic Circuits

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

Registers and Counters

Logic Design. Flip Flops, Registers and Counters

Counter dan Register

Chapter 7 Counters and Registers

Vignana Bharathi Institute of Technology UNIT 4 DLD

CS T34-DIGITAL SYSTEM DESIGN Y2/S3

Chapter 4. Logic Design

Experiment 8 Introduction to Latches and Flip-Flops and registers

UNIVERSITI TEKNOLOGI MALAYSIA

Digital Logic Design ENEE x. Lecture 19

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

CHAPTER 4: Logic Circuits

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

CHAPTER 4: Logic Circuits

Chapter 5: Synchronous Sequential Logic

IT T35 Digital system desigm y - ii /s - iii

Chapter 2. Digital Circuits

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

Other Flip-Flops. Lecture 27 1

EET2411 DIGITAL ELECTRONICS

ELE2120 Digital Circuits and Systems. Tutorial Note 8

LSN 12 Shift Registers

Universal Asynchronous Receiver- Transmitter (UART)

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) COUNTERS

Sequential Logic Circuits

RS flip-flop using NOR gate

Counters

Flip-Flops and Sequential Circuit Design

Unit-5 Sequential Circuits - 1

Serial In/Serial Left/Serial Out Operation

Digital Systems Laboratory 3 Counters & Registers Time 4 hours

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

Logic Design II (17.342) Spring Lecture Outline

RS flip-flop using NOR gate

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

EE292: Fundamentals of ECE

Module -5 Sequential Logic Design

D Latch (Transparent Latch)

EKT 121/4 ELEKTRONIK DIGIT 1

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

ECE 341. Lecture # 2

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

ELCT201: DIGITAL LOGIC DESIGN

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Asynchronous (Ripple) Counters

ELEN Electronique numérique

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

B.Tech CSE Sem. 3 15CS202 DIGITAL SYSTEM DESIGN (Regulations 2015) UNIT -IV

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

Combinational vs Sequential

Chapter 3. Boolean Algebra and Digital Logic

Computer Organization & Architecture Lecture #5

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

ECE 263 Digital Systems, Fall 2015

Registers, Register Transfers and Counters Dr. Fethullah Karabiber

Lecture 8: Sequential Logic

UNIT IV. Sequential circuit


Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

Digital Fundamentals: A Systems Approach

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Contents Circuits... 1

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY CS 2202 DIGITAL PRINCIPLES AND SYSTEM DESIGN

Fall 2000 Chapter 5 Part 1

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

MODULE 3. Combinational & Sequential logic

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

CprE 281: Digital Logic

Switching Theory And Logic Design UNIT-IV SEQUENTIAL LOGIC CIRCUITS

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

ECE 172 Digital Systems. Chapter 2.2 Review: Ring Counter, Johnson Counter. Herbert G. Mayer, PSU Status 7/14/2018

Chapter 5 Sequential Circuits


Switching Circuits & Logic Design, Fall Final Examination (1/13/2012, 3:30pm~5:20pm)

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Scanned by CamScanner

Sequencing. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall,

Modeling Digital Systems with Verilog

Dr.Mohamed Elmahdy Winter 2015 Eng.Yasmin Mohamed. Problem Set 6. Analysis and Design of Clocked Sequential Circuits. Discussion: 7/11/ /11/2015

Transcription:

Registers and Counters ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2017 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/

Registers Shift Registers Ripple Counters Synchronous Counters Other Counter HDL Description Outlines DCD-06-2

Registers Clocked sequential circuits a group of flip-flops and combinational gates connected to form a feedback path Flip-flops + Combinational gates (essential) (optional) Register: a group of flip-flops gates that determine how the information is transferred into the register Counter: a register that goes through a predetermined sequence of states DCD-06-3

Four-Bit Register An n-bit register n flip-flops capable of storing n bits of binary information 4-bit register DCD-06-4

Four-bit Register with Parallel Load and No Change DCD-06-5

Shift Registers Shift register a register capable of shifting its binary information in one or both directions Simplest shift register 1 1 0 1 1 0 1 1 0 1 Four-bit shift register DCD-06-6

Transfer Serial transfer vs. Parallel transfer Serial transfer Information is transferred one bit at a time shift the bit out of the source register into the destination register Parallel transfer: All the bits of the register are transferred at the same time DCD-06-7

Serial Transfer from Reg A to Reg B 1 0 1 1 0 0 1 0 DCD-06-8

Serial Transfer from Reg A to Reg B DCD-06-9

Serial Adder Using D Flip-Flops 4-Bit SR 4-Bit SR DCD-06-10

Serial Adder Using D Flip-Flops Clk SC SI_B SO_B 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 SO_A 1 0 1 0 S 1 0 1 0 0 0 0 1 C 1 1 1 0 0101+0011=1000 DCD-06-11

Serial Adder Using JK Flip-Flops Digital Circuit Design J Q = x y K Q = x y = (x + y) S = x y Q DCD-06-12

Serial Adder Using JK Flip-Flops Digital Circuit Design Ci Second form of serial adder DCD-06-13

Universal Shift Register Shift Register Unidirectional shift register Bidirectional shift register Universal shift register: has both direction shifts & parallel load/out capabilities Capability of a universal shift register: 1. A clear control to clear the register to 0. 2. A clock input to synchronize the operations. 3. A shift-right control to enable the shift right operation and the serial input and output lines associated with the shift right. 4. A shift-left control to enable the shift left operation and the serial input and output lines associated with the shift left. 5. A parallel-load control to enable a parallel transfer and the n parallel input lines associated with the parallel transfer. 6. n parallel output lines. 7. A control state that leaves the information in the register unchanged in response to the clock. DCD-06-14

Four-Bit Universal Shift Register Clear s1 s0 A3+ A2+ A1+ A0+ (operation) 0 0 0 0 0 Clear 1 0 0 A3 A2 A1 A0 No change 1 0 1 sri A3 A2 A1 Shift right 1 1 0 A2 A1 A0 sli Shift left 1 1 1 I3 I2 I1 I0 Parallel load DCD-06-15

Four-Bit Universal Shift Register A 0 DCD-06-16

Ripple Counters 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 The sequence of states: may follow the binary number sequence ( Binary counter) or any other sequence of states Categories of counters Ripple counters: The flip-flop output transition serves as a source for triggering other flip-flops. no common clock pulse (not synchronous) Synchronous counters: The CLK inputs of all flip-flops receive a common clock. DCD-06-17

Four-Bit Binary Ripple Counter A simple complement flip-flop can be obtained: from a JK flip-flop with the J and K inputs tied together from T flip-flop use a D flip-flop with the complement output connected to the D input. Example: 0011=>0100 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 0 0 0 0 DCD-06-18

Four-Bit Binary Ripple Counter DCD-06-19

Timing Analysis of Binary Ripple Counter Digital Circuit Design Count A 0 0 1 0 1 0 1 0 1 0 1 0 1 A 1 0 0 1 1 0 0 1 1 0 0 1 1 A 2 0 0 0 0 1 1 1 1 0 0 0 0 A 3 0 0 0 0 0 0 0 0 1 1 1 1 DCD-06-20

BCD Ripple Counter Hint1: Q 1 changes state after each clock pulse. Hint 2: Q 2 complements every time Q 1 goes from 1 to 0 as long as Q 8 =0. When Q 8 becomes 1, Q 2 remains at 0. Hint 3: Q 4 complements every time Q 2 goes from 1 to 0. Hint 4: Q 8 remains at 0 as long as Q 2 or Q 4 is 0. When both Q 2 and Q 4 become 1, Q 8 complements when Q 1 goes from 1 to 0. Q 8 is cleared on the next transition of Q 1. DCD-06-21

Three-Decade BCD Ripple Counter Digital Circuit Design DCD-06-22

Synchronous Counters Synchronous counter A common clock triggers all flip-flops simultaneously. Design procedure apply the same procedure of sync seq ckts Sync counter is simpler than general sync seq ckts DCD-06-23

Four-Bit Sync. Binary Counter up down down A' 0 up A 0 down A' 0 A' 1 up A 0 A 1 down A' 0 A' 1 A' 2 Four-bit synchronous binary counter Four-bit up-down binary counter DCD-06-24

Timing Analysis of Sync. Binary Counter Digital Circuit Design Clk CE A 0 0 1 0 1 0 1 0 1 0 1 0 1 A 1 0 0 1 1 0 0 1 1 0 0 1 1 A 2 0 0 0 0 1 1 1 1 0 0 0 0 A 3 0 0 0 0 0 0 0 0 1 1 1 1 DCD-06-25

Sync. BCD Counters 1 0 1 0 X X X X X X X X X 1 0 1 1 X X X X X X X X X 1 1 0 0 X X X X X X X X X 1 1 0 1 X X X X X X X X X 1 1 1 0 X X X X X X X X X 1 1 1 1 X X X X X X X X X DCD-06-26

Sync. BCD Counters 1 T Q 1 T Q 2 T Q 4 T Q 8 C C C C y CLK Simplified functions: Need to consider other unused 6 cases DCD-06-27

Four-Bit Sync. Binary Counter with Parallel Load DCD-06-28

Four-Bit Sync. Binary Counter with Parallel Load DCD-06-29

Sync. BCD Counter with Parallel Load Generate any count sequence: E.g.: BCD counter Counter with parallel load Digital Circuit Design DCD-06-30

Other Counters Counters: can be designed to generate any desired sequence of states 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 n flip-flops 2 n binary states Unused states states that are not used in specifying the FSM may be treated as don t-care conditions or may be assigned specific next states Self-correcting counter Ensure that when a ckt enters 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 DCD-06-31

Counters with Unused States An example 0 1 1 1 0 0 1 X X 1 X 1 1 1 1 0 0 0 X 1 X 1 X 1 Two unused states: 011 & 111 The simplified flip-flop input eqs: J A = B, K A = B, J B = C, K B = 1, J C = B, K C = 1 DCD-06-32

Counter with Unsigned States DCD-06-33

Ring Counter Ring counter: a circular shift register with only one flip-flop being set at any particular time, all others are cleared (initial value = 1 0 0 0 ) The single bit is shifted from one flip-flop to the next to produce the sequence of timing signals. T 0 T 1 T 2 T 3 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 DCD-06-34

Ring Counter 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 Method 1: a shift register with 2 n flip-flops Method 2: an n-bit binary counter together w/ an n-to-2 n -line decoder DCD-06-35

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 = 0 0 0) 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. Johnson counter a k-bit switch-tail ring counter + 2k decoding gates provide outputs for 2k timing signals DCD-06-36

Johnson Counter DCD-06-37

HDL for Registers and Counters Shift Register Statement: A_par <= {MSB_in, A_par [3: 1]} specifies a concatenation of serial data input for a right shift operation (MSB_in) with bits A_par[3 : 1] of the output data bus. 38

HDL Example 6.1 (Universal Shift Register Behavioral Model) 39

Variables of type reg retain their value until they are assigned a new value by an assignment statement. Consider the following alternative case statement for the shift register model: 40

HDL Example 6.2 (Universal Shift Register Structural Model) 41

HDL Example 6.2 (2/3) Digital Circuit Design 42

HDL Example 6.2 (3/3) Digital Circuit Design 43

HDL Example 6.3 (Synchronous Counter) 44

HDL Example 6.4 (Ripple Counter) Digital Circuit Design 45

HDL Example 6.4 46

Simulation Output of HDL Example 6.4 47

Simulation Output of HDL Example 6.4 48

Conclusion From this lecture, you have learned the follows: Registers Shift Registers Ripple Counters Synchronous Counters Other Counter Verilog Design DCD-06-49