counters mano & kime sections 5-4, 5-5. counters ripple counter synchronous binary counters...

31
Counters Mano & Kime Sections 5-4, 5-5

Post on 15-Jan-2016

235 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Counters

Mano & Kime

Sections 5-4, 5-5

Page 2: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Counters

• Ripple Counter

• Synchronous Binary Counters– Design with D Flip-Flops– Design with J-K Flip-Flops

• Counters in VHDL

Page 3: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Counters ---

Page 4: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

A 4-bit Ripple Counter

Recall...

Less SignificantBit output is Clockfor Next Significant Bit!(Clock - active low)

Page 5: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

J-K Flip-Flop from a D Flip-Flop

DQ = J & !Q # !K & Q

DQ = Q

DQ = 0

DQ =!Q # Q = 1

DQ = !Q

Page 6: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters
Page 7: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters
Page 8: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters
Page 9: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters
Page 10: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Counters

• Ripple Counter

• Synchronous Binary Counters– Design with D Flip-Flops– Design with J-K Flip-Flops

• Counters in VHDL

Page 11: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

CLK

D Q

!Q

CLK

D Q

!Q

CLK

D Q

!Q

Q0Q0.D

Q1

Q2

Q1.D

Q2.D

s0 0 0 0 0 0 1s1 0 0 1 0 1 0s2 0 1 0 0 1 1s3 0 1 1 1 0 0s4 1 0 0 1 0 1s5 1 0 1 1 1 0s6 1 1 0 1 1 1s7 1 1 1 0 0 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Divide-by-8 Counter

Page 12: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

s0 0 0 0 0 0 1s1 0 0 1 0 1 0s2 0 1 0 0 1 1s3 0 1 1 1 0 0s4 1 0 0 1 0 1s5 1 0 1 1 1 0s6 1 1 0 1 1 1s7 1 1 1 0 0 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Divide-by-8 Counter

Q2

Q1 Q000 01 11 10

0

1 1 11

1

Q2.D

Q2.D = !Q2 & Q1 & Q0 # Q2 & !Q1 # Q2 & !Q0

Page 13: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

s0 0 0 0 0 0 1s1 0 0 1 0 1 0s2 0 1 0 0 1 1s3 0 1 1 1 0 0s4 1 0 0 1 0 1s5 1 0 1 1 1 0s6 1 1 0 1 1 1s7 1 1 1 0 0 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Divide-by-8 Counter

Q2

Q1 Q000 01 11 10

0

1

1

11

1

Q1.D

Q1.D = !Q1 & Q0 # Q1 & !Q0

Page 14: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

s0 0 0 0 0 0 1s1 0 0 1 0 1 0s2 0 1 0 0 1 1s3 0 1 1 1 0 0s4 1 0 0 1 0 1s5 1 0 1 1 1 0s6 1 1 0 1 1 1s7 1 1 1 0 0 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Divide-by-8 Counter

Q2

Q1 Q000 01 11 10

0

1

1

11

1

Q0.D

Q0.D = ! Q0

Page 15: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

CUPL SimulationOutput File

Page 16: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

CLK

D Q

!Q

CLK

D Q

!Q

CLK

D Q

!Q

Q0Q0.D

Q1

Q2

Q1.D

Q2.D

s0 0 0 0 1 1 1s1 0 0 1 0 0 0s2 0 1 0 0 0 1s3 0 1 1 0 1 0s4 1 0 0 0 1 1s5 1 0 1 1 0 0s6 1 1 0 1 0 1s7 1 1 1 1 1 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

3-Bit Down Counter

Page 17: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

3-Bit Down Counter

Q2

Q1 Q000 01 11 10

0

1 1 11

1

Q2.D

Q2.D = !Q2 & !Q1 & !Q0 # Q2 & Q1 # Q2 & Q0

s0 0 0 0 1 1 1s1 0 0 1 0 0 0s2 0 1 0 0 0 1s3 0 1 1 0 1 0s4 1 0 0 0 1 1s5 1 0 1 1 0 0s6 1 1 0 1 0 1s7 1 1 1 1 1 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Page 18: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

3-Bit Down Counter

Q2

Q1 Q000 01 11 10

0

1

1

11

1

Q1.D

Q1.D = !Q1 & !Q0 # Q1 & Q0

s0 0 0 0 1 1 1s1 0 0 1 0 0 0s2 0 1 0 0 0 1s3 0 1 1 0 1 0s4 1 0 0 0 1 1s5 1 0 1 1 0 0s6 1 1 0 1 0 1s7 1 1 1 1 1 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Page 19: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

3-Bit Down Counter

Q2

Q1 Q000 01 11 10

0

1

1

11

1

Q0.D

Q0.D = ! Q0

s0 0 0 0 1 1 1s1 0 0 1 0 0 0s2 0 1 0 0 0 1s3 0 1 1 0 1 0s4 1 0 0 0 1 1s5 1 0 1 1 0 0s6 1 1 0 1 0 1s7 1 1 1 1 1 0

State Q2 Q1 Q0 Q2.D Q1.D Q0.D

Page 20: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Up-Down Counter

Up-DownCounter

Q0

Q1

Q2

clock

UD

UD = 0: count upUD = 1: count down

Page 21: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Up-Down Counter

1 0 0 0 1 1 11 0 0 1 0 0 01 0 1 0 0 0 11 0 1 1 0 1 01 1 0 0 0 1 11 1 0 1 1 0 01 1 1 0 1 0 11 1 1 1 1 1 0

UD Q2 Q1 Q0 Q2.D Q1.D Q0.D

0 0 0 0 0 0 10 0 0 1 0 1 00 0 1 0 0 1 10 0 1 1 1 0 00 1 0 0 1 0 10 1 0 1 1 1 00 1 1 0 1 1 10 1 1 1 0 0 0

UD Q2 Q1 Q0 Q2.D Q1.D Q0.D

Up-Counter Down-Counter

Page 22: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

UD Q2

Q1 Q000 01 11 10

00

01

11

10

Up-Down Counter

Make Karnaugh maps for Q2.D, Q1.D, and Q0.D

Page 23: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Counters

• Ripple Counter

• Synchronous Binary Counters– Design with D Flip-Flops– Design with J-K Flip-Flops

• Counters in VHDL

Page 24: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

J-K Flip Flop Design of a Binary Up Counter

Synchronous Binary Counters

Page 25: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

J-K Flip Flop Design of a Binary Up Counter

Synchronous Binary Counters

Page 26: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

J-K Flip Flop Design of a Binary Up Counter

Synchronous Binary Counters

Page 27: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

J-K Flip Flop Design of a Binary Up Counter

Synchronous Binary Counters

Page 28: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

4 - Bit CounterLogic Diagram

Page 29: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

Counters

• Ripple Counter

• Synchronous Binary Counters– Design with D Flip-Flops– Design with J-K Flip-Flops

• Counters in VHDL

Page 30: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters
Page 31: Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters

4-Bit Binary Counter with Reset