0% found this document useful (0 votes)
6 views6 pages

Security Code Logic

The document outlines a security code logic system using DIP switches for inputting a password and LEDs for indicating correctness. It describes the components involved, including XOR, AND, and NOT gates, as well as a truth table and boolean algebra expression for the logic. Additionally, it provides a detailed hardware implementation guide for setting up the circuit on a breadboard.

Uploaded by

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

Security Code Logic

The document outlines a security code logic system using DIP switches for inputting a password and LEDs for indicating correctness. It describes the components involved, including XOR, AND, and NOT gates, as well as a truth table and boolean algebra expression for the logic. Additionally, it provides a detailed hardware implementation guide for setting up the circuit on a breadboard.

Uploaded by

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

Haneen Khaled 231027213 Areeg Heiba 231027571 Nada Mokhtar 231027044

SECURITY CODE LOGIC


INPUTS
1- Key Code Switch (DIP Switch):
4 binary inputs representing the correct password (Key_1, Key_2, Key_3, Key_4).
2- Data Entry Switch (DIP Switch):
4 binary inputs representing the entered password (Pass_1, Pass_2, Pass_3,
Pass_4).

OUTPUTS
1- Green LED (Correct Code Indicator):
Lights up when the entered password matches the key code.
2- Red LED (Incorrect Code Indicator):
Lights up when the entered password does not match the key code.

COMPONENTS:
1- XOR Gates:
Compares each bit of the key code with the corresponding data entry bit.
Outputs 1 if the inputs differ, 0 if they match.
2- AND Gates:
Combines outputs of XOR gates to verify that all bits match.
Outputs 1 only when all inputs are 1.
3- NOT Gate:
Inverts the output of the final AND gate to drive the red LED.
Outputs 1 when the AND gate outputs 0.
4- LEDs:
Haneen Khaled 231027213 Areeg Heiba 231027571 Nada Mokhtar 231027044

Indicate whether the entered password is correct or incorrect.

5- Resistors:
Limit the current through the LEDs to prevent damage.

Truth Table:
Key_ Key_ Key_ Key_ Pass_ Pass_ Data Data XOR XOR XOR XOR
1 2 3 4 1 2 3 4 1 2 3 4

0 0 0 0 0 0 0 0 0 0 0 0

1 1 1 1 1 1 1 1 0 0 0 0

1 0 1 0 1 0 0 0 0 0 1 1

1 1 0 1 1 0 0 1 0 1 1 0

AND1 AND2 Final AND Green LED NOT Gate Red LED

1 1 1 ON 0 OFF

1 1 1 ON 0 OFF

0 0 0 OFF 1 ON

0 0 0 OFF 1 ON

BOOLEAN ALGEBRA EXPRESSION:


Output= (Key1⊕Data1)⋅(Key2⊕Data2)⋅(Key3⊕Data3)⋅(Key4⊕Data4)
Haneen Khaled 231027213 Areeg Heiba 231027571 Nada Mokhtar 231027044

CIRCUIT DIAGRAM:

PIN DIAGRAMS:
1- XOR gates:
Haneen Khaled 231027213 Areeg Heiba 231027571 Nada Mokhtar 231027044

2- AND gates:
3- NOT gates:
Haneen Khaled 231027213 Areeg Heiba 231027571 Nada Mokhtar 231027044

HARDWARE IMPLEMNTATION:
 Connect the VCC (5V) pin of each IC to the power rail on the breadboard.
 Connect the GND (Ground) pin of each IC to the ground rail on the
breadboard.
 Attach the first DIP switch to represent the Key Code:
 Connect each switch terminal to the inputs labeled Key_1, Key_2, Key_3,
Key_4.
 Attach the second DIP switch to represent the Data Entry:
 Connect each switch terminal to the inputs labeled Pass_1, Pass_2, Pass_3,
Pass_4.
 Connect the other terminal of each switch to the ground through a resistor.
 For each pair of inputs (Key1/Data1, Key2/Data2, etc.):
 Wire the inputs to the XOR gate on the 74LS86.
 Connect the outputs of the XOR gates to the inputs of the first layer of AND
gates.
 Combine XOR outputs in pairs.
 The first XOR output and the second XOR output as an input for the first
AND gate.
 The third XOR output and the fourth XOR output as an input for the second
AND gate.
 Connect the outputs of the first AND gate and the second AND gate to the
inputs of a third AND gate.
 This final AND gate output determines the output of the code.
 Connect the output of AND3 to the anode of the green LED.
 Use a resistor between the LED cathode and ground.
 Connect the output of the third AND gate to the input of a NOT gate.
 Connect the NOT gate output to the anode of the red LED.
Haneen Khaled 231027213 Areeg Heiba 231027571 Nada Mokhtar 231027044

 Use resistor between the LED cathode and ground.

You might also like