Professional Documents
Culture Documents
Experiment - 4
Experiment - 4
Theory
An AND gate is a logic gate having two or more inputs and a single output. An AND gate
operates on logical multiplication rules. In this gate, if either of the inputs is LOW, then the
output is also LOW. If all of the inputs are HIGH, then the output will also be HIGH.
USB
13
} PB5/SCK
PB4/MISO
12
C
11
void loop() ~ PB3/MOSI/OC2A
ARDUINO
10
~ PB2/OC1B
9
{ ~ PB1/OC1A
8
AT MEGA328P-PU
PB0/ICP1/CLKO
int A=digitalRead (A); int B
1121
7
PD7/AIN1
B=digitalRead (B); if(A==0 && A0 ~ PD7/AIN1
6
5
PC0/ADC0
B==0) { A1
A2
PC1/ADC1
~ PD5/T1/OC0B
PD4/T0/XCK
4
3
PC2/ADC2
digitalWrite(C, HIGH); A3
PC3/ADC3
~ PD3/INT1/OC2B
PD2/INT0
2
A4 1
} else A5
PC4/ADC4/SDA PD1/TXD
0
A(2)
PC5/ADC5/SCL PD0/RXD
{ by TEP
digitalWrite(C, LOW); A
}}
Figure 1. Source Code Procedure Figure 2. Circuit diagram
Procedure
1. To download and installed Arduino IDE software which write C programming language.
2. To download and installed Proteus software which simulate the hardware components.
3. To add Arduino Library to Proteus software.
4. To draw circuit diagram on Proteus software.
5. To write the source code on Arduino IDE software.
6. To verify the source code and add hex file to upload hex file on Proteus software.
7. To run the connecting components.
8. To investigate the circuit how to stimulate the system.
Table 1. Measuring the output of the AND gate with Arduino board
INPUTS OUTPUT
A B C
HIGH HIGH
HIGH LOW
LOW HIGH
LOW LOW