Skip to content

Coin counter resets on overflow #2

Description

@andersondomingues

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
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions