H12: Registers & Counters#
Time Estimate1-2 hours Grade Impact1% DueSep 14 @ 12pm
Notes#
Show your work. You must show all steps of your work for full credit. While calculators can perform these calculations, demonstrating your process ensures understanding and mastery of the concepts.
Notation. To encourage flexibility between notations, the problems in this assignment use a variety of notations. We have discussed each style already; review the textbook or your notes if you need help.
Exercises#
-
Design a 4-bit register using D flip-flops. Draw the circuit diagram and explain how the clock signal controls the loading of data into the register.
-
Describe use cases for a synchronous counter versus an asynchronous counter. Provide examples of applications where each type would be preferred.
-
Design a circuit that can be used to control a vending machine. The circuit has five inputs: Q (quarter), D (dime), N (nickel), Coin, and Resetn. When a coin is deposited in the machine, a coin-sensing mechanism generates a pulse on the appropriate input (Q, D, or N). To signify the occurrence of the event, the mechanism also generates a pulse on the line Coin. The circuit is reset by using the Resetn signal (active low). When at least 30 cents has been deposited, the circuit activates its output, Z. No change is given if the amount exceeds 30 cents. Design the required circuit by using the following components: a six-bit adder, a six-bit register, and any number of AND, OR, and NOT gates.
-
A universal shift register is a sequential circuit that can shift data in either direction (left or right) and can also perform parallel loading of data. Design a 6-bit universal shift register using D flip-flops and multiplexers. Explain how the control signals determine the operation mode (shift left, shift right, parallel load, or hold).
-
Write Verilog code for a universal shift register that implements the design from Exercise 4. Include testbenches to verify the functionality of the shift register in all operation modes.
-
(30 points) Design an 8-bit Johnson counter using D flip-flops. Draw the circuit diagram and explain how the feedback mechanism works to generate the Johnson counter sequence.
-
(20 points) Design a circuit for a practical application that requires a 4-bit up/down counter. The counter should have inputs for counting up, counting down, and resetting to zero. Draw the circuit diagram and explain how the control signals determine the counting direction.