Verilog codes
Design and Implement Two-Digit Seven-Segment Display Decoder Using a Button
Adding to your circuit from the previous section, create a circuit that can drive the second digit on the segment display 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 "binzseg" component to drive those signals, and a 2:1 "bus multiplexer" to choose which set of switches is connected to the "binzseg" 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 two-digit seven-segment display decoder using a button: 2:1 Bus "binzseg" Mux
Switches(7:4) = Switches(3:0)
Should it be a '0' or a '1' on AN2 and AN3 to turn these digits off?
AN0 AN1
AN2 AN3
Push-button
The inverter allows a single digit to be driven at any time.
Figure 3. Seven-Segment Display Circuit