Presentation is loading. Please wait.

Presentation is loading. Please wait.

Counter Circuits and VHDL State Machines

Similar presentations


Presentation on theme: "Counter Circuits and VHDL State Machines"— Presentation transcript:

1 Counter Circuits and VHDL State Machines
Chapter 12 Counter Circuits and VHDL State Machines 1

2 Objectives You should be able to:
Use timing diagrams for the analysis of sequential logic circuits. Design any modulus ripple counter and frequency divider using J-K flip-flops. Describe the difference between ripple counters and synchronous counters. 2

3 Objectives (Continued)
Solve various counter design applications using 4-bit counter ICs and external gating. Connect seven-segment LEDs and BCD decoders to form multidigit numeric displays. Cascade counter ICs to provide for higher counting and frequency divisions. 3

4 Sequential Logic Circuits
A mix of combinational logic gates and flip-flops Used to count events and time the duration of processes Sequential since they follow a predetermined sequence and are triggered by a timing pulse or clock 4

5 Sequential Logic Circuits
Normally count in binary and can stop or recycle The modulus (MOD) of a counter is defined by the number of binary states A 0 – 7 counter is a MOD-8 counter

6 Sequential Logic Circuits
Counter outputs are usually flip-flops as they can hold a binary state.

7 A MOD-8 Counter Truth Table and Waveforms

8 Analysis of Sequential Circuits
Example 12-1: Input and output waveforms from this edge-triggered D flip-flop based circuit. 5

9 Analysis of Sequential Circuits
Example 12-2: Input and output waveforms from this edge-triggered D flip-flop based circuit. 5

10 Analysis of Sequential Circuits
Example 12-3: This circuit uses negative edge-triggered JK flip-flops. Note that the clock input from the second FF comes from Q0. 5

11 Analysis of Sequential Circuits
Example 12-3: Input and output waveforms. 5

12 Analysis of Sequential Circuits
Example 12-4: Input and output waveforms. 5

13 Ripple Counters Flip-flops can be used to form binary counters
Cascade - Q output of one to clock input of the next Three flip-flops for a 3-bit counter 23 = 8 different combinations Binary 000 through 111 Modulus is 8 MOD8 counter 11

14 Ripple Counters Three J-K flip-flops used toggle mode to form a MOD-8 (3-bit) ripple counter 12

15 Ripple Counters Asynchronous due to propagation delay.
3-bit counter waveform 13

16 Ripple Counters 3-bit counter state diagram 13

17 Ripple Counters Propagation delay skews the waveform 14

18 Ripple Counters Maximum frequency is approximately equal to the reciprocal of the combined propagation delays 15

19 Ripple Counters 16 bit counter and waveforms 16

20 Ripple Counters 17

21 Design of Divide-by-N Counters
Reduce the frequency of periodic waveforms 18

22 Design of Divide-by-N Counters
Divide-by-5 (MOD5) Counter 19

23 Design of Divide-by-N Counters
Divide-by-5 (MOD5) waveforms and state diagram 20

24 Design of Divide-by-N Counters
MOD-6 Up-Counter with a manual push button reset 21

25 Ripple Counter Integrated Circuits
bit binary ripple counter logic diagram and pin configuration 22

26 Ripple Counter Integrated Circuits
7493 connected as a MOD-16 ripple counter 23

27 Ripple Counter Integrated Circuits
7493 can form any modulus counter less than or equal to MOD-16 bit ripple counter Divide by 2 and divide by 5 sections Cascade together to form divide by 10 (decade or BCD) Commonly used in decimal display applications 24

28 Ripple Counter Integrated Circuits
bit ripple counter Divide by 2 and divide by 6 sections Cascade together to form divide by 12 (MOD-12) Commonly used in divide by 6 or divide by 12 applications such as digital clocks 25

29 Ripple Counter Integrated Circuits
Logic diagram and pin configuration for the 7490 26

30 Ripple Counter Integrated Circuits
Logic diagram and pin configuration for the 7492 26

