Presentation is loading. Please wait.

Presentation is loading. Please wait.

Registers & Counters Registers. Shift Registers: Counters:

Similar presentations


Presentation on theme: "Registers & Counters Registers. Shift Registers: Counters:"— Presentation transcript:

1 Registers & Counters Registers. Shift Registers: Counters:
Serial in, serial out shift register Serial in, parallel out shift register Parallel in, serial out shift register Parallel in, parallel out shift register Shift Register Applications Counters: Ripple Counters Synchronous Counters Counter Applications

2 Registers An n-bit register is a collection of n D flip-flops with a common clock used to store n related bits. D 1Q CLR Q /1Q 1D 2Q /2Q 2D 3Q /3Q 3D 4Q /4Q 4D CLK /CLR 74LS175 Example: 74LS175 4-bit register CLK CLR 4Q 3Q 2Q 1Q 74LS175 1D 2D 3D 4D

3 Shift Registers Multi-bit register that moves stored data bits left/right ( 1 bit position per clock cycle) Shift Left is towards MSB LSI Q3 Q2 Q1 Q0 LSI Q3 Q2 Q1 Q0 Shift Right (or Shift Up) is towards MSB RSI Q3 Q2 Q1 Q0 RSI Q3 Q2 Q1 Q0

4 Serial In, Serial Out Shift Register
D Q CLK SERIN CLOCK SEROUT SRG n > SI SO For a n-bit SRG: Serial Out = Serial In delayed by n clock period 4-bit shift register example: serin: serout: clock:

5 Serial In, Parallel Out Shift register
SRG n > SI 1Q 2Q nQ D Q CLK SERIN CLOCK nQ 2Q 1Q (SO) Serial to Parallel Converter 4-bit shift register example: serin: 1Q: 2Q: 3Q: 4Q: clock:

6 Parallel In, Serial Out Shift Register
SERIN CLOCK D Q CLK SEROUT LOAD/SHIFT 1D 2D ND S L 1Q 2Q NQ Parallel to Serial Converter Load/Shift=1 Di Qi Load/Shift=0 Qi Qi+1

7 Parallel In, Parallel Out Shift Register
SERIN CLOCK D Q CLK LOAD/SHIFT 1D 2D ND 1Q 2Q NQ S L General Purpose: Makes any kind of (left) shift register

8 Bi-directional Universal Shift Registers
4-bit Bi-directional Universal (4-bit) PIPO CLK CLR S1 S0 LIN D QD C QC B QB A QA RIN 11 1 10 9 7 6 4 5 3 2 12 13 14 15 74x194 Modes: Hold Load Shift Right Shift Left R L Mode Next state Function S1 S QA* QB* QC* QD* Hold QA QB QC QD Shift right/up RIN QA QB QC Shift left/down QB QC QD LIN Load A B C D

9 Universal SR Circuit 74x194 SL HO LD SR D Q CLK CLR D Q CLK CLR CLK
(11) /CLR (1) S1 S0 74x194 RIGHT LIN (7) SL HO LD SR 10 LEFT 00 (12) D Q CLK CLR QD (6) D 11 01 (10) S1 10 (9) S0 00 (15) D Q CLK CLR QA (3) A 11 (2) RIN 01 Universal SR Circuit

10 Shift Register Applications
State Registers Shift registers are often used as the state register in a sequential device. Usually, the next state is determined by shifting right and inserting a primary input or output into the next position (i.e. a finite memory machine) Very effective for sequence detectors Serial Interconnection of Systems keep interconnection cost low with serial interconnect Bit Serial Operations Bit serial operations can be performed quickly through device iteration Iteration (a purely combinational approach) is expensive (in terms of # of transistors, chip area, power, etc). A sequential approach allows the reuse of combinational functional units throughout the multi-cycle operation

11 Shift Register Applications: Serial Interconnection of Systems
CLOCK Transmitter Receiver Control Circuits Control Circuits /SYNC Parallel Data from A-to-D converter Parallel Data to D-to-A converter Serial-to-parallel converter Parallel-to-serial converter Serial DATA n One bit n

12 Shift Register Applications Example: 8-Bit Serial Adder
... 7 6 5 > x7 x6 x5 x0 y7 y6 y5 y0 FA Cout S Cin A B D Q CLK CLR CLEAR_C z7 z6 z5 z0 CTL Sequential Implementation of: Z[7..0] = X[7..0] + Y[7..0] V

13 Counters Clocked sequential circuit with single-cycle state diagram Modulo-m counter = divide-by-m counter Most Common: n-bit binary counter, where m = 2n Ù n flip-flops, counts 0 … 2n-1 S3 S2 S1 Sm

14 4-bit Ripple Counter 1 bit divide-by-2 Q T CLK Q0 Q1 Q2 Q3 2 bit
Uses Minimal Logic 3 bit divide-by-8 4 bit divide-by-16

15 Ripple Counter Timing CLK 1D Q0 Q1 2D Q2 3D

16 Ripple Counter Problem
n · TCQ for MSB change for n-bit ripple counter => minimum clk period CLK 1D Q0 Q1 2D Q2 3D 7 Should be

17 Synchronous Counters All clock inputs connected to common CLK signal
All flip-flop outputs change simultaneously tCQ after CLK Faster than ripple counters More complex logic Most frequently used type of counter

18 Synchronous Serial Counter
Q EN CLK CNTEN Q0 Q1 Q2 Q3 Flip-flops enabled when all lower flip-flops = 1. Enable propagates serially — limits speed Requires (n-1) D t < TCLK All outputs change simultaneously tCQ after CLK D t D t D t

19 Synchronous Parallel Counter
CNTEN Q0 EN Q CLK >T Q1 >T Q EN Single-level enable logic per flip-flop Fastest and most complex type of counter Requires D t < TCLK All outputs change simultaneously tCQ after CLK Q2 >T Q EN Q3 >T Q EN

20 74X163 4-bit Synchronous Parallel Counter
Common Clock Synchronous Clear Synchronous Load Count Enable = ENP · ENT Load Data Inputs >CLK CLR LD ENP ENT A B C D QA QB QC QD RCO LSB MSB RCO = Ripple Carry Out, when Count = 1111 and ENT = 1

21 74X163 State Table Inputs Current State Next State
/CLR /LD ENT ENP QD QC QB QA QD* QC* QB* QA* X X X X X X Clear Load Hold Count . X X X X D C B A QD QC QB QA

22 74X169 Up/Down Counter 74X169 UP/DN = 1 = up Ù RCO = 15
UP/DN = 0 = down Ù RCO = 0 up down up Ex: 0,1,2, 1,0,15,14, 15,0,1,2 RCO RCO >CLK UP/DN LD ENP ENT A B C D QA QB QC QD RCO

23 Counter Applications Count the number of times an event takes place
Control the number of steps in a sequence of fixed actions (a sequencer) Generate timing signals (frequency divider, etc.) ENTER UP Decoder CLK CTR DIV 6 > COUNTER CLR_R DOWN EXIT IN_A 1 EN IN_B 2 3 EXE 1 4 EXE # of spaces Comparator 2 5 OUT_C < = 4 6 7 Lot Open Lot Full >


Download ppt "Registers & Counters Registers. Shift Registers: Counters:"

Similar presentations


Ads by Google