digital design: principles and practices

65
Digital Design: Principles and Practices Chapter 8 Sequential Logic Design Practices

Upload: elpida

Post on 22-Jan-2016

46 views

Category:

Documents


0 download

DESCRIPTION

Digital Design: Principles and Practices. Chapter 8 Sequential Logic Design Practices. 8.4 Counters. Counter. The name counter is generally used for any clocked sequential circuit whose state diagram contains a single cycle, as shown in the next slide (Figure 8-23). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Digital Design: Principles and Practices

Digital Design:Principles and Practices

Chapter 8Sequential Logic Design Practices

Page 2: Digital Design: Principles and Practices

8.4 Counters

Page 3: Digital Design: Principles and Practices

Counter

• The name counter is generally used for any clocked sequential circuit whose state diagram contains a single cycle, as shown in the next slide (Figure 8-23).

• The modulus of a counter is the number of states in the cycle.

• A counter with m states is called a modulo-m counter, or divide-by-m counter.

• A counter with a non-power-of-2 modulus has extra states that are not used in normal operation.

3

Page 4: Digital Design: Principles and Practices

General Structure of a Counter State Diagram – A Single Cycle

4

Page 5: Digital Design: Principles and Practices

8.4.1 Ripple Counters

Page 6: Digital Design: Principles and Practices

A 4-Bit Binary Ripple Counter

6

Page 7: Digital Design: Principles and Practices

Ripple Counter• A T flip-flop changes state (toggles) on every rising edge of its clock

input.

• Thus, each bit of the counter toggles if and only if the immediately preceding bit changes from 1 to 0, it generates a carry to the next most significant bit.

• Although a ripple counter requires fewer components than any other type of binary counter, it does so at a price – it is slower than any other type of binary counter.

• In the worst case, when the most significant bit must change, the output is not valid until time n . tTQ after the rising edge of CLK, where tTQ is the propagation delay from input to output of a T flip-flop.

7

Page 8: Digital Design: Principles and Practices

Synchronous Serial Counter

8

Page 9: Digital Design: Principles and Practices

Synchronous Serial Counter

• CNTEN: Master count-enable signal

• Each T flip-flop toggles if and only if CNTEN is asserted and all of the lower-order counter bits are 1.

9

Page 10: Digital Design: Principles and Practices

Synchronous Parallel Counter

10

Page 11: Digital Design: Principles and Practices

Synchronous Parallel Counter

• Synchronous parallel counter is the fastest binary counter structure.

11

Page 12: Digital Design: Principles and Practices

2-Bit Asynchronous Counter

(LSB) (MSB)

Page 13: Digital Design: Principles and Practices

Asynchronous Counters

• The clock input of an asynchronous counter is always connected only to the LSB flip-flop.

• Asynchronous counters are also known as ripple counters.

Page 14: Digital Design: Principles and Practices

3-Bit Asynchronous Counter

Page 15: Digital Design: Principles and Practices

Propagation Delay in 3-Bit Counter

Page 16: Digital Design: Principles and Practices

4-Bit Asynchronous Counter

Page 17: Digital Design: Principles and Practices

Asynchronous Decade Counter

Page 18: Digital Design: Principles and Practices

Terms

• Recycle the transition of the counter from its final state

back to its original state.

• Modulus the number of states the maximum possible number of states

(maximum modulus) of a counter is 2n, where n is the number of flip-flops in the counter.

Page 19: Digital Design: Principles and Practices

74LS93 (4-Bit Asyn. Counter)

Page 20: Digital Design: Principles and Practices

74LS93 (4-Bit Asyn. Counter)

Page 21: Digital Design: Principles and Practices

2-Bit Synchronous Counter

Page 22: Digital Design: Principles and Practices

2-Bit Synchronous Counter

Page 23: Digital Design: Principles and Practices

2-Bit Synchronous Counter

Page 24: Digital Design: Principles and Practices

3-Bit Synchronous Counter

Page 25: Digital Design: Principles and Practices

4-Bit Synchronous Counter

Page 26: Digital Design: Principles and Practices

4-Bit Synchronous Decade Counter

• J0 = K0 = 1• J1 = K1 = Q0Q3

• J2 = K2 = Q0Q1

• J3 = K3 = Q0Q1Q2 + Q0Q3

Page 27: Digital Design: Principles and Practices

4-Bit Synchronous Decade Counter

• J0 = K0 = 1• J1 = K1 = Q0Q3

• J2 = K2 = Q0Q1

• J3 = K3 = Q0Q1Q2 + Q0Q3