31 System Design Applications
LED illuminate for 1 s once every 13 s See Application 12-1 Turn on LED for 20 ms once every 100 ms See Application 12-2 Three digit decimal counter See Application 12-3 27

32 28

33 Figure 12-33b 29

34 30

35 31

36 System Design Applications
Digital clock capable of hours, min and sec See Application 12-4 Egg timer circuit See Application 12-5 32

37 33

38 Figure 12-36 34

39 35

40 Seven-Segment LED Display Decoders
Common-anode LED requires active-LOW outputs Common-cathode LED requires active-HIGH output - not as popular 38

41 Figure 12-37 36

42 Seven-Segment LED Display Decoders
Counters must output BCD Common-Anode LED Display 37

43 Seven-Segment LED Display Decoders
7447 BCD-to-Seven-Segment Decoder/Driver ICs 4-bit BCD input Seven active-LOW outputs Lamp test input Ripple blanking input and output 39

44 Seven-Segment LED Display Decoders
A segment display driver 40

45 Seven-Segment LED Display Decoders
Driving a Multiplexed Display with a Microcontroller 2 ports can drive up to 8 digits 1 port determines which digit is active 1 port drives the segments More efficient Assembly language used Not all displays are on at once 41

46 Figure 12-44 42

47 Synchronous Counters All clock inputs tied to common clock line
4-bit synchronous counter MOD16 counter 4 flip-flops 43

48 Figure 12-45 44

49 Synchronous Up/Down Counter ICs
74192 and 74193 decade counter binary counter 45

50 Synchronous Up/Down Counter ICs
74192 and 74193 Two clock inputs (up and down) Terminal count outputs - when max is reached Function Table See Table 12-2 in your text 46

51 Synchronous Up/Down Counter ICs
74190 and 74191 BCD counter bit counter 47

52 Synchronous Up/Down Counter ICs
74190 and 74191 Parallel load - preset counter U/D - select up or down counting Terminal count output when max reached Ripple clock output for cascading 48

53 Synchronous Up/Down Counter ICs
74160/61/62/63 Two count enable inputs Terminal count output 49

54 Applications of Synchronous Counter ICs
Count 0 to 9, 9 to 0 and 0 to 9 See Application 12-7 Divide-by-9 frequency divider using 74193 See Application 12-8 Divide-by-200 using synchronous counters See Application 12-9 MOD-7 synchronous up-counter using 74163 See Application 12-10 50

55 51

56 52

57 53

58 54

59 Summary Toggle flip-flops can be cascaded end to end to form ripple counters. Ripple counters cannot be used in high-speed circuits because of the problem they have with the accumulation of propagation delay through all the flip-flops. A down counter can be built by taking the outputs from the not-Q’s of a ripple counter. 67

60 Summary Any modulus (or divide-by) counter can be formed by resetting the basic ripple counter when a specific count is reached. A glitch is a short-duration pulse that may appear on some of the output bits of a counter. 68

61 Summary Ripple counter ICs such as the 7490, 7492, and 7493 have four flip-flops integrated into a single package providing four-bit counter operations. Four-bit counter ICs can be cascaded end to end to form counters with higher than MOD16 capability. 69

62 Summary Seven-segment LED displays choose between seven separate LEDs (plus a decimal point LED) to form the 10 decimal digits. They are constructed with either the anodes or the cathodes connected to a common pin. 70

63 Summary LED displays require a decoder/driver IC such as the 7447 to decode BCD data into a seven-bit code to activate the appropriate segments to illuminate the correct digit. Synchronous counters eliminate the problem of accumulated propagation delay associated with ripple counters by driving all four flip-flops with a common clock. 71

64 Summary The and are 4-bit synchronous counter ICs. They have a count-up/count-down feature and can accept a 4-bit parallel load of binary data. The and synchronous counter ICs are similar to the 74192/74193 except they are better for constructing multistage counters of more than 4 bits. 72

65 Summary The series goes one step further and allows for truly synchronous high-speed multistage counting. 73


Download ppt "Counter Circuits and VHDL State Machines"

Similar presentations


Ads by Google