Chap 5. Registers and Counters. Chap.5 2 5.1 Definition of Register and Counter l a clocked sequential circuit o consist of a group of flip-flops & combinational.

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
The Map Method Boolean expressions may be simplified by algebraic means as discussed in Previous lecture However, this procedure of minimization is awkward.
Registers and Counters
Logic and Computer Design Fundamentals Registers and Counters
COE 202: Digital Logic Design Sequential Circuits Part 4 KFUPM Courtesy of Dr. Ahmad Almulhem.
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.
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:
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.
Lecture 21 Overview Counters Sequential logic design.
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 & Counters M. Önder Efe
Registers CPE 49 RMUTI KOTAT.
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
P. 4.1 Digital Technology and Computer Fundamentals Chapter 4 Digital Components.
Chap 4. Sequential Circuits
Counter Application (Part B) By : Pn Siti Nor Diana Ismail CHAPTER 3.
Chapter 6 Registers and Counter
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
Registers and Counters by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.
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.
1 Registers & Counters Logic and Digital System Design - CS 303 Erkay Savaş Sabancı University.
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.
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.
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.
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 and Registers Synchronous Counters. 7-7 Synchronous Down and Up/Down Counters  In the previous lecture, we’ve learned how synchronous counters.
COUNTERS Why do we need counters?
Counters.
Chap 5. Registers and Counters
Chapter 1_0 Registers & Register Transfer. Chapter 1- Registers & Register Transfer  Chapter 7 in textbook.
DIGITAL COMPONENTS. MULTIPLEXERS A multiplexer is a combinational circuit that receives binary information from one of 2 n input data lines and directs.
Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi.
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.
1 CHAPTER 12 REGISTERS AND COUNTERS This chapter in the book includes: Objectives Study Guide 12.1Registers and Register Transfers 12.2Shift Registers.
Registers and Counters
Chap 7. Register Transfers and Datapaths
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
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
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:

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 gates connected to form a feedback path o Registers & Counters -- sequential circuits with F-F l Register o include a set of F-Fs o each F-F is capable of storing one bit of information = n-bit registers includes n F-Fs o (broadest def) consists of a set of F-Fs, together with gates that implement their transition o (narrower def) register: a set of F-Fs (hold data) gates: perform data-processing tasks (determine the new and transformed data to be transferred into the F-Fs)

Chap Definition of Registers and Counters l Counter o a register that goes through a predetermined sequence of states upon the application of clock pulses o gates are connected to produce the prescribed sequence of states o a special type of register, but common to differentiate from registers l Registers and Counters o sequential functional blocks, used in the design of digital systems o Registers: useful for storing and manipulating information o Counters: generate timing signals to sequence and control operations

Chap Registers o (simplest register) consists of only F-Fs w/o any external gates

Chap Registers l 4-bit Register o 4 D-type F-Fs o common Clock input triggers all F-Fs on the rising edge of each pulse o binary data at the 4 inputs are transferred into 4-bit register o 4 Q outputs can be sampled to obtain the binary information o clear' input (R') m when 0, reset all F-Fs asynchronously m login-1 during normal operations o loading : transfer of new info into a register o parallel : all the bits of the register are loaded simultaneously

Chap Registers l Register with Parallel Load o a load control input: m a separate control signal to decide which specific clock pulse will have an effect on a particular register m can be done with a load control input ANDed with the clock C input = Load' + Clock o Inserting an AND gate in the path of clock pulses => logic is performed with clock pulses => produce different propagation delays between Clock and the inputs of F-Fs (clock skew problem)

Chap Registers

Chap Registers l 4-bit Register o 4-bit register with a control input m Clock inputs receive clock pulses always m Load input determines the action to be taken w/ each clock pulse l if Load =1, data are transferred into the register w/ the next positive transition of a clock pulse l if Load =0, data inputs are blocked & the D inputs of F-Fs are connected to their outputs (feedback connection is necessary)

Chap Shift Registers o a register capable of shifting its stored bits in one or both directions o consists of a chain of F-Fs in cascade w/ output of one F-F connected to the input of the next F-F o receive common clock pulse

Chap Shift Registers l 4-bit Shift Registers o the output of a F-F is connected to the D input of F-F at its right o Clock is common o serial input SI is the input to the leftmost F-F o serial output SO is taken from the output of the rightmost F-F l Serial Transfer o Operate in a serial mode when info is transferred and manipulated one bit at a time o by shifting the bits out of one register and into a second (cf) parallel transfer

Chap Shift Registers l Serial Transfer Circuit o serial output of A is connected to the serial input of B o serial control input Shift determines when and how many times the registers are shifted  in the figure, each shift register has 4 stages

Chap Shift Registers o the control unit must be designed to enable the shift registers o serial mode: registers have a single serial input & output info is transferred one bit at a time o parallel mode: info is available from all bits of a register & all bits can be transferred simultaneously

