Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coin counter resets on overflow #2

Open
andersondomingues opened this issue Oct 3, 2019 · 0 comments
Open

Coin counter resets on overflow #2

andersondomingues opened this issue Oct 3, 2019 · 0 comments

Comments

@andersondomingues
Copy link

andersondomingues commented Oct 3, 2019

V4:

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

image

Possible solution: returning the newly inserted coin

  1. switch no a special state
    ...
    elsif m100 = '1' then
    if count < MAX_COUNT then pe <= soma;
    else pe <= devolve2;
    end if; else ...`

  2. update D100 to reflect the special case
    d100 <= '1' when (ea = devolve or ea = devolve2) else '0';

  3. add the new state to the state enumeration
    type state is (action, soma, sgreen, satum, sbacon, nulo, devolve, devolve2);

  4. create a new constant (for the sake of readability)
    constant MAX_COUNT : integer := 2**(count'length)-1;

     		else
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant