Useful VHDL Code - LED
As many people are going to use LED, we will give out our VHDL code for
the LED so that others can use it.
Things to Note
- The decoding from binary number to 7 segments are done internally,
i.e. all done by VHDL (recommended by the professor). This means that
we will have 7-bit output from the Actel chip directly connected to the
LEDs and do not need to have any external BCD-7_segment decoder.
- We will connect the LED externally to 5V. In this way,
when we output a "0" to a particular segment, that segment will be on and
vice versa.
- Here, we have included 2 entities:
- mdecoder is to decode the binary number
into two binary number. For example, input number 23 will be decoded into
"2" and "3" separately.
- decoder is to decode the binary number into
7-segments. For example, input number 8 will be decoded into "0000000".
- m_decoder has 43 modules while decoder has 21 modules.
Author:
Cheong Wong
Norman Chan