Chap Shift Registers l Serial Addition o Operations in digital computers are usually done in parallel since it is a faster !! o Serial operations are slower, but requires less hardware o Serial adder (cf) parallel adder (Section3.8, Figure3.28 p128) m two binary numbers are stored in 2 shift registers,  bits are added one pair at a time through a single FA

Chap Shift Registers o A carry out of FA is transferred into a D F-F (used as the input carry for the next addition) o Sum bit on the S output of FA is transferred into a third shift register, but transfer it into register A (contents of A are shifted out) (serial input of B can receive a new binary number)

Chap Shift Registers o Initial assignment m register A holds the augend; m register B holds the addend; m carry F-F is reset to 0 o Operation m the shift control enables the clock for registers and the F-F m for each pulse, l a new sum bit is transferred to A, l a carry is transferred to the F-F, & l both registers are shifted once to the right o (other possibility) m initially clear register A to 0 & add the first number from B m then number in B is shifted to A through the FA, and the second number is transferred serially into B m then the second number is added to the contents of A

Chap Shift Registers o Comparison (space-time trade-off) m parallel adder: l use a register with parallel load l No of full adder circuits is equal to No of bits in binary number l a combinational circuit (excluding registers) m serial adder: l use shift registers l an example of iterative logic array l requires only one full adder and a carry F-F l a sequential circuit since it include carry F-F

Chap Shift Registers l Shift Register with Parallel Load o data entered in parallel can be taken out in serial fashion by shifting out the data in the register o used for converting incoming parallel data to outgoing serial transfer and vice versa

Chap Shift Registers o 2 control inputs: one for shift & one for load o each stage consists of a D F-F, an OR gate and 3 AND gates m first AND: enables the shift operation m second AND: enables the input data m third AND: restores the contents of the register (when no operation is required) o If shift=0 & load=0, 3rd AND is enabled, output of each F-F is applied to its D input o If shift=0 & load=1, 2nd AND is enabled, input data is applied to each D input o If shift=1 & load=0, 1st AND is enabled, transfer data to the next F-F o used to interface digital system m transmitter: parallel-to-serial conversion m receiver: serial-to-parallel conversion

Chap Shift Registers l Bidirectional Shift Register shift in both directions (cf) unidirectional shift register shift in one direction only o possible to modify circuit of Fig 5.6 by adding a 4th AND gate in each stage  4 AND gates + 1 OR gate constitute a multiplexer

Chap Shift Registers o Each stage consists of a D flip-flop & a 4-to-1-line multiplexer

Chap Ripple Counters l Counter o a register that goes through a prescribed sequence of states upon the application of input pulses m input pulse: clock pulse, or from some external source m follow the binary number sequence or other sequence of states o an n-bit binary counter m consists of n F-Fs m can count from 0 up to 2 n -1 l Ripple counters vs Synchronous counters o ripple counters m F-F output transition serves as a source for triggering other F-F m all F-Fs are triggered not by common clock pulses, but by the transition that occurs in other F-F outputs o synchronous counters m all F-Fs receive the common clock pulse m the change of state is determined from the present state

Chap Ripple Counters o constructed with F-Fs capable of complementing their contents, such as JK o output of each F-F is connected to the C input of the next F-F o the F-F holding LSB receives the incoming clock pulse o J & K inputs of all F-F are connected to 1 (permanent logic-1) o negative-edge triggering (small circle on C indicates it)

Chap Ripple Counters o LSB A 0 is complemented with each count pulse input o Every time that A 0 goes from 1 to 0, it complement A 1

Chap Ripple Counters l Binary Down-Counter o decremented by one with every input count pulse (cf) up-counter -- incremented by one o From Fig 5.8, but take the outputs from the complement outputs of the F-Fs 1) complement output of each F-F to the C input of the next 2) uses positive-edge-triggered F-Fs l Advantages & Disadvantages o simple hardware o asynchronous with added logic  unreliable & delay-dependent o incompatible with modern system design

Chap Synchronous Binary Counters o clock pulses are applied to the inputs of all F-F (different from ripple counters !!) o common clock pulses are applied to the inputs of all of the F-Fs l Design of Binary Counter o design procedure for a synchronous counter m same as with any other synchronous sequential circuit o operate without an external input except for the clock pulses m output of the counter is taken from outputs of the F-Fs without any additional outputs from gates o state table of a counter consists of columns for the present state & next state only

Chap Synchronous Binary Counters o State table

Chap Synchronous Binary Counters o Binary counters are most efficiently constructed with complementing T or JK F-Fs (also with D F-Fs) o Obtain the F-F inputs for each J & K (use excitation cond) o Simplify the input equations by maps

