Digital_Lab_02
"Sensing and Counting the user inputs"
by
Choon B. Kim, Ph.D., a retired ASIC engineer
1. Design Specifications:
Your design counts input pulses from a Push-button switch and displays the result on 7-segment LED Display with following specifications.
1.1) Input pulse is entered by pressing down the Push-button Switch KEY[0] on the board.
1.2) To show an input coming, LEDG[0] light is ON when KEY[0] is pressed..
1.3) SW[0] = 1 resets the counter output to 0 at any time during operation.
1.4) SW[1] = 0 for UP Counting, SW[1] = 1 for DOWN Counting
1.5) The counter works as 4-bit modulo-16 operation(i.e., 0 => 1 => 2 => ... => d => E => F => 0 => 1... ).
1.6) The power-on initial state output is 0.
2. Testing (video on YouTube):
Test case:
UP counting 0 to 5, DOWN counting 5 down to d (*mod16*), UP counting d to 4 (*mod16*), Reset to 0.
"0.....5....0 F E d E F 0...4 0"
https://youtube.com/shorts/c_TMf7m2rdw
3. Recommended additional work:
Add some threshold value for both counting, e.g., 5 for Up counting, 2 for Down counting. Connect a buzzer to GPIO port. When your counting reaches the threshold value, a beep sound occurs to inform you about it. The counting continues as usual.
Test case of threshold values: 5 for Up counting, 2 for Down counting
https://youtube.com/shorts/vaCuWWSq2no
4. Key lesson(s) learned from this Lab:
4.1) How to handle the edge-triggering logic in digital design
4.2) Up/Down counting operation
4.3) Asynchronous reset operation
4.4) Conditional and selective operation
5. Timing(optional):
Assuming your design is used as a part of a bigger clock-based system, find the maximum clock frequency of your design.
Explain how you get it.
------------------------------------------- The End of Digital_Lab_02 ---------------------------------------------------