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

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
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.
ENGIN112 L26: Shift Registers November 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 26 Shift Registers.
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.
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:
REGISTER A Register is a group of binary storage cells suitable for holding binary information. A group of flip-flops constitutes a register, since each.
Mantıksal Tasarım – BBM231 M. Önder Efe
Registers and Counters
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
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.
Counters.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
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
Registers & Counters M. Önder Efe
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
Chapter 6 Registers and Counter
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:
Digital Design Lectures 11 & 12 Shift Registers and Counters.
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
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 6 Registers and 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.
Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.
Abdullah Said Alkalbani University of Buraimi
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.
Digital Electronics.
COUNTERS Why do we need counters?
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 7 – Part 2.
Chap 5. Registers and Counters
DIGITAL COMPONENTS. MULTIPLEXERS A multiplexer is a combinational circuit that receives binary information from one of 2 n input data lines and directs.
3 BIT DOWN COUNTER SUBJECT: DIGITAL ELECTONICS CODE: COLLEGE: BVM ENGINEERING COLLEGE COLLEGE CODE:008 ELECTRONICS & TELECOMMUNICATION DEPT.
Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi.
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.
CSE 260 Digital Logic Design Registers, Memory BRAC University.
REGISTERS - Introduction to Registers Shift Registers Lecture 1 Gunjeet Kaur Dronacharya Group of Institutions.
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
Computer Architecture and Organization: L02: Logic design Review
6. Registers and Counters
Switching Theory and Logic Design Chapter 5:
Digital Logic Department of CNET Chapter-6
Digital Logic Department of CNET Chapter-6
Outline Registers Counters 5/11/2019.
Instruction execution and ALU
Digital Electronics and Logic Design
Presentation transcript:

1 Registers & Counters Logic and Digital System Design - CS 303 Erkay Savaş Sabancı University

2 Registers Registers are clocked sequential circuits A register is a group of flip-flops –Each flip-flop capable of storing one bit of information –An n-bit register consists of n flip-flops capable of storing n bits of information –besides flip-flops, a register usually contains combinational logic to perform some simple tasks –In summary flip-flops to hold information combinational logic to control the state transition

3 Counters A counter is essentially a register that goes through a predetermined sequence of states “Counting sequence” RegisterFF 0 FF 1 FF n-1 Combinational logic

4 Uses of Registers and Counters Registers are useful for storing and manipulating information –internal registers in microprocessors to manipulate data Counters are extensively used in control logic –PC (program counter) in microprocessors

5 4-bit Register REG Q3Q3 Q2Q2 Q1Q1 Q0Q0 D3D3 D2D2 D1D1 D0D0 clear D Q clock C R D Q C R D Q C R D Q C R clear D0D0 D1D1 D2D2 D3D3 Q0Q0 Q1Q1 Q2Q2 Q3Q3 FD16CE 16 D[15:0] Q[15:0] CE C CLR

6 Register with Parallel Load Load D Q C R Q0Q0 D Q C R Q1Q1 D Q C R Q2Q2 D Q C R Q3Q3 clock clear D1D1 D2D2 D3D3 D0D0

7 Register Transfer 1/2 R1R1 R2R2 n load clock load clock R 2  R 1 R1R1 010…10110…11 010…10 R2R2

8 Register Transfer 2/2 R 1  R 1 + R 2 clock R1R1 R2R2 n n-bit adder n load

9 Shift Registers A register capable of shifting its content in one or both directions –Flip-flops in cascade serial input serial output D Q C SI D Q C D Q C D Q C SO clock The current of n-bit shift register state can be transferred in n clock cycles

10 Serial Mode A digital system is said to operate in serial mode when information is transferred and manipulated one bit a time. shift register Ashift register B SO SI SO clk clock shift control clock shift control clk T1T1 T2T2 T3T3 T4T4

11 Serial Transfer Suppose we have two 4-bit shift registers After T 4 After T 3 After T 2 After T initial value Shift register BShift register ATiming pulse B  A clock shift control clk T1T1 T2T2 T3T3 T4T4 A B clock shift control

12 Serial Addition In digital computers, operations are usually executed in parallel, since it is faster Serial mode is sometimes preferred since it requires less equipment shift register A shift register B SI FA a b C_in S C DQ C SO SI serial input clock shift control reset serial output

Example: Serial Addition 13 A and B are 2-bit shift registers clock shift control SR-A SR-B C_in 01

How to Write Inputs to Registers? 14 shift register A shift register B SI FA a b C_in S C DQ C SO SI serial input clock shift control reset serial output

15 Example: Serial Addition A and B are 2-bit shift registers reset clock serial input SR-A SR-B C_in 00 shift control

16 Universal Shift Register Capabilities: 1.A “clear” control to set the register to 0. 2.A “clock” input 3.A “shift-right” control 4.A “shift-left” control 5.n input lines & a “parallel-load” control 6.n parallel output lines

