Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 12 Counter Circuits and Applications William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc.

Similar presentations


Presentation on theme: "Chapter 12 Counter Circuits and Applications William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc."— Presentation transcript:

1 Chapter 12 Counter Circuits and Applications William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

2 Analysis of Sequential Circuits Mix of combinational logic gates and flip- flops See Examples 12-1, 12-2, 12-3 and 12-4 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

3 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

4 Solution: William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

5 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

6 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

7 Solution: William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

8 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

9 Ripple Counters: JK FFs and VHDL Description Flip-flops used to form binary counters Cascade one output to next input Three flip-flops for a 3-bit counter –2 3 = 8 different combinations –000 through 111 –modulus is 8 –MOD8 counter William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

10 Ripple Counters: JK FFs and VHDL Description Use the toggle mode See Figure 12-9 See Figure –waveforms –state diagram Asynchronous counters William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

11 Figure 12-9 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

12 Ripple Counters: JK FFs and VHDL Description Propagation delay skews the waveform –See Figure Maximum frequency is determined by reciprocal of the combination of propagation delays MOD16 counter –four flip-flops –See Figure and William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

13 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

14 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

15 Ripple Counters: JK FFs and VHDL Description Down Counters –take binary outputs from the not-Q outputs –See Figure and William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

16 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

17 Ripple Counters: JK FFs and VHDL Description VHDL description of a Mod-16 up counter –VHDL description –simulation –see figure and William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

18 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

19 Design of Divide-by-N Counters Reduce the frequency of periodic waveforms –See Figure Divide-by-5 (MOD5) counter –See Figure –See Figure waveforms state diagram Any modulus counter can be formed by using external gating William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

20 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

21 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

22 Ripple Counter Integrated Circuits 7493 –4-bit binary ripple counter –See Figure logic diagram –See Figure MOD16 ripple counter –See Figure MOD12 ripple counter 7490 also used 7492 also used William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

23 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

24 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

25 System Design Applications LED illuminate for 1 s once every 13 s –See example Turn on LED for 20 ms once every 100 ms –See Application Three digit decimal counter –See Application William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

26 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

27 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

28 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

29 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

30 System Design Applications Digital clock capable of hours, min and sec –See example Egg timer circuit –See example William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

31 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

32 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

33 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

34 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

35 Seven-Segment LED Display Decoders: The 7447 IC and VHDL Description Counters must output BCD Common-Anode LED Display –See Figure physical layout schematic pin configuration –driver needs active-LOW outputs Common-Cathode LED Display –needs active-HIGH output - not common William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

36 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

37 Seven-Segment LED Display Decoders: The 7447 IC and VHDL Description BCD-to-Seven-Segment Decoder/Driver ICs 7447 –4-bit BCD input –seven active-LOW outputs –lamp test input –ripple blanking input and output –See Figure –See Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

38 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

39 Seven-Segment LED Display Decoders: The 7447 IC and VHDL Description Driving a Multiplexed Display with a Microcontroller –to save power –not all displays on at once –See Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

40 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

41 Seven-Segment LED Display Decoders: The 7447 IC and VHDL Description VHDL description of the seven segment decoder –7447 decoding features in VHDL –truth table –see table 12-2 –see figure –see figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

42 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

43 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

44 Synchronous Counters All clock inputs tied to common clock line 4-bit synchronous counter –MOD16 counter –4 flip-flops –See Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

45 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

46 Synchronous Up/Down Counter ICs and – decade counter – binary counter –See Figure logic symbol –two clock inputs (up and down) –terminal count outputs - when max is reached –Function Table See Table 12-3 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

47 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

48 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

49 Synchronous Up/Down Counter ICs and – BCD counter – bit counter –See Figure logic symbol –parallel load - preset counter –U/D - select up or down counting –terminal count output when max reached –ripple clock output for cascading William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

50 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

51 Synchronous Up/Down Counter ICs 74160/61/62/63 –count enable inputs –terminal count output –See Figure logic symbol William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

52 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

53 Applications of Synchronous Counter ICs Count 0 to 9, 9 to 0 and 0 to 9 –See example Divide-by-9 frequency divider using –See example Divide-by-200 using synchronous counters –See example MOD7 synchronous up-counter using –See example William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

54 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

55 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

56 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

57 William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

58 VHDL and LPM Counters VHDL up-counter –4 bit –asynchronous reset –parallel load –similar to See figure and William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

59 Figure Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

60 VHDL and LPM Counters VHDL up-down counter see figure A flow chart is helpful in describing a program with many IF-ELSE and ELSIF statements –see figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

61 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

62 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

63 VHDL and LPM Counters LPM counter –pre-defined counter LPM_COUNTER synchronous and asynchronous inputs specify LPM_WIDTH and LPM_MODULUS –LPM up/down counter with asynchronous set and clear and a count enable William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

64 Implementing State Machines in VHDL Outputs of a state machine are triggered by a clock and other input stimulus VHDL implementation of a state machine –define the sequence of output states –step through the states in a numerical order, or –step through the states in an order determined by one or more control inputs William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

65 Implementing State Machines in VHDL A gray code sequencer in VHDL and the simulation –see figure –see figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

66 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

67 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

68 Implementing State Machines in VHDL State machine design are commonly used in stepper motor control –stepper motor operation –present state and next state –stepper motor state diagram see figure –4 bit stepper motor sequencer and simulation see figure and William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

69 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

70 Figure William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

71 Implementing State Machines in VHDL State machines with multiple control inputs –control (handshake) signals between peripherals and the microprocessor read, write, ready to receive, ready to transmit, buffer full, end of transmit, and parity error 8 bit Analog to digital converter (ADC) operation –the ADC in VHDL William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

72 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. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

73 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. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

74 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. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

75 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. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

76 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. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

77 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. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

78 Summary VHDL can be used to implement Mod-n counters. A seven segment decoder can be effectively described in VHDL. The library of parameterized modules provides an LPM counter that can be customized to perform many counting tasks. State Machines can be implemented in VHDL. William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.


Download ppt "Chapter 12 Counter Circuits and Applications William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc."

Similar presentations


Ads by Google