Counting Button Presses
In Chapter 3, Combinational Logic, we learned the basics of Hardware Description Language (HDL) designs by creating a simple design that could detect the number of switches that are on, and the position of the highest switch. The design also featured addition, subtraction, and multiplication. We also discussed signed and unsigned numbers as well as some constructs we needed for our implementation. This was a good first step, but we lacked the ability to store values, which meant that when we released our operator button, the output would go to all 0
s.
In this chapter, we’ll learn how to maintain the state of a design by adding sequential elements. Limited to combinational logic with no way to store information, we can’t accomplish very much. In order to have a useful CPU, you need a program counter, registers, and long-term storage. What would your cell phone be without the capability to store numbers, emails, or pictures?
To achieve this...