In this project, we've designed an 8-bit vending machine that provides customers with two beverage options and accepts 1, 5, and 10 lei banknotes. The entire system is implemented in VHDL, a powerful hardware description language.
Here's a breakdown of how our vending machine operates:
-
Bill Slot: The machine features a single bill slot that accepts 1, 5, and 10 lei banknotes sequentially. A bill sensor provides the processor with a 1-bit input
C
, which becomes 1 when a banknote is detected. Another 8-bit inputV
indicates the value of the banknote in lei. -
Beverage Selection: Two 8-bit inputs,
S0
andS1
, represent the costs of the two beverage options. The values ofS0
andS1
can be set by the owner of the vending machine. The choice is a 1-bit input to the machine (Alegerea
), indicating the selected beverage type (0 for Beverage 0 with costS0
and 1 for Beverage 1 with costS1
). -
Purchase Process: If the deposited amount is less than the beverage cost, the processor generates an 8-bit output
P
to display the deposited amount. Once the processor detects banknotes whose value equals or exceeds the beverage cost, it sets a 2-bit outputD
for a clock cycle, determining the distribution of the beverage (00 or 11 for no action, 01 for dispensing Beverage 0, and 10 for dispensing Beverage 1). -
Change Return: The machine generates an 8-bit output
E
indicating that change should be returned in banknotes.
Each aspect of the vending machine's functionality is implemented in VHDL. The code provides a detailed understanding of the system's operation. Feel free to explore the implementation and reach out if you have any questions or suggestions.