dpatel
Newbie level 5
Hii -
My first post here. I am trying to store a value on a button press:
Now, when I synthesise this it warns of latches on 'num' but that's what I want (to store the value of the switches when the button is pressed). When I try to implement I get an error and can go no further.
I know the latch is because of an incomplete case so if I add an "else" the error goes and everything works.
But this means that when I release the button it will set num back to 0!
What am I doing wrong/missing?
My first post here. I am trying to store a value on a button press:
Code:
num <= switches(7 downto 0) when button = '1';
Now, when I synthesise this it warns of latches on 'num' but that's what I want (to store the value of the switches when the button is pressed). When I try to implement I get an error and can go no further.
I know the latch is because of an incomplete case so if I add an "else" the error goes and everything works.
Code:
num <= switches(7 downto 0) when button = '1' else "00000000";
But this means that when I release the button it will set num back to 0!
What am I doing wrong/missing?