Top Banner
Counters ENT 263 Digital Electronics
58

Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

May 05, 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 - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Counters ENT 263 Digital Electronics

Page 2: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Objectives

• Describe the difference between an asynchronous and a synchronous counter

• Analyze counter timing diagram

• Analyze counter circuits

• Determine the sequence of a counter

• …and more…

Page 3: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Counting in Binary

LSB changes on every number.

The next bit

changes on every

other number.

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

The next bit

changes on every

fourth number.

0 1 0 1 0 1 0 1 0

0 0 1 1 0 0 1 1 0

0 0 0 0 1 1 1 1 0

LSB

MSB

Page 4: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Asynchronous Counter Operation

• In an asynchronous counter, the clock is applied only to the first stage. Subsequent stages derive the clock from the previous stage. – Asynchronous binary counter

• 2-bit asynchronous binary counter • 3-bit asynchronous binary counter • 4-bit asynchronous binary counter

– Asynchronous decade counter

Page 5: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• 2-bit asynchronous binary counter

Page 6: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• 3-bit asynchronous binary counter

Page 7: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• 4-bit asynchronous binary counter

Page 8: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• Asynchronous decade counter

Page 9: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table
Page 10: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Propagation Delay

Page 11: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Synchronous Counter Operation

• Clock signal supplied to all Flip-flops

• Synchronous binary counters

– 2-bit counter

– 3-bit counter

– 4-bit counter

• Synchronous BCD decade counter

Page 12: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• 2-bit synchronous binary counter

0 0 1

Page 13: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• 3-bit synchronous binary counter

0

0 0 0

1 0

0 0

Page 14: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

• 4-bit synchronous binary counter

AND gate

outputs is

HIGH

Page 15: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Synchronous BCD decade counter

0

0 0 0

1

0 0

0

0

0

0

0

1

0 0 1

1 0 0

0

0

Page 16: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Up/Down Synchronous Counters

• 3-bit up/down synchronous counter

• Up/down decade synchronous counter

Page 17: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

3-Bit Up/Down Synchronous Counter

Page 18: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table
Page 19: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table
Page 20: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Up/Down Decade Synchronous

Counter

Page 21: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Design of Synchronous Counters General clocked sequential circuit

Next State

Present State

Page 22: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Steps used in the design of sequential circuit

1. Specify the counter sequence and draw a state diagram

2. Derive a next-state table from the state diagram

3. Develop a transition table showing the flip-flop inputs

required for each transition. The transition table is

always the same for a given type of flip-flop

4. Transfer the J and K states from the transition table to

Karnaugh maps. There is a Karnaugh map for each

input of each flip-flop.

5. Group the Karnaugh map cells to generate and derive

the logic expression for each flip-flop input.

6. Implement the expressions with combinational logic, and

combine with the flip-flops to create the counter.

Page 23: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

State diagram for a 3-bit Gray code counter

Page 24: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Next-state table for a 3-bit Gray code counter.

Present State Next State

Q2 Q1 Q0 Q2 Q1 Q0

0 0 0 0 0 1

0 0 1 0 1 1

0 1 1 0 1 0

0 1 0 1 1 0

1 1 0 1 1 1

1 1 1 1 0 1

1 0 1 1 0 0

1 0 0 0 0 0

Page 25: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Transition Table for a J-K flip-flop

Output Transitions Flip-flop Inputs

QN QN+1 J K

0 0 0 X

0 1 1 X

1 0 X 1

1 1 X 0

QN : present state

QN+1: next state

X: Don’t care

Page 26: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Example of the Mapping Procedure

Page 27: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table
Page 28: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Three-bit Gray code counter.

Page 29: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Example:

Design a counter with the irregular binary count sequence

as shown in the state diagram. Use J-K flip-flops

Page 30: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Next-state table

Present State Next State

Q2 Q1 Q0 Q2 Q1 Q0

0 0 1 0 1 0

0 1 0 1 0 1

1 0 1 1 1 1

1 1 1 0 0 1

Page 31: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Transition Table for a J-K flip-flop

Output Transitions Flip-flop Inputs

QN QN+1 J K

0 0 0 X

0 1 1 X

1 0 X 1

1 1 X 0

Page 32: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

K-MAP

Page 33: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

THE COUNTER CIRCUIT

Page 34: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Example : State diagram for a 3-bit up/down Gray code counter.

Page 35: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

J and K maps for Table 9-11. The UP/DOWN control input, Y, is treated as a fourth variable.

Page 36: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Three-bit up/down Gray code counter.

Page 37: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

CASCADE COUNTERS

Two cascaded counters (all J and K inputs are HIGH).

Page 38: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

A modulus-100 counter using two cascaded decade counters.

Page 39: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Three cascaded decade counters forming a divide-by-1000 frequency divider with intermediate divide- by-10 and divide-by-100 outputs.

Page 40: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Example: Determine the overall modulus of the two cascaded counter for (a) and (b)

For (a) the overall modulus for the 3 counter

configuration is 8 x 12 x 16 = 1536

for (b) the overall modulus for the 4 counter

configuration is 10 x 4 x 7 x 5 = 1400

Page 41: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

A divide-by-100 counter using two 74LS160 decade counters.

Page 42: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Cascaded Counters with Truncated Sequences

A divide-by-40,000 counter using 74HC161 4-bit binary counters. Note that each of the parallel data inputs is shown in binary

order (the right-most bit D0 is the LSB in each counter).

216 = 65,536 65,536 − 40,000 = 25,536 ≈ 63C016

Page 43: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Decoding of state 6 (110).

COUNTER DECODING

* To determine when the counter is in a certain states

in its sequence by using decoders or logic gates.

Active –High Decoding

Page 44: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Example: Implement the decoding of binary state 2 and binary state 7 of a 3-bit synchronous counter. Show the entire counter timing diagram and the output waveforms of the decoding gates.

2 = 010 (𝑄2𝑄1𝑄0)

7 = 111 (𝑄2𝑄1𝑄0)

Page 45: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

A 3-bit counter with active-HIGH decoding of count 2 and count 7.

Page 46: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Decoding Glitches

A basic decade (BCD) counter and decoder.

Page 47: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Outputs with glitches from the previous decoder. Glitch widths are exaggerated for illustration and are usually only a few nanoseconds wide.

Page 48: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

The basic decade counter and decoder with strobing to eliminate glitches.

Strobing: To enable the decoded outputs at a time after the

glitches have had time to disappear. Using LOW level of active-

HIGH clock to enable the decoder.

Page 49: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Strobed decoder outputs for the circuit

Page 50: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Counter Applications

Page 51: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Simplified logic diagram for a 12-hour digital clock.

Page 52: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Logic diagram of typical divide-by-60 counter using 74LS160A synchronous decade counters. Note that the outputs are in binary order (the right-most bit is the LSB).

Page 53: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Logic diagram for hours counter and decoders. Note that on the counter inputs and outputs, the right-most bit is the LSB.

Page 54: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Functional block diagram for parking garage control.

Page 55: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Logic diagram for modulus-100 up/down counter for automobile parking control.

Page 56: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Parallel-to-serial data conversion logic.

Page 57: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Example of parallel-to-serial conversion timing for the previous circuit

Page 58: Counters - Universiti Malaysia Perlisportal.unimap.edu.my/portal/page/portal30/Lecture... · Example : State diagram for a 3-bit up/down Gray code counter. J and K maps for Table

Thank You “Intan berlian walaupun di atas lumpur dia pasti akan

bercahaya, akan tetapi najis ayam walaupun diletakkan di atas meja tetap akan berbau busuk jua”

- Cendikiawan