Chap Synchronous Binary Counters o J Q0 & K Q0 equal to 1 (maps contain only 1's and X's) o equations for J & K are the same for each F-F m T F-F could be used instead of JK o input equations w/ count enable input EN can be expressed as J Q0 = K Q0 = EN; J Q1 = K Q1 = Q0 EN; J Q2 = K Q2 = Q 0 Q 1 EN; J Q3 = K Q3 = Q 0 Q 1 Q 2 EN; o F-F in the LSB is complemented with every clock pulse transition m a F-F in any other position is complemented w/ a clock trans if all least significant bits are equal to 1 => in an n-bit binary counter, Q i at any stage of i is J Qi = K Qi = Q 0 Q Q i-1 EN;

Chap Synchronous Binary Counters o Synchronous binary counters have a regular pattern o C inputs of all F-Fs receive the common clock pulses o the chain of AND gates generates the required logic for the J & K inputs o the carry output C O can be used to extend the counter to more stages o F-Fs trigger on the positive-edge transition of the clock m but the polarity if the clock is not essential here

Chap Synchronous Binary Counters l Counter with D Flip-Flops o input equations can be expressed in sum of minterms as a function of the present state D Q0 (Q 3,Q 2, Q 1, Q 0 ) =  m(0,2,4,6,8,10,12,14); D Q1 (Q 3,Q 2, Q 1, Q 0 ) =  m(1,2,5,6,9,10,13,14); D Q2 (Q 3,Q 2, Q 1, Q 0 ) =  m(3,4,5,6,11,12,13,14); D Q3 (Q 3,Q 2, Q 1, Q 0 ) =  m(7,8,9,10,11,12,13,14); o simplifying 4 equations with maps D Q0 = Q 0  EN; D Q1 = Q 1  (Q 0 EN) D Q2 = Q 2  (Q 0 Q 1 EN); D Q3 = Q 3  (Q 0 Q 1 Q 2 EN) o D Qi = Qi  (Q 0 Q 1 Q Q i-1 EN)

Chap Synchronous Binary Counters l Serial and Parallel Counters o in Fig(a), a chain of 2-input AND gates is used m analogous to the carry logic in the ripple carry adder m a counter has serial gating, referred to as a serial counter o in Fig(b), m a counter has parallel gating, referred to as a parallel counter m from 1111 to 0000, only 1 gate delay occurs (instead of 4)

Chap Synchronous Binary Counters l Up-Down Binary Counter o synchronous count-down binary counter goes through the binary states in reverse order from 1111 to 0000 and back to 1111 o the result is predictable m the bit in LSB is complemented with each count pulse m bit in any other position is complemented if all lower bits are equal to 0 m the next state after the present state of 0100 is 0011 o the logic diagram is similar to that of the binary up-counter m inputs to the AND gates must come from the complemented outputs of the F-Fs

Chap Synchronous Binary Counters o 2 operations can be combined m use T F-Fs T Q0 = EN; T Q1 = Q 0 S EN + Q 0 ' S' EN; T Q2 = Q 0 Q 1 S EN + Q 0 ' Q 1 ' S' EN; T Q3 = Q 0 Q 1 Q 2 S EN + Q 0 ' Q 1 ' Q 2 ' S' EN; o the output carries for the next state are C up = Q 0 Q 1 Q 2 Q 3 S EN C dn = Q 0 ' Q 1 ' Q 2 ' Q 3 ' S' EN

Chap Synchronous Binary Counters l Binary Counter with Parallel Load o logic diagram of a register with parallel load + counter

Chap Synchronous Binary Counters l Synchronous BCD Counter o a binary counter with parallel load can be converted by connecting an external AND gate o It starts with all-zero output, and the counter input is active at all times o as long as the output of the AND gate is 0, each positive clock pulse transition increments the counter by one o when output reaches 1001, both Q0 & Q3 become 1  Load active  0000 is loaded into the counter

Chap Other Synchronous Counters o Counters are designed to generate any desired number of sequence o A divide-by-N counter (modulo-N counter) is a counter that goes through a repeated sequence of N state o the sequence may follow the binary count, or may be any other arbitrary sequence l BCD Counter o obtained from a binary counter with parallel load o possible to design a BCD counter with individual F-Fs & gates m derive the state table and input conditions with T F-Fs

Chap Other Synchronous Counters o simplified by means of maps T Q1 = 1; T Q2 = Q 1 Q 8 '; T Q4 = Q 1 Q 2 ; T Q8 = Q 1 Q 8 + Q 1 Q 2 Q 4 ; Y = Q 1 Q 8 o implemented with 4 T F-Fs, 5 AND gates, 1 OR gate

Chap Other Synchronous Counters l Arbitrary Count Sequence o design a counter that has a repeated sequence of 6 states o 011 & 111: unused states o implement with JK F-Fs J AC = B; K A = B; J B = C; K B = 1; J C = B'; K C = 1;

Chap Other Synchronous Counters o J AC = B; K A = B; J B = C; K B = 1; J C = B'; K C = 1; o 2 unused states m next count pulse transfers it to one of the valid states & continues to count correctly (self-correcting)