Registers and Counters

Slides:



Advertisements
Similar presentations
Lecture 23: Registers and Counters (2)
Advertisements

CSE 205: Digital Logic Design
Registers and Counters
CENG 241 Digital Design 1 Lecture 11
Registers and Counters
Logic and Computer Design Fundamentals Registers and Counters
ENGIN112 L27: Counters November 5, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 27 Counters.
Chapter 7 - Part 2 1 CPEN Digital System Design Chapter 7 – Registers and Register Transfers Part 2 – Counters, Register Cells, Buses, & Serial Operations.
CS370 Counters. Overview °Counter: A register that goes through a prescribed series of states °Counters are important components in computers. °Counters.
COE 202: Digital Logic Design Sequential Circuits Part 4 KFUPM Courtesy of Dr. Ahmad Almulhem.
Sequential Circuit Introduction to Counter
KU College of Engineering Elec 204: Digital Systems Design
A.Abhari CPS2131 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers:
Registers and Counters
Counters  A counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship.
Registers and Counters
Chapter 1_4 Part II Counters
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
EE345: Introduction to Microcontrollers Register and Counters Prof. Ahmad Abu-El-Haija.
Registers and Counters
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
Registers and Counters
Rabie A. Ramadan Lecture 3
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Counters By Taweesak Reungpeerakul
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 17 Dr. Shi Dept. of Electrical and Computer Engineering.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 7 – Registers.
7-6 단일 레지스터에서 Microoperation Multiplexer-Based Transfer  Register 가 서로 다른 시간에 둘 이상의 source 에서 data 를 받을 경우 If (K1=1) then (R0 ←R1) else if (K2=1) then.
 Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences.
