Thomas Stanka wrote:
> On 21 Nov., 09:48, goous...@gmail.com wrote:
> [..]
>> if Button ='0' then
>> -- do this
>> else
>> -- do that
>> end if.
>
> Note: Using the button this way is perfect for the first steps in
> VHDL. It is a complete nogo later on.
> You should be aware that direct usage of an input pin driven by a
> switch offers no protection for the signal at change from the
> asynchronous outer world to the internal used clock domain and you
> also ignore bouncing of the input during switch events.
> This will likely cause some strange missmatch between simulation and
> real hardware.
>
> Second step would be a module that debounces input and ensures, that
> the input pin itself is used only after beeing clocked by the internal
> clock domain (there has to be only one register, that is directly
> driven by this pin, no logic, all other functionality uses the
> registered value of input).
>
> bye Thomas
Just don't use the same counter to debounce the switch that rolls
the dice. That's a really easy way to get non-random behavior
-- Gabor