Seven Segment Display Controller

Design Challenge 4


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.

Before you begin, you should:
  • Have the Xilinx® ISE WebPACK™ installed.
  • Have your FPGA board set up.
  • Be able to write a test bench and simulate a circuit using ISim™.
  • Be able to describe combinational circuits behaviorally.
  • Be able to apply hierarchical design methodology to circuit design using Verilog® HDL.
After you're done, you should:
  • Be able to translate functional descriptions of digital systems directly into behavioral Verilog description.

Bin2Seg Decoding Circuit

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.

Figure 1. Binary to seven-segment decoder.

Seven-Segment Display

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.

Figure 2. Seven-segment display circuit.

A Real Seven-Segment Display Controller

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.

Figure 3. Full seven-segment display block diagram.

  • Other product and company names mentioned herein are trademarks or trade names of their respective companies. © 2014 Digilent Inc. All rights reserved.