Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Embedded Project

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Boolean Expression Calculator

A Project Report Submitted

In Partial fulfillment of the requirement

for the award of the Degree of

M.Tech

In

Electrical Engineering

by

Priya kumari(712336006)

Nikita kurhade(712236005)

Department of Electrical Engineering

College of Engineering Pune Technological University


(COEP Tech)

1
CERTIFICATE

This is to certify that the project report entitled “Boolean Expression


Calculator” submitted by Priya kumari (712336006), Nikita
kurhade (712236005), to the College of Engineering Pune
Technological University in partial fulfillment for the award of the
degree of M. Tech in Electrical Engineering is a bona fide record of
project work carried out by him/her under my/our supervision. The
contents of this report, in full or in parts, have not been submitted to
any other Institution or University for the award of any degree.

------------------------ ------------------------
Prof.A.G. Thosar Prof.Patekar
Supervisor Supervisor

Department of Department of
Electrical Engineering Electrical Engineering

2
Abstract

Boolean algebra, a logic algebra, allows the rules used in the algebra of
numbers to be applied to logic. It formalizes the rules of logic. Boolean
algebra is used to simplify Boolean expressions which represent
combinational logic circuits. It reduces the original expression to an
equivalent expression that has fewer terms which means that less logic
gates are needed to implement the combinational logic circuit. Boolean
algebra seems to be difficult for higher order expressions. In order to
overcome such issue, we have applied our knowledge to calculate the
Boolean algebra for difficult expressions using TIVA board, LED and
few connecting wires. By using this, Boolean algebra can be applied
for any higher order expressions and Boolean expression can be found
easily.

3
I. Introduc on

A Boolean expression is an expression in a programming language that


produces a Boolean value when evaluated, i.e. one of true or false. A
Boolean expression may be composed of a combination of the Boolean
constants true or false, Boolean-typed variables, Boolean-valued
operators, and Boolean-valued functions. Boolean logic is a form of
algebra in which all values are reduced to either TRUE or FALSE.
Boolean logic is especially important for computer science because it
fits nicely with the binary numbering system, in which each bit has a
value of either 1 or 0.

4
II. LITERATURE SURVEY

Boolean Expression Simplifier: In the primary stage of computer


development, its major applications are to do the complex science
computation and numerous and jumbled data processing, for examples
population statistics, salary processing, bills processing, etc. However,
it caused the industrial, government, and academic to pay the attention
on its huge memory and high speed and stable computation capabilities.
The computer technology was continually moving forward, which not
only provided the life convenience to the human but also changed the
traditional education styles that adequately apply the CAI (short for
Computer-Assisted Instruction or Computer-Aided Instruction), which
becomes a new teaching and learning media. In these years, it still more
unceasing integrate all of the words, pictures, sounds, and animations
into the MMCAI (short for Multimedia Computer-Assisted Instruction,
which merge with lots of media resources and interaction
functionalities to convey the complex teaching contents to the users for
improving the learning motivation and interest and enhancing teaching
performance. Therefore, it is another trying to combine the MMCAI
with the conveyance of computer professional knowledge and
theoretical learning during the design on teaching style and originality
thinking. In the history of computer development, the mathematicians
are playing the decisive roles from beginning to end. There are three
outstanding mathematicians, at least, as a result of their theories to
cause the computers to appear on the modern, who are G. Boole, A.
Turing, and J. von Neumann, in where the first one is an England
5
mathematician in nineteen centuries. He proposed the Boolean algebra
that is the foundation of the modern algebra and, in the meantime, it is
the evidence of the modern computer thinking. It is more important to
learn the Boolean algebra that is necessary professional knowledge
during learning the digital circuits. For example, if there are a few
inputs and outputs, we can explain their working properties in the
statement method during describing a digital circuit. To adopt the
statement method is ambiguous during lots of them, but the Boolean
algebra is the best one to describe a complete digital circuit.
Consequently, we have to learn the Boolean algebra to represent,
simplify, and finally obtain the most simplification of a Boolean
expression, and accordingly carry the circuit combination out based on
the Boolean algebra for finishing the design on digital circuits. The
Boolean algebra is the foundation to all of learners on digital circuits,
which results in they are not afraid of when they encountered complex
circuits, and accordingly make the learning be more efficient. To learn
Boolean algebra, besides basic algebra operations, it usually made a
mistake in the logic relationships among operation variables. The
beginners of Boolean algebra are not usually clear of the priority in
simplification that resulted in the wrong outcomes of simplification so
such learning effects have to wait to consult. We expect that they, at
least, possess the ability to employ basic algebra theories for checking
errors so they could clearly know the design correctness during circuit
designing. In the beginner position, nevertheless, to use the word
statements usually makes them ambiguous to explain an abstract

6
concept of the circuit designing theory. Therefore, if there is a suitably
assistant tool to provide help on Boolean algebra teaching, then its
learning effect could be predicted. This is the maximum motivation on
the system construction, i.e., it could assist users to effectively learn the
simplified skills of Boolean algebra and to possess the professional
knowledge of basic circuit design. Its basic functions contain teaching
formulas of the Boolean algebra, looking up rules of the Boolean
algebra, executing simplification of the sum of product (SOP), and
executing simplification of the product of sum (POS), learning
simplification of the Karnaugh map, and looking over simplified result
of the Karnaugh map. The system limited the number of Boolean
variables to less and equal to four for simplifying the system design and
output perplexity of Karnaugh map. The contributions of the system are

1) Convenient Installation The system has been packaged as a


