DLD Project Report Complete

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

AIR UNIVERSITY DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

DIGITAL LOGIC DESIGN

COMPLEX ENGINEERING ACTIVITY

TITLE: DESIGNING OF A VENDING MACHINE

AMMAD MAHMOOD (191863)

DATE: JANUARY 7TH 2021


AIR UNIVERSITY
DEPARTMENT OF ELECTRICAL AND COMPUTER
ENGINEERING
LAB TITLE: Complex Engineering Activity

Student Name: Ammad Mahmood Reg. No:191863


Objective:

LAB ASSESSMENT:

Excellent Good Average Satisfactory Unsatisfactory


Attributes
(5) (4) (3) (2) (1)
Ability to Conduct
Experiment
Ability to assimilate the
results
Effective use of lab
equipment and follows
the lab safety rules

Total Marks: Obtained Marks:

LAB REPORT ASSESSMENT:


Excellent Good Average Satisfactory Unsatisfactory
Attributes
(5) (4) (3) (2) (1)

Data presentation

Experimental results

Conclusion

Total Marks: Obtained Marks:

Date: Signature:

Objective:
Objective of the given project is to make vending machine by application of logics and
combinations that we have learned in the dld course .
Discussion:
A machine that dispenses small articles such as food, drinks, or cigarettes when a coin or token is
inserted.
Now here we will see the logics and concepts of digital logic design used in the working of a vending
machine.
Now instead of a typical vending machine our project is based a bit different, because it is a lab
project so it is based on leds to show different products. The customer can enter the amount of money
and can choose any product to purchase. The machine will also display the remaining balance
depending on the product selected. We have implemented various combinations so one can choose
any product from the tray.
Data:
As per requirement of the cep that 4 inputs(1,2,5,10) should be given from a source and to convert
these decimal inputs we have to use switches each switch represents one bit, so total 16 bits(using
switches) act as inputs. Furthermore, to get the sum of the inputs 8 - bit adders are used and output is
shown through BCD.
Functionality of selected items:
A 3x8 decoder is used to select the product from tray. It selects the output with respect to the
inputs. However, decoder output is represented through 8 Led lights, which will glow when the
respective entry is entered. It is further elaborated in the discussion via truth table.

 A price is set when the price/ inputs and item are selected through switches. Then through an
arrangement of adders, price is adjusted.
 A subtractor is used for this purpose where adjusted price is subtracted from the input
value/price.

Working principle:
This vending machine requires 16 inputs and 16/4 bits for each decimal number (price) to be entered
which is then added by adder according to the given problem. Also 3 inputs for the selection of the
items which acts as input of decoder and its output gives the selected item as per inputs. Now, the
decoder output is shown by LED’s and which is further passed with arrangements of the adders to
adjust the price of the selected item.
a subtractor subtracts inputs from 16 switches and adjusted price and the return amount is
displayed through BCD.
Introduction:
Vending machines are the coin-operated machine that can dispense snacks, coffee, sandwiches’,
juices, tea etc... Any place where people gather, pass by, or must wait is a good location for vending
machine.
We are designing a vending machine using logic circuits and LEDs. whose price ranges from 1 to 18.
Customer can choose a product from tray containing eight LEDs acting as products and can also
enter the amount of rupees using switches. Now in this machine balance amount will be returned
back on 7-segment display if he/she provides excess money to the machine.
The electrical components required for this project are given below:

1. One magnitude comparator 74LS85


2. Nine 4 bits adder SN54/74LS83A
3. Two 2 x 4 decoder SN74LVC1G139
4. Four 7-segment displays
5. Four 7-segment displays
6. One 3 x 8 decoder 74HC238
7. Nine LEDs and seven resister
8. Seven switches

Main phases:-
The block diagram for vending machine has following parts.

 Input
 Selection
 Output
 Balance remaining

Designing details:
In above discussion, it is clarified theoretically that how the circuitry works .But now we will discuss
how the main components of the circuit behaves in calculation, Such as:

 Decoder

 Adder

 Comparator

 Subtractor
Decoder:
A,B,C act as selection inputs so when press “000” it will select the first item and so on…

Inputs Output
A B C Do D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
 Minterms:

