Professional Documents
Culture Documents
A Simple Vending Machine: VLSI Design and Embedded System (VDES) - 2015
A Simple Vending Machine: VLSI Design and Embedded System (VDES) - 2015
on
Submitted by
1
TABLE OF CONTENTS
No Content Pg. No
1 Acknowledgement 3
2 Introduction 4
3 History 4
5 Theory 5
7 State Diagram 6
9 State table 7
10 Verilog Code 8
11 RTL Schematic 12
12 Output Waveform 13
2
ACKNOWLEDGEMENT
It gives me a great sense of pleasure to present the mini project of VLSI Design lab undertaken
during summer training programme on VLSI Design and Embedded System (VDES)-2015 at
Cetpa Infotech Lucknow. I owe special debt of gratitude to Dr. Haranth Kar (Head of the
Electronics and Communication Department), Dr. Arvind Kumar, Dr. Manish Tiwari, Dr. Sanjeev
Rai, Dr. Santosh Kumar Gupta, for their constant support and guidance throughout the course of
our work. Their sincerity, thoroughness and perseverance have been a constant source of
I also take the opportunity to acknowledge the contribution of VDES Lab Trainer Team, CETPA
Infotech Lucknow, for their full support and assistance during the development of this project.
3
INTRODUCTION
A vending machine is a machine that dispenses items such as snacks, beverages, alcohol, cigarettes,
lottery tickets to customers automatically, after the customer inserts currency or credit into the
machine. The first modern vending machines were developed in England in the early 20th century
and dispensed postcards. The first modern vending machines were developed in England in the early
20th century and dispensed postcards.
4
HISTORY
The earliest known reference to a vending machine is in the work of Hero of Alexandria, a first-
century AD Greek engineer and mathematician. His machine accepted a coin and then dispensed
holy water.[1] When the coin was deposited, it fell upon a pan attached to a lever. The lever
opened a valve which let some water flow out. The pan continued to tilt with the weight of the
coin until it fell off, at which point a counterweight snapped the lever up and turned off the
valve.
The first modern coin-operated vending machines were
introduced in London, England in the early 1880s, dispensing postcards. The machine was
invented by Percival Everitt in 1883 and soon became a widespread feature at railway stations
and post offices, dispensing envelopes, postcards, and notepaper. The Sweetmeat Automatic
Delivery Company was founded in 1887 in England as the first company to deal primarily with
the installation and maintenance of vending machines.
5
EDA TOOL USED: XILINX ISE 8.2i
THEORY
For implementing a simple vending machine, the concept of finite state machnism (FSM) can be
used. There are two types of state machines:
1. MOORE: In a moore machine the output state is totally dependent on the present
state. The diagram shows the information.
2. MEALY: In a mealy machine the output depends on the input as well as the present
state.
6
Fig. no. 03--MEALY FSM
7
STATE DIAGRAM
8
Design Description/Specifications
9
STATE TABLE
TABLE NO.-01
10
VERILOG CODE
end
else
begin
case({s})
A: if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=A;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==1 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=B;
11
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==1 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=C;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==1 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=D;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==1 && v1==0 && v2==0 && v3==0)
begin s<=G;
<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
B: if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=B;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0; end
else if(cr==1 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=C;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
if(cr==0 && c1==1 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=D;
<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
if(cr==0 && c1==0 && c2==1 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=E;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==1 && v1==0 && v2==0 && v3==0)
begin s<=B;
<=0;c1o<=0; c2o<=0;c3o<=1;v1o<=0;v2o<=0;v3o<=0;end
12
E: if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=E;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==1 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=C;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
if(cr==0 && c1==1 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=F;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==1 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=G;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==1 && v1==0 && v2==0 && v3==0)
begin s<=E;
cro<=0;c1o<=0; c2o<=0;c3o<=1;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==0 && v1==1 && v2==0 && v3==0)
begin s<=I;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
F: if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=F;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==1 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=C;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==1 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=G;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==1 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=F;
cro<=0;c1o<=0; c2o<=1;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==1 && v1==0 && v2==0 && v3==0)
begin s<=F;
<=0;c1o<=0; c2o<=0;c3o<=1;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==0 && v1==1 && v2==0 && v3==0)
begin s<=I;
cro<=0;c1o<=1; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==1 && v3==0)
begin s<=J;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
G: if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=G;
13
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==1 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=C;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==1 && c2==0 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=G;
cro<=0;c1o<=1; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==1 && c3==0 && v1==0 && v2==0 && v3==0)
begin s<=G;
cro<=0;c1o<=0; c2o<=1;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
if(cr==0 && c1==0 && c2==0 && c3==1 && v1==0 && v2==0 && v3==0)
begin s<=G;
cro<=0;c1o<=0; c2o<=0;c3o<=1;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==0 && v1==1 && v2==0 && v3==0)
begin s<=I;
cro<=0;c1o<=0; c2o<=1;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==1 && v3==0)
begin s<=J;
cro<=0;c1o<=1; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
else if(cr==0 && c1==0 && c2==0 && c3==0 && v1==0 && v2==0 && v3==1)
begin s<=H;
cro<=0;c1o<=0; c2o<=0;c3o<=0;v1o<=0;v2o<=0;v3o<=0;end
14
RTL SCHEMATIC
15
Fig. no. 05-- RTL SCHEMATIC OF SIMPLE VENDING MACHINE
16
OUTPUT WAVEFORM
17
PRESENT SCENARIO IN INDIA
Vending machines are not very common in India and are usually found only in major cities or
along some national highways. Seaga India, a 100% subsidiary of the Seaga Group of USA, is
the pioneer for bringing the concept of vending machines to India. Seaga India's machines are
being used by the Delhi Metro, the state government, IT parks, factories, BPO, etc.
Vending machines are used to sell snacks, beverages, condoms, public transit tickets, jewelry,
and change for currency notes.
Several reasons have been attributed to the lack of success of vending machines in India. The
availability of cheap labor makes operating stores or kiosks economical; customers lack of
technical knowledge and feel uneasy using vending machines; a lack of machines that accept a
wide variety of payment methods; vandalism, rough use, and poor maintenance of the
machines. However, vending machines are relatively new in India and analysts believe that
usage will rise.
18