commercial product, which can be setup easily if the user possessed the
knowledge of any software installation.

2) Complete Learning The system contains the complete teaching


knowledge of the Boolean algebra simplification for effectively
supporting interaction learning.

3) Accessible Learning The user can easily use the system if he/she
possessed basic abilities to manipulate the Windows system.

7
III. Cost of the Components

Components Cost

1.Tiva Board (EK-TM4C123GXL) 2400

2. Bread Board 150

3. LED(1X4) 20

4. Register 50

5.Push Bu on Switch(1x3) 30

Total 2650

IV. Components and their descrip on

The following components are used in the designing of a endance monitoring


system:

1. TIVA BOARD((EK-TM4C123GXL)
2. Microso Excel
3. Register
4. Breadboard
5. Push Bo on

8
a) TIVA BOARD

It is basically a microcontroller which can be easily programmed,


erased, and reprogrammed at any instant of me. it is an open-
source compu ng pla orm that is used for construc ng and
programming electronic devices. It is also capable of ac ng as a mini
computer just like other microcontrollers by taking inputs and
controlling the outputs for a variety of electronics.

EK- TM4C123GXL Microcontroller

Elements of TIVA Board can be done into two categories:

1) Hardware

2) So ware

 Hardware The Tiva Launchpad consists of many components that together


make it work. Here are some of those main component blocks that help in its
func oning:

1.) Microcontroller This is the heart of the development board, which works as
a mini computer and can receive as well as send informa on or command to the
peripheral devices connected to it. The microcontroller used differs from board
to board; it also has its own various specifica ons.

9
2.) USB Plug This plug is a very important port in this board. It is used to upload
(burn) a program to the microcontroller using a USB cable. It also has a regulated
power of 5V which also powers the Tiva board in cases when the External Power
Supply is absent.

3.) Internal Programmer The developed software code can be uploaded to the
microcontroller via USB port, without an external programmer.

4.) Reset Button This button is present on the board and can be used to resets the
Tiva microcontroller.

5.) Power & GND Pins There are pins on the development board that provide 3.3,
5 volts and ground through them.

 Software

1) Text editor This is where the simplified code can be written using a simplified
version of C++ programming language.

2) Message area It displays error and gives feedback on saving and exporting the
code.

3) Text The console displays text output by the Arduino environment including
complete error messages and other information.

4) Console Toolbar This toolbar contains various buttons like Verify, Upload,
New, Open, Save and Serial Monitor. On the bottom right-hand corner of the
window there displays the Development Board and the Serial Port in use.

5) Light Emitting Diode Light emitting cell is the reverse of solar cell. Also, it
uses electrical energy to produce photons of certain wavelength. The wavelength
depends on the energy gap of the material. Inside the led there is a Transparent
Plastic Case, Terminal Pins and Diode. The led can be connect by 1.5~2.5V and
10 mA. To prevent overloading, use resistor 470 Ω When current flows across a
diode Negative electron move one way and positive holes move the other way.
The

10
The wholes exist at a lower energy level than the free electrons.
Therefore, when a free electron falls it losses energy. This energy is
emitted in a form of a photon, which causes light. The color of the light
is determined by the fall of the electron and hence energy level of the
photon

