7-Segment Display

A numeric display built from seven bar-shaped LEDs, labeled a through g, arranged in a figure-eight. In PaizLogic it takes a 4-bit bus on its single input and lights the segment pattern for that value's hexadecimal digit, 0 through F. Internally, choosing which segments to light for each digit is a combinational function of the four input bits, exactly the job that a BCD-to-seven-segment decoder chip does in real hardware.

Basic

Segment map for 0-F

Wire four switches through a Splitter (or an INPUT set to 4 bits) into the display and step through the values. The table shows which of segments a-g light for every hexadecimal digit; a 1 means that segment is on. For example, value 4 lights b, c, f and g, and value 8 lights all seven segments.

Hexabcdefg
01111110
10110000
21101101
31111001
40110011
51011011
61011111
71110000
81111111
91111011
A1110111
b0011111
C1001110
d0111101
E1001111
F1000111
Intermediate

Decoder driving the display

In real circuits you rarely wire logic straight to the segments. A BCD-to-seven-segment decoder such as the TI SN74LS47 takes the 4-bit number and computes the seven segment signals for you. PaizLogic's 7-SEG has that decoding built in, so the 4-bit bus is all you connect, but understanding the decoder explains why segment g is off for 0 and 1 yet on for every digit that needs a middle bar.

Decoder driving the display
Advanced

Counter counting on the display

Wire a Clock into a 4-bit Counter and the counter bus into the 7-SEG. On every clock edge the display walks 0, 1, 2 ... 9, A ... F and wraps back to 0, a complete single-digit hex counter with no decoder wiring on your part. Add a second Counter and display, chained by the first counter's carry, and you have a two-digit count.

Counter counting on the display

Citations

  • Texas Instruments. (2016). SN54LS47, SN74LS47 BCD-to-seven-segment decoders/drivers [Data sheet]. Reference 1
  • Maxim Integrated. (2003). MAX7219/MAX7221 serially interfaced, 8-digit LED display drivers [Data sheet]. Reference 2
  • Mano, M. M., & Ciletti, M. D. (2018). Digital design: With an introduction to the Verilog HDL, VHDL, and SystemVerilog (6th ed.). Pearson.