Group11 Sec03
Group11 Sec03
Group11 Sec03
Group No. 11
Member:
1. Mohammed Hasib Junayed Ilham – 2013729042
[Single Member]
Email: [email protected]
Page | 1
Contents:
1. General Description……………………………………….……3
1.1. Arduino UNO………………………………………….……3
1.2. Arduino IDE…………………………………………….…..3
1.3. Proteus 8 Pro………………………………….……………3
1.4. Logisim……………………………………….……………..4
2. Equipment……………………………………………………….4
3. Method of derivation……………………………………………5
3.1. Truth Table………………………………………………….5
3.2. Derived Results……………………………………………7
7. Arduino Program……………………………………………….11
9. Hardware Implementation…………………………………….14
Page | 2
1. General Description
Page | 3
1.4 Logisim
Logisim is an open-source educational tool used for designing and
simulating digital logic circuits. It provides an intuitive graphical
interface that allows users to create, edit, and simulate digital
circuits with ease. Logisim is commonly used in educational
settings to teach digital logic design concepts such as
combinational and sequential circuits. It offers features for testing
and verifying the behavior of complex digital circuits, making it a
valuable tool for both students and hobbyists interested in digital
electronics. Logisim is a great platform for gaining practical
experience in digital logic design and simulation.
2. Equipment
• Arduino UNO board
• Single pole, double throw (SPDT) switches (4)
• LEDs (4)
• Current limiting resistors for LEDs (4)
• Breadboard and jumper wires
Page | 4
3. Method of Derivation
Output 2:
Page | 5
Output 1:
Output 0:
Page | 6
3.2 Derived Result
Output 3:
Output 2:
Output 1:
Output 0:
Page | 7
5. Circuit Operation Principles
The circuit designed for this project is an implementation of a digital logic operation that
takes four binary inputs (I3, I2, I1, and I0) and produces four binary outputs (O3, O2,
O1, and O0). The purpose of this circuit is to evaluate specific logical expressions
based on the input values and provide corresponding output values according to these
expressions.
Input Configuration:
The input pins are defined in the code as follows:
These input pins are configured as INPUT_PULLUP, which means that when the
switches are in the OFF position, the input pins are pulled HIGH due to the internal pull-
up resistors of the Arduino. When the switches are ON, the input pins are pulled LOW.
Output Configuration:
The output pins are defined in the code as follows:
These output pins are configured as OUTPUT and are used to control the
corresponding LEDs that represent the output values.
Page | 8
Operation:
The core operation of this circuit is based on a set of logical expressions defined in the
code. These expressions determine the output values (O3, O2, O1, O0) based on the
input values (I3, I2, I1, I0). The logical expressions are as follows:
O3: (I0 || !I2 || I3) && (I0 || !I1 || !I3) && (!I1 || I2 || !I3) && (!I0 || I2 || !I3)
O2: (!I1 || I2) && (!I2 || !I3) && (!I0 || !I3)
O1: (I0 || !I1 || I2 || !I3) && (I1 || I2 || I3) && (!I0 || I1 || I3) && (!I0 || !I2 || !I3)
O0: (I0 || I1 || !I3) && (I0 || !I1 || I3) && (!I0 || I1 || I3) && (!I0 || !I1 || !I2) && (!I2 || I3)
The Arduino board reads the input values from the switches connected to the input pins
and evaluates these expressions to compute the output values. The output values are
then applied to the output pins to control the corresponding LEDs. The logic
expressions are designed to encrypt the input data as per the provided encryption table.
The execution time of the logic evaluation is measured, and the results are displayed
via the serial monitor for monitoring purposes. A delay is added to control the update
rate of the outputs.
In summary, this circuit demonstrates a digital logic operation based on specific logical
expressions, and it serves as an example of how an Arduino microcontroller can be
used to implement such logic. The output LEDs visually represent the result of the
logical encryption process.
Page | 9
6. Program Flow Chart
Start
Setup:
- Initialize serial communication at 9600 baud
- Set pins 2, 3, 4, and 5 as INPUT_PULLUP
- Set pins 6, 7, 8, and 9 as OUTPUT
Loop:
- Record the start time using millis()
- Read input values from pins 2, 3, 4, and 5 into inputs array
- Calculate O3 using a complex logic expression
- Calculate O2 using a logic expression
- Calculate O1 using a logic expression
- Calculate O0 using a logic expression
- Set pins 6, 7, 8, and 9 based on O3, O2, O1, and O0 values
- Record the end time using millis()
- Calculate the execution time as the difference between end time and start
time
- Print "Execution Time (ms): " followed by the executionTime
- Add a 1-second delay using delay(1000)
Repeat Loop
End
Page | 10
7. Arduino Program
void setup() {
// Initialize serial communication
Serial.begin(9600);
void loop() {
// Record the start time
unsigned long startTime = millis();
Page | 11
int O0 = (inputs[0] || inputs[1] || !inputs[3]) && (inputs[0] || !inputs[1] ||
inputs[3]) && (!inputs[0] || inputs[1] || inputs[3]) && (!inputs[0] || !inputs[1] ||
!inputs[2]) && (!inputs[2] || inputs[3]);
Page | 12
8. Question & Answers
- what is the size of your hex file generated? Attach the hex codes to
your report.
sketch_oct29a.ino.h
ex
12KB
Page | 13
- Is there any difference between level triggered and edge triggered
operation for the given project?
Yes, there is a significant difference between level-triggered and edge-
triggered operation, and the choice between them can affect how your
project functions, especially when dealing with input changes and
interrupts.
9. Hardware Implementation
https://drive.google.com/file/d/1XmxcuCDOw7-
fJNZjdAZi5I0fkUhJJSDi/view?usp=sharing
Page | 14