I currently have a project in VHDL to make a simple vending machine. I have a std_logic
signal to determine if the cash in is greater than or equal to the price of the item. The cost is an unsigned constant and the cash is an unsigned signal, but despite them both being unsigned numbers of equal bit length, it tells me the >=
operator is undefined. I've looked in multiple reference guides, and all I can find is that the two arguments must be the same type (which they are...) so I'm not sure why it's throwing this error
I have included the proper numeric_std
library.
type STATE_TYPE is (RDY, CLCT, VND);
signal state : STATE_TYPE;
signal next_state : STATE_TYPE;
signal cash : unsigned (7 downto 0);
signal cashnew : unsigned (7 downto 0);
signal candy : std_logic;
signal candy_vend : std_logic;
constant cost_candy : unsigned := to_unsigned(60, 8);
signal chips : std_logic;
signal chips_vend : std_logic;
constant cost_chips : unsigned := to_unsigned(50, 8);
begin
candy <= candy1 or candy2 or candy3;
chips <= chip1 or chip2;
candy_vend <= candy and (cash >= cost_candy);
chips_vend <= chips and (cash >= cost_chips);