In this design challenge, you are going to finish a seven-segment decoder circuit that can drive the 4-digit 7sd device on the Digilent® board. We will take a hierarchical design approach to this problem, and the modules you designed in this design challenge will be reused in other projects as well.
|1||Digilent Nexys™4, Nexys™3, Nexys™2, or Basys™2 FPGA Board|
|1||Xilinx ISE Design Suite: WebPACK (14.6 Recommended)|
Design and implement a “Bin2Seg” seven-segment decoder circuit that can drive a single digit on the 4-digit 7sd device on the Digilent board (you are not required to simulate this circuit). Your decoder should display the decimal digits 0-9 for bit patterns 0000-1001, and A-F for bit patterns 1010-1111 (you will need to get a little bit creative to show all of the hex digits—think about lower-case letters). Use four slide switches as inputs to select the pattern to be displayed. Recall that you will need to drive the anode signal of the digit you wish to use to GND (you can drive the others to Vdd to ensure they are off—note that if you drive all of the anode signals to GND, then all four digits will show the same pattern). Figure 1 displays the binary to seven-segment decoder.
Adding to your circuit from the previous section, create a circuit that can drive a second digit on the 7sd device with a new digit pattern defined by the other four slide switches on your board. Since there are only seven signals available to drive the digit segments, you need only one bin2hex component to drive those signals, and a 2:1 “bus multiplexer” to choose which set of switches are connected to the bin2hex component. The signal used to select which switches drive the display can also be used to select which digit is enabled—using the same signal for both purposes ensures the correct data will always appear on the same display digit. A push button can be used to drive the select signal. Figure 2 below shows the seven-segment display circuit.
In previous sections, the push button is used to select which data will be displayed on which digit. However, in a fully functional seven segment display, different data should be displayed on all digits at the same time. To do that, we take the same step as in the previous projects—use a counter to cycle through all of the selection patterns at a reasonable speed. Here is a counter file ready for you to use:
Implement the top level module according to the diagram shown below in Fig. 3.