Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2003-2008 BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing.

Similar presentations


Presentation on theme: "© 2003-2008 BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing."— Presentation transcript:

1 © 2003-2008 BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing

2 © 2003-2008 BYU 13 COUNTERS Page 2 ECEn 224 General Sequential Systems D Q Current State State Memory Input Forming Logic Next State

3 © 2003-2008 BYU 13 COUNTERS Page 3 ECEn 224 A Sequential Counter CLK Next State 01 10110001 Current State 00 01101100 The current state loads the next state values in response to the clock edge. IFL reacts after some gate delays to produce a new next state. Clock edges… D Q Current State State Memory +1 Next State 2 Master Slave

4 © 2003-2008 BYU 13 COUNTERS Page 4 ECEn 224 Transition Table for 2-Bit Counter It is the truth table for the input forming logic… It describes what the next state values are as a function of the current state (clock is assumed)

5 © 2003-2008 BYU 13 COUNTERS Page 5 ECEn 224 Implementation of 2-Bit Counter Q0 Q1 D Q CLK N1 N0 N0 = Q0’ N1 =Q1  Q0

6 © 2003-2008 BYU 13 COUNTERS Page 6 ECEn 224 Example 2 – A Gray Code Counter N1= Q0 N0 = Q1’ Q1 D Q Q0 CLK N1 N0

7 © 2003-2008 BYU 13 COUNTERS Page 7 ECEn 224 Example 3 – Not All Count Values Used Desired count sequence = 00 – 01 – 11 - 00 … What should next state for 10 be?

8 © 2003-2008 BYU 13 COUNTERS Page 8 ECEn 224 Example 3 – Not All Count Values Used Do the normal K-map minimization with don’t cares N1 = Q0Q1’N0 = Q0’

9 © 2003-2008 BYU 13 COUNTERS Page 9 ECEn 224 Example 4 – A Ring Counter Desired count sequence = 001 – 010 – 100 - 001 …

10 © 2003-2008 BYU 13 COUNTERS Page 10 ECEn 224 Example 4 – A Ring Counter Desired count sequence = 001 – 010 – 100 - 001 … Doing KMaps leads to: N2 = Q1 N1 = Q0 N0 = Q2 Q2Q2 Q1Q0Q1Q0 01 00X 01X 11XX 101X Q2Q2 Q1Q0Q1Q0 01 00X 011X 11XX 10X Q2Q2 Q1Q0Q1Q0 01 00X1 01X 11XX 10X N2N1N0

11 © 2003-2008 BYU 13 COUNTERS Page 11 ECEn 224 Example 4 – A Ring Counter D Q Q0 Q2 Q1 CLK

12 © 2003-2008 BYU Initial State When a sequential circuit is powered on, we have no guarantee it will start in any particular state We must make sure our counters don’t start in an invalid state –They could remain stuck in invalid states! Most digital systems have a reset signal that is asserted after power up Designers must use flip flops with reset/set inputs as needed to achieve desired startup behavior 13 COUNTERS Page 12 ECEn 224

13 © 2003-2008 BYU 13 COUNTERS Page 13 ECEn 224 A Ring Counter with Reset D Q SET D Q RST D Q RST Q0 Q2 Q1 CLK RESET Reset causes circuit to start in state “001”

14 © 2003-2008 BYU 13 COUNTERS Page 14 ECEn 224 General Counter Design Procedure Write transition table for counter –Use X’s as appropriate Reduce each NX variable to a minimized equation Implement input forming logic (IFL) using gates Draw schematic using FF’s + IFL

15 © 2003-2008 BYU 13 COUNTERS Page 15 ECEn 224 Counters With Alternative FF’s Current State Input Forming Logic T Inputs State Memory T Q

16 © 2003-2008 BYU 13 COUNTERS Page 16 ECEn 224 Excitation Table for T Flip Flop Rearranging rows and/or columns… Tells how inputs affect outputTells what input is needed to achieve desired output transition In the end, they are the same table, just rearranged… Transition TableExcitation Table

17 © 2003-2008 BYU 13 COUNTERS Page 17 ECEn 224 TFF Counter Design Using Augmented Transition Table Next state values Inputs to apply to achieve desired next state

