Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.

Similar presentations


Presentation on theme: "ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles."— Presentation transcript:

1 ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles R. Kime

2 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 2 Counters

3 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 3 Counter Basics: Divide by 2

4 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 4 Divide Clock Frequency by 2

5 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 5 Ripple Counter

6 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 6 Ripple Counter (Continued)

7 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 7 Ripple Counter (Continued)

8 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 8 Ripple Counter (Continued)

9 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 9 Ripple Counter (Continued)

10 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 10 Ripple Counter (Continued)

11 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 11 Ripple Counter (Continued)

12 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 12 Synchronous Counters

13 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 13 Synchronous Counters (Continued)

14 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 14 Synchronous Counters (Continued)

15 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 15 Synchronous Counters – Serial Gating When a two-input AND gate is used for each stage of the counter with a “ripple- like” carry, this is referred to as serial gating. As the size of the counter increases the delay through the combinational logic increases roughly in proportion to n, the number of stages.

16 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 16 Synchronous Counters – Parallel Gating When a multiple-input ( >2) AND gates are used for each stage of the counter with logic dedicated to each stage or to a group of stages, this is referred to as parallel gating. It resembles carry lookahead in an adder. As the size of the counter increases the delay through the combinational logic increases roughly in proportion to n/m, the number of stages/the group size.

17 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 17 Design: Synchronous BCD

18 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 18 Synchronous BCD (Continued) Use K-Maps to minimize the next state function:

19 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 19 Synchronous BCD (Continued) The minimized circuit:

20 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 20 Synchronous BCD (Continued)

21 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 21 Synchronous BCD (Continued)

22 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 22 Synchronous BCD (Continued)

23 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 23 Counter with Parallel Load

24 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 24 Counting Modulo N

25 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 25 Counting Modulo 7

26 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 26 Counting Modulo 7, Asyn.Clear DON’T DO THIS! Referred to as a “suicide” counter!

27 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 27 Counting Modulo 7, Preset 9

28 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 28 Timing Sequences

29 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 29 Counter Decoder Example

30 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 30 Ring Counter

31 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 31 Johnson Counter (Switch-Tail) BCBC

32 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 32 Verilog for Registers and Counters Register – same as flip-flop except multiple bits: reg[3:0] Q; input[3:0] D; always@(posedge CLK or posedge RESET) begin if (RESET)Q <= 4'b0000; else Q <= D; end Shift Register – use concatenate: Q <= {Q[2:0], SI}; Counter – use increment/decrement: count <= count + 1; or count <= count - 1

33 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 33 Verilog Description of Left Shift Register // 4-bit Shift Register with Reset // (See Figure 5-3) module srg_4_r_v (CLK, RESET, SI, Q,SO); input CLK, RESET, SI; output [3:0] Q; output SO; reg [3:0] Q; assign SO = Q[3]; always@(posedge CLK or posedge RESET) begin if (RESET) Q <= 4'b0000; else Q <= {Q[2:0], SI}; end endmodule

34 ECE/CS 352 Digital System Fundamentals Chapter 4 Page 34 Verilog Description of Binary Counter // 4-bit Binary Counter with Reset // (See Figure 5-10) module count_4_r_v (CLK, RESET, EN, Q, CO); input CLK, RESET, EN; output [3:0] Q; output CO; reg [3:0] count; assign Q = count; assign CO = (count == 4'b1111 && EN == 1'b1) ? 1 : 0; always@(posedge CLK or posedge RESET) begin if (RESET) count <= 4'b0; else if (EN) count <= count + 1; end endmodule


Download ppt "ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles."

Similar presentations


Ads by Google