I had it like that before, and I didnot get errors. But it did cause warning latches.
Comb:Process(int_counter,current_state, Quarter_in, Dime_in, Nickel_in, Pennny_in, money, Coin_Return)
Begin
If (int_counter = MAXVALUE) Then
Case(current_state)is
When wait1=>
If (money = "0000000")Then -- No money in vending machine
next_state <= Wait1;
Elsif (Quarter_in = '1')Then -- Money is inserted
next_state <= Quarter;
Elsif (Dime_in = '1')Then
next_state <= Dime;
Elsif (Nickel_in = '1')Then
next_state <= Nickel;
Elsif (Pennny_in = '1')Then
next_state <= Penny;
Elsif (money >= "1001011")Then
next_state <= Enough;
Elsif(Coin_Return = '1')Then
next_state <= Change;
Else
next_state <=Wait1;
End If;
----------------------------------------------------------------- After Quarter Inserted, next step
When Quarter =>
Next_state <= Wait1;
----------------------------------------------------------------- After Dime Inserted, next step
When Dime =>
Next_state <= Wait1;
----------------------------------------------------------------- After Nickel Inserted, next step
When Nickel =>
Next_state <= Wait1;
----------------------------------------------------------------- After Penny Inserted, next step
When Penny =>
Next_state <= Wait1;
When Enough =>
If (money >= "1001011")Then
Next_state <= Excess;
Else
Next_state <= vend;
End If;
When Excess =>
Next_state <= vend;
When vend =>
Next_state <= Wait1;
When Change =>
Next_state <= Wait1;
When OTHERS =>
next_state <= Wait1;
End Case;
End If;
End Process;
Warning (10631): VHDL Process Statement warning at Lab06.vhd(84): inferring latch(es) for signal or variable "next_state", which holds its previous value in one or more paths through the process
Warning (10631): VHDL Process Statement warning at Lab06.vhd(138): inferring latch(es) for signal or variable "Money", which holds its previous value in one or more paths through the process
Info (10041): Inferred latch for "Money[0]" at Lab06.vhd(138)
Info (10041): Inferred latch for "Money[1]" at Lab06.vhd(138)
Info (10041): Inferred latch for "Money[2]" at Lab06.vhd(138)
Info (10041): Inferred latch for "Money[3]" at Lab06.vhd(138)
Info (10041): Inferred latch for "Money[4]" at Lab06.vhd(138)
Info (10041): Inferred latch for "Money[5]" at Lab06.vhd(138)
Info (10041): Inferred latch for "Money[6]" at Lab06.vhd(138)
Info (10041): Inferred latch for "next_state.change" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.vend" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.excess" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.enough" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.quarter" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.nickel" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.dime" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.penny" at Lab06.vhd(84)
Info (10041): Inferred latch for "next_state.wait1" at Lab06.vhd(84)