Here I am trying to make a simple program to give an example of using if statements, making the delay, bit toggle flag. To be easily understood, the example here is applied to 8led flasher with a certain period. In block entities, STOP as the input channel in the form of bit, serves to turn off the 8 led. Q_LED an 8bit output channel an array of Q_LED [7 .. 0], serves to turn on or turn off the leds. Internally there is a register for the delay is variable called ‘delay’, serves as a counter delay for the flashing leds. In addition there is a flip-flop bit to mark the led is in a state of on / off is called as “flag_blink”.
To calculate the period of the leds flashing is obtained based on frequency oscillator of fpga about 50MHz. With 50MHz oscillator the period become 20 nano second. At line 20 variable flag_blink will be toggled every 2500*8000 count of oscillator period. Time of toggle will be 2500*800*20 nano second = 400,000,000 nano second or 0.4 second. All leds will be turned on about 0.4 second and will be turned of about 0.4 second.
Last updated byat .