Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers...

14
Engr354 - Registers and Counters 1 Engr433 : Digital Design Registers and Counters Curtis Nelson Overview In this presentation we cover: Registers, which store multiple bits; Shift registers, which shift the contents of registers; Counters of various types.

Transcript of Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers...

Page 1: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 1

Engr433 : Digital Design

Registers and Counters

Curtis Nelson

Overview

• In this presentation we cover:– Registers, which store multiple bits;– Shift registers, which shift the contents of registers;– Counters of various types.

Page 2: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 2

Review - Sequential Circuits

• Combinational – outputs depends only on the inputs;• Sequential – output depends on input and past behavior:

– Requires use of storage elements;– Content of the storage elements is called state;– Circuit goes through a sequence of states as a result of changes in

inputs.

• Synchronous – Controlled by a clock;• Asynchronous – No central clock.

Latches and Flip-Flops

Page 3: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 3

Multibit Registers and Latches

74x374 8-bit Register

Page 4: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 4

Shift Registers

• A shift register is an n-bit register with a provision for shifting stored data by one bit position at each tick of the clock.

Shift Registers – Serial-in, Parallel-out

Page 5: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 5

74x194 4-bit Universal Shift Register

74x194 4-bit Universal Shift Register

Page 6: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 6

74x194 4-bit Universal Shift Register

74x194 4-bit Universal Shift Register

Page 7: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 7

Counters

• Counter – generally used for any clocked sequential circuit whose state diagram contains a single cycle;

• Modulus – the number of states in the cycle;• A counter with m states is called a modulus-m counter or a divide-by-m counter;

• Ripple counters (rare due to delays);• Synchronous counters (common):

⎯ Connects all of its flip-flop clock inputs to the same common CLK signal so that all flip-flop outputs change at the same time.

Synchronous 4-bit Binary Counter – 74x163

Page 8: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 8

Synchronous 4-bit Binary Counter – 74x163

Synchronous 4-bit Binary Counter – 74x163

Page 9: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 9

Synchronous 4-bit Binary Counter – 74x169

D Q

Q

Clock

D Q

Q

D Q

Q

Start

Q 0 Q 1 Q n 1 “

Clock

Q 0

Start

Two-bit up-counter

w 0 En

y 0

w 1

y 1 y 2 y 3

1

Q 1 Q 2 Q 3

2-to-4 decoder

Q 1 Q 0

(a) An n -bit ring counter

Clock

Clear

(b) A four-bit ring counter

Ring Counter

Page 10: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 10

D Q

Q

Clock

D Q

Q

D Q

Q

Q 0 Q 1 Q n 1 –

Reset

Johnson Counter

T Q

Q Clock

T Q

Q

T Q

Q

1

Q 0 Q 1 Q 2

(a) Circuit

Clock

Q 0

Q 1

Q 2

Count 0 1 2 3 4 5 6 7 0

(b) Timing diagram

Three-Bit Up-Counter

Page 11: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 11

T Q

Q Clock

T Q

Q

T Q

Q

1

Q 0 Q 1 Q 2

(a) Circuit

Clock

Q 0

Q 1

Q 2

Count 0 7 6 5 4 3 2 1 0

(b) Timing diagram

Three-bit Down-Counter

T Q

Q Clock

T Q

Q

T Q

Q

1 Q 0 Q 1 Q 2

(a) Circuit

Clock

Q 0

Q 1

Q 2

Count 0 1 2 3 5 9 12 14 0

(b) Timing diagram

T Q

Q

Q 3

Q 3

4 6 8 7 10 11 13 15 1

Four-bit Synchronous Up-Counter

Page 12: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 12

T Q

Q Clock

T Q

Q

Enable

Clear

T Q

Q

T Q

Q

Inclusion of Enable and Clear Capability

EnableQ 0 Q 1 Q 2

D 0 D 1 D 2 LoadClock

1 0 0 0

Clock

0 1 2 3 4 5 0 1

Clock

Count

Q 0

Q 1

Q 2

(a) Circuit

(b) Timing diagram

Modulo-6 Counter with Synchronous Reset

Page 13: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 13

T Q

Q Clock

T Q

Q

T Q

Q

1 Q 0 Q 1 Q 2

(a) Circuit

Clock

Q 0

Q 1

Q 2

Count

(b) Timing diagram

0 1 2 3 4 5 0 1 2

Modulo-6 Counter with Asynchronous Reset

EnableQ0Q1Q2

D0D1D2

LoadClock

1000

Clock

Q30 D3

EnableQ0Q1Q2

D0D1D2

LoadClock

000

Q30 D3

BCD0

BCD1

Clear

A Two-digit BCD Counter

Page 14: Engr433 : Digital Designcurt.nelson/engr433... · Engr354 -Registers and Counters 4 Shift Registers •A shift register is an n-bit register with a provision for shifting stored data

Engr354 - Registers and Counters 14

Summary

• In this presentation we covered:– Registers, which store multiple bits;– Shift registers, which shifts the contents of registers;– Counters of various types.