hardware_guy
Newbie level 6
Hello. Please help me with this VHDL code.
I need to get pulse, with duration of one clock cycle, in every exact period of time.
For example, my oscillator is 50MHz, I have counter in my system ,signal "count".
To get one clk in every 0.5sec, I use this code:
pulse <= '1' when ( count= X"17D7840" or count= X"2FAF080" or count= X"47868C0" or count= X"5F5E100" or count= X"7735940" or count= X"8F0D180") else '0';
But this is very clumsy solution, and I need to write all combinations.
I know, I can also use counter, what will be reset after every 0.5sec, for this, but I just what to learn a better way.
I think there should be more elegant formula or something..
Something, what will not require extra reseteble counter.
I want one clock cycle pulse every 0.5sec, for 10 sec after reset event. How to do this without writing 20 times "count= X" " and without using extra resetable counter ?
Please advice.
I need to get pulse, with duration of one clock cycle, in every exact period of time.
For example, my oscillator is 50MHz, I have counter in my system ,signal "count".
To get one clk in every 0.5sec, I use this code:
pulse <= '1' when ( count= X"17D7840" or count= X"2FAF080" or count= X"47868C0" or count= X"5F5E100" or count= X"7735940" or count= X"8F0D180") else '0';
But this is very clumsy solution, and I need to write all combinations.
I know, I can also use counter, what will be reset after every 0.5sec, for this, but I just what to learn a better way.
I think there should be more elegant formula or something..
Something, what will not require extra reseteble counter.
I want one clock cycle pulse every 0.5sec, for 10 sec after reset event. How to do this without writing 20 times "count= X" " and without using extra resetable counter ?
Please advice.