17 4-Bit Universal Shift Register D Q C D Q C D Q C D Q C A0A0 A1A1 A2A2 A3A3 parallel outputs clear clk 4  1 MUX  1 MUX  1 MUX  1 MUX s1s1 s0s0 serial input for shift-right serial input for shift-left parallel inputs

18 Universal Shift Register Mode Control Register operation s1s1 s0s0 00No change 01Shift right 10Shift left 11Parallel load

19 Counters registers that go through a prescribed sequence of states upon the application of input pulses –input pulses are usually clock pulses Example: n-bit binary counter –count in binary from 0 to 2 n -1 Classification 1.Synchronous counters flip-flops receive the same common clock as the pulse 2.Ripple counters flip-flop output transition serves as the pulse to trigger other flip-flops

20 Binary Ripple Counter bit binary ripple counter Idea: –to connect the output of one flip-flop to the C input of the next high-order flip-flop We need “complementing” flip-flops –We can use T flip-flops to obtain complementing flip-flops or –JK flip-flops with its inputs are tied together or –D flip-flops with complement output connected to the D input.

21 4-bit Binary Ripple Counter T Q C R A0A0 T Q C R A1A1 T Q C R A2A2 T Q C R A3A3 clear count logic-1 D Q C R A0A0 D Q C R A1A1 D Q C R A2A2 D Q C R A3A3 clear count

22 4-bit Binary Ripple Counter –Suppose the current state is 1100 –What is the next state? T Q C R A0A0 T Q C R A1A1 T Q C R A2A2 T Q C R A3A3 clear count logic-1

23 Synchronous Counters There is a common clock –that triggers all flip-flops simultaneously –If T = 0 or J = K = 0 the flip-flop does not change state. –If T = 1 or J = K = 1 the flip-flop does change state. Design procedure is so simple –no need for going through sequential logic design process –A 0 is always complemented –A 1 is complemented when A 0 = 1 –A 2 is complemented when A 0 = 1 and A 1 = 1 –so on

24 4-bit Binary Synchronous Counter J Q C A0A0 J Q C A1A1 J Q C A2A2 J Q C A3A3 K K K K clock Count_enable to next stage Polarity of the clock is not essential

Timing of Synchronous Counters 25 A0A0 clock A3A3 A1A1 A2A2

Timing of Ripple Counters 26 A0A0 clock A3A3 A1A1 A2A2

27 Up-Down Binary Counter When counting downward –the least significant bit is always complemented (with each clock pulse) –A bit in any other position is complemented if all lower significant bits are equal to 0. –For example: Next state: –For example: Next state:

28 Up-Down Binary Counter The circuit T Q C A0A0 T Q C A1A1 T Q C A2A2 C clock up down

29 Binary Counter with Parallel Load J Q C A0A0 J Q C A1A1 J Q C A2A2 K K K clock clear count load D0D0 D1D1 D2D2 carry output

30 Binary Counter with Parallel Load clearclockloadCountFunction 0XXXclear to 0 1  1Xload inputs 1  01count up 1  00no change Function Table

31 Other Counters Ring Counter –A ring counter is a circular shift register with only one flip-flop being set at any particular time, all others are cleared. shift right T0T0 T1T1 T2T2 T3T3 initial value 1000 Usage –Timing signals control the sequence of operations in a digital system

32 Ring Counter Sequence of timing signals clock T0T0 T1T1 T2T2 T3T3

33 Ring Counter To generate 2 n timing signals, –we need a shift register with ? flip-flops or, we can construct the ring counter with a binary counter and a decoder 2x4 decoder T0T0 T1T1 T2T2 T3T3 2-bit counter count Cost: 2 flip-flops 2-to-4 line decoder Cost in general case: n flip-flops n-to-2 n line decoder 2 n n-input AND gates n NOT gates

34 Johnson Counter A k-bit ring counter can generate k distinguishable states The number of states can be doubled if the shift register is connected as a switch-tail ring counter clock D Q C D Q C D Q C D Q C X X’ Y Y’ Z Z’ T T’

35 Johnson Counter Count sequence and required decoding S 7 = Z’T S 6 = Y’Z S 5 = X’Y S 4 = XT S 3 = ZT’ S 2 = YZ’ S 1 = XY’ S 0 = X’T’ TZYX Output Flip-flop outputssequence number

36 Johnson Counter Decoding circuit S0S0 S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 S7S7 clock D Q C D Q C D Q C D Q C X Y Z T

37 Unused States in Counters 4-bit Johnson counter

38 Correction

39 Johnson Counter Next StatePresent State TZYXTZYX

40 K-Maps ZT XY X(t+1) = T’ ZT XY Y(t+1) = XY + XZ + XT’ ZT XY Z (t+1) = Y ZT XY T (t+1) = Z

41 Unused States in Counters Remedy D Y = X(Y+Z+T’) X(t+1) = T’ Y(t+1) = XY + XZ + XT’ Z(t+1) = YT(t+1) = Z clock Z T D Q C D Q C D Q C D Q C X Y