Breadboard

A breadboard is used to build and test circuits quickly before


finalizing any circuit design. The breadboard has many holes into
which circuit components like ICs and resistors can be inserted. A
typical breadboard is shown below:

Diagram of Bread Board

11
The bread board has strips of metal which run underneath the board and
connect the holes on the top of the board. The metal strips are laid out as shown
below. Note that the top and bo om rows of holes are connected horizontally
while the remaining holes are connected ver cally. Fig. 5: Pin Configura on of
Bread Board To use the bread board, the legs of components are placed in the
holes. Each set of holes connected by a metal strip underneath forms a node. A
node is a point in a circuit where two components are connected. Connec ons
between different components are formed by pu ng their legs in a common no
The long top and bo om row of holes are usually used for power supply
connec ons. The rest of the circuit is built by placing components and
connec ng them together with jumper wires. ICs are placed in the middle of the
board so that half of the legs are on one side of the middle line and half on the
other.

Bread Boarding Tips It is important to breadboard a circuit neatly and


systema cally, so that one can debug it and get it running easily and quickly. It
also helps when someone else needs to understand and inspect the circuit. Here
are some ps:

1) Always use the side-lines for power supply connec ons. Power the chips from
the side-lines and not directly from the power supply.

2) Use black wires for ground connec ons (0V), and red for other power
connec ons. Keep the jumper wires on the board flat, so that the board does
not look clu ered.

12
3) Route jumper wires around the chips and not over the chips. This makes
changing the chips when needed easier.

4) You could trim the legs of components like resistors, transistors, and LEDs, so
that they fit in snugly and do not get pulled out by accident.

Push Bu on

Bu ons are a simple way to comm-unicate with your Arduino. They can indicate
to your Arduino whether or not they are being pressed. This informa on can be
remembered and used to make decisions in Arduino programming language that
can affect a circuit's behaviour in many ways. Each bu on has four pins. If you
look carefully you will no ce that they are slightly bent. Your bu on has two
sides and the shape of the pins tells you where the sides are - pins that bend
away from each other are connected. When you push the bu on, the two sides
will be connected and current can flow across the bu on

Push Bu on

Circuit Diagram

This is the circuit diagram to calculate the Boolean algebra for difficult
expressions. It consists of Arduino board, LED, push bu ons and few connec ng
wires. By using this, Boolean algebra can be applied for any higher order

13
expressions and Boolean expression can be found easily. Here, in this project we
will implement simple logic gates such as OR, AND, EX-OR gates using Arduino
and will verify the output. Though, we have used only two inputs in this project,
any number of input expressions can be given just by increasing the number of
push bu ons and similarly any logic expressions can be derived as output. Since
manual calcula on of Boolean expression is more difficult and will consume
more amount of me, this project will be more helpful by giving the output
irrespec ve of the number of input terms.

Coding

const int logicSwitchPin = 2;

const int ledOrOutPin = 3;

const int ledAndOutPin = 4;

const int ledXorOutPin = 5;

const int inputXPin = 11;

const int inputYPin = 12;

const int outputPin = 13;

// mode: 0 - OR, 1 - AND, 2 - XOR

14
int mode = 0;

int x = LOW;

int y = LOW;

int output = LOW;

