Skip to content

Logic Circuits Lesson Project/ In this project, an advanced Vending machine is designed and implemented, which has many management and practical capabilities.

Notifications You must be signed in to change notification settings

ehsan-esf0/Vending-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6d0e2f6 Β· Feb 16, 2025

History

12 Commits
Jan 6, 2025
Jan 6, 2025
Feb 16, 2025
Jan 6, 2025
Jan 6, 2025

Repository files navigation

πŸ›’ Sales and Inventory Management System with Verilog πŸ›οΈ

This project implements a simple sales and inventory management system using Verilog hardware description language. The system can calculate the total price, apply discounts, compute the remaining amount, and manage product inventory. It also detects low stock levels and issues alerts. 🚨


✨ Features

  • πŸ“¦ Inventory Management: Manages initial and final stock levels for each product.
  • πŸ’° Price Calculation: Calculates the total price based on the quantity of products purchased.
  • 🎁 Discounts: Applies discounts when a specific quantity of products is purchased.
  • πŸ’Έ Remaining Amount: Computes the remaining amount after payment.
  • 🚨 Low Stock Alert: Issues alerts when stock levels are low.

🧩 Project Structure

The project includes the following modules:

  • DFF.v: D Flip-Flop module.
  • FMS.v: Finite State Machine module.
  • Remaining.v: Remaining amount calculation module.
  • Register.v: Register module.
  • decoder_3to8.v: 3-to-8 decoder module.
  • Comparator.v: Comparator module.
  • DiscountCalculator.v: Discount calculation module.
  • ProductCounter.v: Product counter module.
  • InventoryCounter.v: Inventory counter module.
  • LowStockAlert.v: Low stock alert module.
  • SalesRegister.v: Sales register module.

πŸš€ How to Run

To run the project, follow these steps:

  1. Simulation: Use a Verilog simulator like ModelSim or Icarus Verilog.
  2. Compile: Compile the Verilog files.
  3. Run: Execute the testbench to view the simulation results.
iverilog -o output MainModule.v testbench.v
vvp output

πŸ“Š Testbench Outputs

The testbench automatically displays the following outputs:

  • πŸ†” Product ID: Product identifier.
  • πŸ’΅ Price: Unit price of the product.
  • πŸ’³ Total Price: Total price without discount.
  • πŸŽ‰ Discounted Price: Total price after applying the discount.
  • πŸ’Έ Amount Paid: Amount paid by the customer.
  • πŸ”„ Remaining Amount: Remaining amount after payment.
  • πŸ“¦ Quantity: Quantity of products purchased.
  • πŸ“₯ Initial Inventory Counts: Initial stock levels for each product.
  • πŸ“€ Final Inventory Counts: Final stock levels for each product after purchase.
  • 🚨 Alerts: Low stock alerts for each product.

πŸ“¦ Dependencies

  • Icarus Verilog: For simulating and running Verilog code.
  • GTKWave: For viewing simulation waveforms (optional).

🀝 Contributing

If you'd like to contribute to this project, please follow these steps:

  1. Fork the project. 🍴
  2. Create a new branch (git checkout -b feature/YourFeatureName). 🌿
  3. Commit your changes (git commit -m 'Add some feature'). πŸ’Ύ
  4. Push your changes to your repository (git push origin feature/YourFeatureName). πŸš€
  5. Open a pull request. πŸ“₯

About

Logic Circuits Lesson Project/ In this project, an advanced Vending machine is designed and implemented, which has many management and practical capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published