8 leds flasher using pattern look up table

As you can see in this post, the pattern of the 8 leds is only two kinds: turn all leds to off or on. From this post I have an inspiration what if the pattern is stored in a table of ROM or is called  as the look up table (LUT).

Just LED pattern permanently stored in ROM make the LEDs display will have variations. So in this post, the delay time is maintained constant so you can easily understand how it works. But on the other posts will be modified with a delay time that varies.

VHDL Code

 

 

 About the workings of the program above can be explained as follows:

  • Lines 1-3 is definitions of library used. STD_LOGIC_ARITH library contain library of CONV_INTEGER that used in line 36 for converting INTEGER to STD_LOGIC_VECTOR.
  • I / O ports are defined in lines 5-9, STOP to stop flasher, Q_LED to control 8 LED, CLK50MHZ as input timer.
  • Lines 13-23 define the ROM 32x8bits for the pattern of the LED display is called “led_lut”. LUT was marked by the addresses 0-31 or 00000 to 11111 in binary. As marker addresses of LUT is addr_lut and the defining is line 26. 
  • Lines 25-26 are defining of variable dly as delay counter and addr_lut as a marker addresses of LUT. 
  • Lines 31-44 are block of process.

Last updated by at .

Avatar of Bambang Siswoyo

About Bambang Siswoyo

I am a college lecturer since 1988 at UB (University of Brawijaya) in the electronics department. My experience: Applications of Microprocessor system, Applications of Control System, Applications of Field Programmable Gate Array, Computer Programming in computer instrumentations. My hobby: Music especially playing the saxophone, hiking and exploring the countryside.
This entry was posted in Electronics, fpga and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>