void setup() {

pinMode(logicSwitchPin, INPUT);

pinMode(ledOrOutPin, OUTPUT);

pinMode(ledAndOutPin, OUTPUT);

pinMode(ledXorOutPin, OUTPUT);

pinMode(inputXPin, INPUT);

pinMode(inputYPin, INPUT);

pinMode(outputPin, OUTPUT);

void loop() {
15
x = digitalRead(inputXPin);

y = digitalRead(inputYPin);

switch (mode) {

case 0: // x OR y

digitalWrite(ledOrOutPin, HIGH);

digitalWrite(ledAndOutPin, LOW);

digitalWrite(ledXorOutPin, LOW);

output = (x || y);

digitalWrite(outputPin, output);

break;

case 1: // x AND y

digitalWrite(ledOrOutPin, LOW);

digitalWrite(ledAndOutPin, HIGH);

digitalWrite(ledXorOutPin, LOW);

output = (x && y);


16
digitalWrite(outputPin, output);

break;

case 2: // x XOR y

digitalWrite(ledOrOutPin, LOW);

digitalWrite(ledAndOutPin, LOW);

digitalWrite(ledXorOutPin, HIGH);

output = ((x || y) && !(x && y));

digitalWrite(outputPin, output);

break;

default:

digitalWrite(ledOrOutPin, LOW);

digitalWrite(ledAndOutPin, LOW);

digitalWrite(ledXorOutPin, LOW);

if (digitalRead(logicSwitchPin)) {
17
mode = (mode + 1) % 3;

delay(250);

WORKING PROCESS

A. Procedure This circuit is a simple 3 variable Boolean expression minimizer.


It usesthe Quine McCluskey algorithm which was described in the chapter
1. In this the microcontroller plays a major role, it consists of code to
implement the described algorithm as well as controls other components
in the circuit. Ini ally when the power is switched on an LED will glow
which indicates that the microcontroller is ready to take the input. Here
the input Boolean expression is given in SOP form, i.e. only minterms are
to be entered through the keypad provided. The keypad consists of 9
switches of which 8 switches corresponds to one minterm each and the
9th one is used as next bu on. A er entering the expression, the input
indica ng LED will go OFF, now based on the algorithm microcontroller
reduces the expression and the input represen ng LED glows which
means that the expression has been minimized and is displayed. The
display consists of 3 Bi colour LED’s in which Green Light represents the
variables in normal form and the rest Red Light represents the variables in
the complemented form, the order of them is as shown in the circuit
diagram. The output is displayed as one minterm at a me, next minterm

18
is displayed by pressing the next bu on and a er reaching the last
minterm of the reduced expression the input indica ng LED is switched
OFF which represents end of the output. A er few seconds it is again
switched ON automa cally when micro-controller is ready to take the next
input.
B. Logic Gates The OR gate is a digital logic gate implements logical
disconjunc on– it behaves according to the addi on opera on. A HIGH
output (1) results if one or both the inputs to the gate are HIGH (1). If
neither input is high, a LOW output (0) results. In another sense, the
func on of OR effec vely finds the maximum between two binary digits,
just as the complementary. In Boolean algebra the Logic OR Func on
follows the distribu ve law which allows a change in posi on of either
variable. The OR func on is represented in electronics by the addi on
symbol (+). Thus a 2-input (A+B) OR Gate has an output term represented
by the Boolean expression A+B.

The AND gate is a basic digital logic gate that implements logical conjunc on - it
behaves according to the mul plica on opera on. A HIGH output (1) results only
if all the inputs to the AND gate are HIGH (1). If none or not all inputs to the AND
gate is HIGH, a LOW output results. The func on can be extended to any number
of inputs. In Boolean algebra the Logic AND Func on follows the commuta ve
19
law which allows a change in posi on of either variable. The AND func on is
represented in electronics by the dot or full stop symbol (.). Thus a 2-input (A B)
AND Gate has an output term represented by the Boolean expression A.B or just
AB.

The XOR gate (some mes EOR gate, or EXOR gate and pronounced as Exclusive
OR gate) is a digital logic gate that gives a true (1 or HIGH) output when the
number of true inputs is odd. An XOR gate implements an exclusive or; that is, a
true output results if one, and only one, of the inputs to the gate is true. If both
inputs are false (0/LOW) and both are true, a false output results. XOR represents
the inequality func on. The algebraic expression [(A.B complement) + (A
complement. B)] and both represent the XOR gate with inputs A and B.

20
CONCLUSION & FUTURE ENHANCEMENT

Boolean algebra seems to be difficult for higher order expressions. In order to


overcome such issue, we have applied our knowledge to calculate the Boolean
algebra for difficult expressions using Arduino board, LED and few connec ng
wires. By using this, Boolean algebra can be applied for any higher order
expressions and Boolean expression can be found easily. Thus, we have
successfully implemented the Boolean expression simplifier using Arduino and
breadboard. We can extend this experiment by giving as many input expressions
depending upon the input push bu ons. Here, in our project we have
implemented the opera ons of OR, AND, EX-OR logic gates using Arduino and
have verified the output. Though, we have used only two inputs in this project,
any number of input expressions can be given just by increasing the number of
push bu ons and similarly any logic expressions can be derived as output. Since
manual calcula on of Boolean expression is more difficult and will consume
more amount of me, this project will be more helpful by giving the output
irrespec ve of the number of input terms.

21

You might also like