A>B=A3.B3’+x3.A2.B2’+x3.x2.A1.B1’+x3.x2.x1.Ao.bo’
A<B=A3’.B3+x3.A2’.B2+x3.x2.A1’.B1+x3.x2.x1.Ao’.bo
Adder:
In circuit 4 bit adders are combined to add 16 bit inputs. A 4 bit truth table is given below:

Inputs A Inputs B Sum carry


Ao A1 A2 A3 Bo B1 B2 B3 So S1 S2 S3 Co
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 1 0 0
0 0 1 0 0 0 1 0 0 1 0 0 0
0 0 1 1 0 0 1 1 0 1 1 0 0
0 1 0 0 0 1 0 0 1 0 0 0 0
0 1 0 1 0 1 0 1 1 0 1 0 0
0 1 1 0 0 1 1 0 1 1 0 0 0
0 1 1 1 0 1 1 1 1 1 1 0 0
1 0 0 0 1 0 0 0 0 0 0 0 1
1 0 0 1 1 0 0 1 0 0 1 0 1
1 0 1 0 1 0 1 0 0 1 0 0 1
1 0 1 1 1 0 1 1 0 1 1 0 1
1 1 0 0 1 1 0 0 1 0 0 0 1
1 1 0 1 1 1 0 1 1 0 1 0 1
1 1 1 0 1 1 1 0 1 1 0 0 1
1 1 1 1 1 1 1 1 1 1 1 0 1
Subtractor:
In circuit 4 bit adders are combined to add 16 bit inputs. A 4 bit truth table is given below:

Inputs A Inputs B Difference Borrow


Ao A1 A2 A3 Bo B1 B2 B3 Do D1 D2 D3 Bo
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 1 0 0
0 0 1 0 0 0 1 0 0 1 0 0 0
0 0 1 1 0 0 1 1 0 1 1 0 0
0 1 0 0 0 1 0 0 1 0 0 0 0
0 1 0 1 0 1 0 1 1 0 1 0 0
0 1 1 0 0 1 1 0 1 1 0 0 0
0 1 1 1 0 1 1 1 1 1 1 0 0
1 0 0 0 1 0 0 0 0 0 0 0 1
1 0 0 1 1 0 0 1 0 0 1 0 1
1 0 1 0 1 0 1 0 0 1 0 0 1
1 0 1 1 1 0 1 1 0 1 1 0 1
1 1 0 0 1 1 0 0 1 0 0 0 1
1 1 0 1 1 1 0 1 1 0 1 0 1
1 1 1 0 1 1 1 0 1 1 0 0 1
1 1 1 1 1 1 1 1 1 1 1 0 1
MODULES:
State table:
FOR PRICE RUPEE 9:

A B X Y A B Z
t+1 t+1
0 0 0 0 0 1 0
0 0 0 1 X X X
0 0 1 0 1 1 0
0 0 1 1 0 0 1
0 1 0 0 1 0 0
0 1 0 1 X X X
0 1 1 0 X X X
0 1 1 1 X X X
1 0 0 0 X X X
1 0 0 1 X X X
1 0 1 0 0 0 1
1 0 1 1 X X X
1 1 0 0 X X X
1 1 0 1 0 0 1
1 1 1 0 X X X
1 1 1 1 X X X
State equations
FOR PRICE RUPEE 9:
A(t+1 )=∑(2,4)+d(1,5,6,7,8,9,11,12,14,15)
After kmaps implementation we have
A(t+1) =A’B+A’XY’
B (t+1) =∑(0,2)+d(1,5,6,7,8,9,11,12,14,15)
After kmaps implementation we have
B(t+1)=A’B’Y’
Z=∑(3,10,13)+d(1,5,6,7,8,9,11,12,14,15)
After kmaps implementation we have
Z =Y+A

Checking details :
Inputs are given from left side so that it can flow from left to right to make process easy as standard.
An input of 7 and 2 bit is given through different switches which are then added and it shows 9. Also
‘001’ is given to the decoder which selects second item from 8 total items. At the end it gives 1 as a
return amount and that is how this circuit testing is done while having no mistake in
calculations/logic.
Conclusion:
The purpose to understand the implementation of the core concepts of the digital logic design
course was completely implied and fulfilled in this complex engineering problem which
enabled the learners to understand how actually digital circuits on machinery level work in
the industry and how are they designed.

You might also like