Page 28: Digital Design: Principles and Practices

The Johnson Counter

Page 29: Digital Design: Principles and Practices

4-bit Johnson Counter

Page 30: Digital Design: Principles and Practices

4-bit Johnson Counter

Page 31: Digital Design: Principles and Practices

4-bit Johnson Counter

Page 32: Digital Design: Principles and Practices

5-bit Johnson Counter

Page 33: Digital Design: Principles and Practices

5-bit Johnson Counter

Page 34: Digital Design: Principles and Practices

5-bit Johnson Counter

Page 35: Digital Design: Principles and Practices

The Johnson Counter

• In a Johnson counter, the complement of the output of the last flip-flop is connected back to the D input of the first flip-flop.

• A 4-bit Johnson counter has 8 states (or bit patterns).• A 5-bit Johnson counter has 10 states (or bit patterns).• In general, an n-bit Johnson counter will produce 2n states.

Page 36: Digital Design: Principles and Practices

The Ring Counter

Page 37: Digital Design: Principles and Practices

The Ring Counter

Page 38: Digital Design: Principles and Practices

The Ring Counter

Page 39: Digital Design: Principles and Practices

8.5 Shift Registers

Page 40: Digital Design: Principles and Practices

8.5.1 Shift-Register Structure

Page 41: Digital Design: Principles and Practices

Shift Register

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

• Shift Register Structures Serial-in, serial-out Serial-in, parallel-out Parallel-in, serial-out Parallel-in, parallel-out

41

Page 42: Digital Design: Principles and Practices

Serial-In, Serial-Out Shift Register

42

Page 43: Digital Design: Principles and Practices

Serial-In, Parallel-Out Shift Register

43

Page 44: Digital Design: Principles and Practices

Parallel-In, Serial-Out Shift Register

44

Page 45: Digital Design: Principles and Practices

Parallel-In, Parallel-Out Shift Register

45

Page 46: Digital Design: Principles and Practices

Basic Shift Register Functions

• Data Storage• Data Movement

Serial In / Serial Out Serial In / Parallel Out Parallel In / Serial Out Parallel In / Parallel Out Bi-directional

Page 47: Digital Design: Principles and Practices

Shift Register - Data Storage

Page 48: Digital Design: Principles and Practices

Shift Register - Data Movement

Page 49: Digital Design: Principles and Practices

Serial In / Serial Out Shift Register

With four stages, this shift register can store up to four bits of data.

Page 50: Digital Design: Principles and Practices

Figure 9–4 Four bits (1010) being entered serially into the register.

Page 51: Digital Design: Principles and Practices

Figure 9–5 Four bits (1010) being serially shifted out of the register and replaced by all zeros.

Page 52: Digital Design: Principles and Practices
Page 53: Digital Design: Principles and Practices

Shift Register – Logic Symbol

• Logic symbol for an 8-bit serial in/serial out shift register

• SRG 8: a shift register (SRG) with an 8-bit capacity

Page 54: Digital Design: Principles and Practices

Serial In / Parallel Out Shift Register

Page 55: Digital Design: Principles and Practices

Serial In / Parallel Out Shift Register

EXAMPLE 9-2Show the states of the 4-bit shift register (SRG 4)

for the data input and clock waveform in Figure 9-9(a). The register initially contains all 1s.

Page 56: Digital Design: Principles and Practices

Parallel In / Serial Out Shift Register

Page 57: Digital Design: Principles and Practices

Parallel In / Serial Out Shift Register

Page 58: Digital Design: Principles and Practices

EXAMPLE 9-3Show the data-output waveform for a 4-bit

register with the parallel input data and the clock and SHIFT/LOAD waveforms given in Figure 9-13(a).

Parallel In / Serial Out Shift Register

Page 59: Digital Design: Principles and Practices

Parallel In / Parallel Out Shift Register

Page 60: Digital Design: Principles and Practices

Bi-directional Shift Register

In a bi-directional shift register, the data can be shifted either or right.

Page 61: Digital Design: Principles and Practices

8.8 Impediments to Synchronous Design

Page 62: Digital Design: Principles and Practices

8.8.1 Clock Skew

Page 63: Digital Design: Principles and Practices

Clock Skew• Synchronous systems using edge-triggered flip-flops work

properly only if all flip-flops see the triggering clock edge at the same time.

• The difference between arrival times of the clock at different devices is called clock skew.

63

Page 64: Digital Design: Principles and Practices

Clock Skew

64

Page 65: Digital Design: Principles and Practices

Clock Skew

65