fpga4fun.comwhere FPGAs are fun

Opto 4 - LED multiplexing

Now that we know how to drive 7-segments displays, let's aggregate them to make big counters.

The pin count issue

Let's try to build a big display that uses eight 7-segments displays, so that it can show numbers from 0 to 99999999.
If we build it the straightforward way, we are using 64 FPGA pins.

That's not practical as it's a wiring nightmare.
There must be a better way!
LED multiplexing

Now we are using only 16 FPGA pins.
The trade-off is that only one display out of eight can be lit at any particular time. But if the FPGA switches "fast enough", it seems that all the displays are lit.

"Fast enough" means 100Hz or more.
At 100Hz, a display cycle would last 10ms (and each display would be lit 1.25ms per cycle).

Notes:

An 8-digits BCD counter example

Here's a counter design that drives a multiplexed 8-digits 7-segments display.
The counter goes from 00000000 to 99999999, then rolls-over.

The design uses 3 modules:
  1. BCD1: BCD counter (single digit)
  2. BCD8: BCD counter (holds 8 digits)
  3. LED_BCD8x7seg: top-level that drives the display by multiplexing 8 digits

Get the file here.