ENG241 Digital Design Week #8 Registers and Counters.
Registers and Counters Chapter 6. Digital Circuits 2 Clocked sequential circuits a group of flip-flops and combinational gates connected to form a feedback.
Chap 5. Registers and Counters. Chap Definition of Register and Counter l a clocked sequential circuit o consist of a group of flip-flops & combinational.
Chapter 1_4 Part III more on … Counters Chapter 1_4 Part III more on … Counters.
REGISTER A register is a group of flip-flops. Each flip- flop is capable of storing one bit of informa­ tion. An n-bit register consists of a group of.
Chapter 1 Counters. Counters Counters are sequential circuits which "count” through a specific state sequence. They can count up, count down, or count.
CHAPTER 6 Sequential Circuits’ Analysis CHAPTER 6 Sequential Circuits’ Analysis Sichuan University Software College.
Registers and Counters
C HAPTER S IX R EGISTERS AND C OUNTERS 1. A clocked sequential circuit consists of a group of flip-flops and combinational gates connected to form a feedback.
Counters.
Basic Counters: Part I Section 7-6 (pp ).
Chap 5. Registers and Counters
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
Modular sequential logic Use latches, flip-flops and combinational logic –Flip-flops usually grouped to form a register Shift registers –n bits {x n …x.
Counters and registers Eng.Maha Alqubali. Registers Registers are groups of flip-flops, where each flip- flop is capable of storing one bit of information.
Logic Design (CE1111 ) Lecture 6 (Chapter 6) Registers &Counters Prepared by Dr. Lamiaa Elshenawy 1.
1 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers: parallel and.
Registers and Counters
6.
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
Sequential Logic Counters and Registers
Sequential Circuit: Counter
Chapter 7 – Registers and Register Transfers
Dr. Clincy Professor of CS
Instructor: Alexander Stoytchev
Digital System Design Review.
Registers and Counters
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
COE 202: Digital Logic Design Sequential Circuits Part 4
29-Nov-18 Counters Chapter 5 (Sections ).
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Registers and Register Transfers
6. Registers and Counters
Digital Logic Department of CNET Chapter-6
Digital Logic Department of CNET Chapter-6
Outline Registers Counters 5/11/2019.
Digital Electronics and Logic Design
Presentation transcript:

Registers and Counters

Overview Parallel Load Register Shift Registers Serial Load Serial Addition Shift Register with Parallel Load Bidirectional Shift Register

Registers and Counters An n-bit register = n flip-flops Capable of storing n bits of binary information. A counter is an FSM that goes through a predetermined sequence of states upon the application of clock pulses.

4-Bit Register

Register with parallel load

Shift Register

Serial data transfer Serial transfer of information from register A to register B

Serial addition using shift registers The two binary numbers to be added serially are stored in two shift registers. The sum bit on the S output of the full adder is transferred into the result register A.

Serial vs. parallel addition The parallel adder is a combinational circuit, whereas the serial adder is a sequential circuit. The parallel adder has n full adders whereas the serial adder requires only one full adder. The serial circuit takes n clock cycles to complete an addition. The serial adder, although it is n times slower, is n times smaller in space.

Shift register with parallel load

Shift register with parallel load Operation Nothing 1 Load parallel X Shift Q0  Q1, Q1Q2…

Bidirectional shift register S1S0 Action 00 Nothing 01 Shift down 10 Shift up 11 Parallel load

Bidirectional Shift Register

Counters A counter is a sequential circuit that goes through a predetermined sequence of states upon the application of clock pulses. Counters are categorized as: Synchronous Counter: All FFs receive the common clock pulse, and the change of state is determined from the present state. Ripple Counters: The FF output transition serves as a source for triggering other FFs. No common clock.

Synchronous Binary Counters The design procedure for a binary counter is the same as any other synchronous sequential circuit. Most efficient implementations usually use T-FFs or JK-FFs. We will examine JK and D flip-flop designs.

Synchronous Binary Counters: J-K Flip Flop Design of a 4-bit Binary Up Counter

Synchronous Binary Counters J-K Flip Flop Design of a Binary Up Counter (cont.)

Synchronous Binary Counters J-K Flip Flop Design of a Binary Up Counter (cont.)

Synchronous Binary Counters J-K Flip Flop Design of a Binary Up Counter (cont.)

Synchronous Binary Counters J-K Flip Flop Design of a Binary Up Counter (cont.) JQ0 = 1 KQ0 = 1 JQ1 = Q0 KQ1 = Q0 JQ2 = Q0 Q1 KQ2 = Q0 Q1 JQ3 = Q0 Q1 Q2 KQ3 = Q0 Q1 Q2 logic 1 Q0 J C K Q1 J C K Q2 J C K J Q3 C K CLK

Synchronous Binary Counters: J-K Flip Flop Design of a Binary Up Counter with EN and CO EN = enable control signal, when 0 counter remains in the same state, when 1 it counts CO = carry output signal, used to extend the counter to more stages JQ0 = 1 · EN KQ0 = 1 · EN JQ1 = Q0 · EN KQ1 = Q0 · EN JQ2 = Q0 Q1 · EN KQ2 = Q0 Q1 · EN JQ3 = Q0 Q1 Q2 · EN KQ3 = Q0 Q1 Q2 · EN C0 = Q0 Q1 Q2 Q3 · EN

4-bit Upward Synchronous Binary Counter in HDL - Simulation

Counter with Parallel Load Add path for input data enabled for Load = 1 Add logic to: disable count logic for Load = 1 disable feedback from outputs for Load = 1 enable count logic for Load = 0 and Count = 1 The resulting function table: D C Q 1 2 3 Load Count Clock Carry Output CO Load Count Action Hold Stored Value 1 Count Up Stored Value X Load D

Counting Modulo 7: Detect 7 and Asynchronously Clear A synchronous 4-bit binary counter with an asynchronous Clear is used to make a Modulo 7 counter. Use the Clear feature to detect the count 7 and clear the count to 0. This gives a count of 0, 1, 2, 3, 4, 5, 6, 7(short)0, 1, 2, 3, 4, 5, 6, 7(short)0, etc. DON’T DO THIS! Referred to as a “suicide” counter! (Count “7” is “killed,” but the designer’s job may be dead as well!) D3 Q3 D2 Q2 D1 Q1 D0 Q0 Clock CP LOAD CLEAR

Counting Modulo 7: Synchronously Load on Terminal Count of 6 Q3 D2 Q2 D1 Q1 D0 Q0 CLEAR CP LOAD Clock Reset A synchronous 4-bit binary counter with a synchronous load and an asynchronous clear is used to make a Modulo 7 counter Use the Load feature to detect the count "6" and load in "zero". This gives a count of 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, ... Using don’t cares for states above 0110, detection of 6 can be done with Load = Q4 Q2

Counting Modulo 6: Synchronously Preset 9 on Reset and Load 9 on Terminal Count 14 Q3 A synchronous, 4-bit binary counter with a synchronous Load is to be used to make a Modulo 6 counter. Use the Load feature to preset the count to 9 on Reset and detection of count 14. This gives a count of 9, 10, 11, 12, 13, 14, 9, 10, 11, 12, 13, 14, 9, … If the terminal count is 15 detection is usually built in as Carry Out (CO) D2 Q2 D1 Q1 1 D0 Q0 Clock CP Reset LOAD 1 CLEAR

Ripple Counter B 1 2 3 A How does it work? CP When there is a positive edge on the clock input of A, A complements The clock input for flip- flop B is the complemented output of flip-flop A When flip A changes from 1 to 0, there is a positive edge on the clock input of B causing B to complement Reset Clock D CR B A CP B A 1 2 3

Example (cont.)

Ripple Counter (continued) The arrows show the cause-effect relation- ship from the prior slide => The corresponding sequence of states => (B,A) = (0,0), Each additional bit, C, D, …behaves like bit B, changing half as frequently as the bit before it. For 3 bits: (C,B,A) = (0,0,0), (0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0), (1,1,1), (0,0,0), … CP B A 1 2 3 (0,1), (1,0), (1,1), (0,0), (0,1), …

Ripple Counter (continued) Starting with C = B = A = 1, equivalent to (C,B,A) = 7 base 10, the next clock increments the count to (C,B,A) = 0 base 10. In fine timing detail: The clock to output delay tPHL causes an increasing delay from clock edge for each stage transition. Thus, the count “ripples” from least to most significant bit. For n bits, total worst case delay is n tPHL. CP A B C tPHL tpHL

Example: A 4-bit Upward Counting Ripple Counter Less Significant Bit output is Clock for Next Significant Bit! (Clock is active low) Recall...

A 4-bit Downward Counting Ripple Counter Use direct Set (S) signals instead of direct Reset (R), in order to start at 1111. Alternative designs: Change edge-triggering to positive Connect the complement output of each FF to the C input of the next FF in the sequence.

Simulation …