18 © 2003-2008 BYU 13 COUNTERS Page 18 ECEn 224 TFF Counter Design Using Augmented Transition Table Next state values Inputs to apply to achieve desired next state T2 = Q1Q0 T1 = Q0 T0 = ‘1’ Q2Q2 Q1Q0Q1Q0 01 00 01 1111 10 T2

19 © 2003-2008 BYU 13 COUNTERS Page 19 ECEn 224 TFF Counter Design ‘1’ CLK Q1 CLK T Q CLK Q2 Q0

20 © 2003-2008 BYU 13 COUNTERS Page 20 ECEn 224 Excitation Table for JK Flip Flop Rearranging rows and/or columns… Tells how inputs affect output Tells what inputs to apply to achieve desired output transition Do you see why the X’s? In the end, they are the same table, just rearranged…

21 © 2003-2008 BYU 13 COUNTERS Page 21 ECEn 224 JKFF Gray Code Counter Design Next state valuesInputs to apply to achieve desired next state

22 © 2003-2008 BYU 13 COUNTERS Page 22 ECEn 224 JKFF Gray Code Counter Design Next state valuesInputs to apply to achieve desired next state J2 = Q1Q0’ K2 = Q1’ Q0’ J1 = Q2’ Q0 K1 = Q2 Q0 J0 = Q2 Q1 + Q2’ Q1’ = K0’ K0 = Q2’ Q1 + Q2 Q1’ = Q2  Q1

23 © 2003-2008 BYU 13 COUNTERS Page 23 ECEn 224 General Counter Design Procedure Write transition table for counter –Use X’s as appropriate –If not DFF’s, augment table Reduce each FF input variable to a minimized equation Implement IFL with gates Draw schematic using FF’s + IFL

24 © 2003-2008 BYU 13 COUNTERS Page 24 ECEn 224 Counters With Outputs Outputs D Q Current State Input Forming Logic Next State State Memory Output Forming Logic Outputs = f (CurrentState)

25 © 2003-2008 BYU 13 COUNTERS Page 25 ECEn 224 Counters With Outputs Z=1 when count={0,3,6} Z is called a Moore or static output. It is a function only of the current state.

26 © 2003-2008 BYU 13 COUNTERS Page 26 ECEn 224 Combined Transition Table Current stateNext stateOutput Z = Q2’ Q1’ Q0’ + Q2’ Q1 Q0 + Q2 Q1 Q0’ (implement OFL with gates)

27 © 2003-2008 BYU 13 COUNTERS Page 27 ECEn 224 D Q Q2 Q1 Q0 N2 N1 N0 Z Counter With A Moore Output IFL OFL CLK

28 © 2003-2008 BYU 13 COUNTERS Page 28 ECEn 224 Counter Timing Characteristics Q0 Q1 D Q CLK N1 N0 T ClockPeriod >= t CLK-Q + t IFL + t setup CLK Next State (N’s) 01 10 Current State (Q’s) 00 0110 t CLK-Q t IFL t setup T ClockPeriod

29 © 2003-2008 BYU 13 COUNTERS Page 29 ECEn 224 Counter Timing Example t CLK  Q = 1ns t IFL = 7ns t setup = 2ns Recall the following: –T = Clock period –f = Clock frequency or rate –T = 1/f –f = 1/T T >= 1ns + 7ns + 2ns = 10 ns (10 x 10 -9 s) f <= 1/T = 100 MHz (100 x 10 6 Hz)

30 © 2003-2008 BYU 13 COUNTERS Page 30 ECEn 224 Output Timings CLK Z Current State 010 011100 t CLK  Q t OFL t CLK  Q t OFL Moore outputs appear t CLK  Q + t OFL after the clock edge.

31 © 2003-2008 BYU 13 COUNTERS Page 31 ECEn 224 Counters and Timing The count sequence affects the size of IFL The size of the IFL affects t IFL t IFL affects T ClockPeriod Choosing binary counts is not always fastest or smallest

32 © 2003-2008 BYU 13 COUNTERS Page 32 ECEn 224 Example Problem Design a 3-bit binary counter The Z output is TRUE iff count value is even The Y output is TRUE iff count value is multiple of 3


Download ppt "© 2003-2008 BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing."

Similar presentations


Ads by Google