V4:
When adding a coin with the coin counter at max (=0x1F), the coin counter resets, as shown in the attached picture.

Possible solution: returning the newly inserted coin
-
switch no a special state
...
elsif m100 = '1' then
if count < MAX_COUNT then pe <= soma;
else pe <= devolve2;
end if; else ...`
-
update D100 to reflect the special case
d100 <= '1' when (ea = devolve or ea = devolve2) else '0';
-
add the new state to the state enumeration
type state is (action, soma, sgreen, satum, sbacon, nulo, devolve, devolve2);
-
create a new constant (for the sake of readability)
constant MAX_COUNT : integer := 2**(count'length)-1;
V4:
When adding a coin with the coin counter at max (=0x1F), the coin counter resets, as shown in the attached picture.
Possible solution: returning the newly inserted coin
switch no a special state
...elsif m100 = '1' thenif count < MAX_COUNT thenpe <= soma;elsepe <= devolve2;end if;else...`update D100 to reflect the special case
d100 <= '1' when (ea = devolve or ea = devolve2) else '0';add the new state to the state enumeration
type state is (action, soma, sgreen, satum, sbacon, nulo, devolve, devolve2);create a new constant (for the sake of readability)
constant MAX_COUNT : integer := 2**(count'length)-1;