Top Banner
Counters Lecture # 21 & 22 By : Ali Mustafa
24

Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

May 12, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Counters

Lecture # 21 & 22

By : Ali Mustafa

Page 2: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Counters

• A register that goes through a prescribed sequence of states upon the application of input pulses is called a counter.

• The input pulses may be clock pulses or they may originated from some external source and may occur at a fixed interval of time or at random.

• A counter that follows the binary number sequence is called a binary counter.

• An n-bit binary counter consists of n flip-flops and can count in binary from 0 through 2^n -1.

Page 3: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Types of Counters

• Ripple counter (asynchronous): – Flip-flop output transition serves as source for triggering the

other flip-flops• Binary Ripple Counter• BCD Ripple Counter

• Synchronous counter: – Common clock for all flip-flops (same design procedure)

• Binary Counter• Up-Down Binary Counter• BCD Counter

• Other Counters• Counter with unused States• Ring Counter• Johnson Counter

Page 4: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

4-Bit Binary Ripple Counter

Page 5: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Count sequence for Binary Ripple Counter

Page 6: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

BCD Ripple Counter

Page 7: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

BCD Ripple Counter

Page 8: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

BCD Ripple Counter

Page 9: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

3 Decade Decimal BCD Counter

Page 10: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Synchronous counters

• Clock pulses are applied to the inputs of all flip-flops

• A common clock triggers all flip-flops simultaneously rather than one at a time as in a ripple counter

Page 11: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

4-Bit synchronous Binary Counter

Page 12: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Up-Down Counter

Page 13: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Binary Counter with Parallel Load

Page 14: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

BCD Counter with T-Flip flop

Circuit can be drawn with four T-FFs, five AND gates & 1 OR gate.

Page 15: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Counter with Unused States• A circuit with n flip-flops has 2n states

– We may have to design a counter with a given sequence (unused states)

– Unused states may be treated as don’t care or assigned specific next state

– Outside noise may cause the counter to enter unused state

– Must ensure counter eventually goes to the valid state

Page 16: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Counter with Unused States

Simplified eq’s are JA = B KA= BJB = C KB = 1JC = B’ KC = 1

Page 17: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Unused states can be don’t cares… • To get the simplest possible circuit, you can fill in don’t cares

for the next states. This will also result in don’t cares for the flip-flop inputs, which can simplify the hardware.

• If the circuit somehow ends up in one of the unused states (110 or 111), its behavior will depend on exactly what the don’t cares were filled in with.

Page 18: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

…or maybe you do care• To get the safest possible circuit, you can explicitly

fill in next states for the unused states 110 and 111. • This guarantees that even if the circuit somehow

enters an unused state, it will eventually end up in a valid state.

• This is called a self-starting counter.

Page 19: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Ring Counter

• It is a circular shift register with only one FF being set at any particular time , others are cleared.

• A ring counter takes the serial output of the last Flip-Flop of a shift register and provides it to the serial input of the first Flip-Flop.

• Ring Counters are also known as re-circulating shift registers.

Page 20: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Ring Counter

Page 21: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Johnson Counter

• A Johnson Counter re-circulates the last flip-flop Q’ output back to the input of the first Flip-Flop. It doesn’t require an initialization value, and will provide a predictable output state sequence.

Page 22: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Re-Circulating Counters

Johnson Counter00001000110011101111011100110001

A 4-bit Johnson counter has a modulus of 8, meaning there are 8 unique output states.

8 unique states

Page 23: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Johnson Counter

Page 24: Counters - Digital Logic Design (EEE 241)digitallogicdesign.weebly.com/uploads/1/3/5/4/13541180/counters.pdf · Johnson Counter • A Johnson Counter re-circulates the last flip-flop

Self Study

• Revise chapter 6

• Quiz will be taken tomorrow