0% found this document useful (0 votes)
25 views

Report

The document describes an Arduino program that implements a logic circuit using truth table entries. The program takes 3 binary inputs A, B, and C through the serial monitor and always outputs 1 based on the given truth table.

Uploaded by

Shaina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Report

The document describes an Arduino program that implements a logic circuit using truth table entries. The program takes 3 binary inputs A, B, and C through the serial monitor and always outputs 1 based on the given truth table.

Uploaded by

Shaina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

A

Practical activity Report submitted

for Engineering Design Project-II (UTA-014)

by

Name of student-Shaina Gupta Roll number- 101915207

Submitted to

Dr. Sandeep Saharan

DEPARTMENT OF COMPUTER SCIENCE and ENGINEERING


THAPAR INSTITUTE OF ENGINEERING AND TECHNOLOGY,
(A DEEMED TO BE UNIVERSITY), PATIALA, PUNJAB

INDIA
Jan-June 2021
Assignment-3B

OBJECTIVE: Write an optimized Arduino program to implement following logic circuit


using truth table entries and all input values must be provided through serial monitor.

THEORY-

Logic gates are the basic building blocks of any digital system. They are important digital
devices that are mainly based on a Boolean function. Logic gates are used to carry out logical
operations on single or multiple binary inputs and give one binary output. In simple terms,
logic gates are the electronic circuits in a digital system. There are seven basic logic gates:
AND, OR, XOR, NOT, NAND, NOR, and XNOR.

LOGIC GATES USED:

• AND GATE: An AND gate is a logic gate having two or more inputs and a single
output. It gives a High output (1) only if all its inputs are high. A dot (.) is used to
show the AND operation. i.e. A.B
• NOT GATE- A NOT gate is a logic gate that inverts the digital input signal. It is the
most basic of all the logical gates and is often referred to as an Inverting Buffer or
simply an Inverter.

• NAND GATE- The Logic NAND Gate is a combination of a digital logic AND gate
and a NOT gate connected together in series. The output of a NAND gate is high
when either of the inputs is high or if both the inputs are low.

• OR GATE- The Logic OR Gate is a type of digital logic circuit whose output goes
HIGH to a logic level 1 only when one or more of its inputs are HIGH.

• XOR GATE- The Exclusive-OR logic function is a very useful circuit that can be
used in many different types of computational circuits. The output of an Exclusive-
OR gate only goes High when its two input terminals are at different logic levels with
respect to each other.

FINDING INPUTS AND OUTPUTS OF ALL GATES:

TRUTH TABLE:

A B C Y

0 0 0 1

0 0 1 1

0 1 0 1

0 1 1 1

1 0 0 1
1 0 1 1

1 1 0 1

1 1 1 1

CODE-

void setup() {

Serial.begin(9600);

void loop() {

delay(1000);

Serial.println("Enter your values either in 0 or 1");

delay(1000);

Serial.print("Enter value of A:\t ");

while(Serial.available()==0){}

int x=Serial.parseInt();

delay(1000);

Serial.println(x);

Serial.read();

delay(1000);

Serial.print("Enter value of B:\t ");

//READ THE VALUE AND STORE IT IN VARIABLE y

while(Serial.available()==0){}

int y=Serial.parseInt();

delay(1000);

Serial.println(y);

Serial.read();

delay(1000);
Serial.print("Enter value of C:\t ");

while(Serial.available()==0){}

int z=Serial.parseInt();

delay(1000);

//DISPLAY THE VALUE ON SERIAL MONITOR

Serial.println(z);

//since output of the circuit is 1 in all cases output should be displayed as 1

Serial.println("OUTPUT OF LOGIC CIRCUIT IS:\t1");

delay(4000);

RESULT-

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy