Logic Operations
Submitted to: Ma’am Maira
Group Members
Name Roll no
Nokhaiz Noor 36
Nayyab 28
Samia 44
Rayyan 46
Ammarah 50
Fatima 15
Amina 12
Mahrukh 22
Maha 33
BS- Psychology (1st Semester) Session:
2024-2028
Date of Submission:
January 06, 2025
Department of Psychology
Government College Women University, Sialkot
1
TABLE OF CONTENTS
Logic Operations _____________________________________________________________________________ 3
1. Negation ______________________________________________________________________________ 3
2. Disjunction (OR) _______________________________________________________________________ 4
3. Conjunction (AND) _____________________________________________________________________ 5
Comparison Summary for Negation, Disjunction, and Conjunction _______________________________ 5
Logical Functions __________________________________________________________________________ 6
Strategies to Solve Logic Operations __________________________________________________________ 10
Conclusion _______________________________________________________________________________ 11
2
LOGIC OPERATIONS
Logic operations are the foundation of reasoning in mathematics, computer science, and
electronics. They are used to manipulate true/false values, also known as binary values, to solve
logical problems and design digital circuits.
Logic operations are also called Boolean operations or Boolean logic. These operations are
based on Boolean algebra and involve values that are typically true or false (1 or 0). Common
logic operations include AND, OR, NOT, NAND, NOR, XOR, and XNOR.
Example:
True AND False = False
True OR False = True
LOGIC OPERATIONS
A logical operation refers to a decision-making process where the outcome is either TRUE or
FALSE based on the conditions provided.
There are three types of logic operators:
Negation (NOT)
Disjunction (OR)
Conjunction (AND)
1. NEGATION:
The output is the opposite of the input. If the input is true, the output is false, and vice versa.
Real-Life Example:
Scenario: A light bulb is off when the switch is not pressed.
Explanation:
o The light bulb is off (false) when the switch is not pressed (false).
o When the switch is pressed (true), the light bulb is on (true).
3
Logic Representation:
Light On = NOT(Switch Pressed)
Truth Table:
Switch Pressed Light On (Not)
0 (False) 1 (True)
1 (True) 0 (False
2. DISJUNCTION (OR)
The output is true if at least one of the inputs is true.
Real-Life Example:
Scenario: A doorbell rings if:
1. The doorbell button is pressed.
2. The motion sensor detects someone.
Explanation:
o If either the doorbell button is pressed or the motion sensor detects someone, the doorbell rings
(true).
o If both happen, it still rings.
Logic Representation:
Doorbell Rings = (Button Pressed) OR (Motion Detected)
Truth Table:
Button Pressed Motion Detected Door Bell Rings (On)
0 (False) 0 (False) 0 (False)
0 (False) 1 (True) 1 (True)
1 (True) 0 (False) 1 (True)
1 (True) 1 (True) 1 (True)
4
3. CONJUNCTION (AND)
The output is true only if BOTH inputs are true.
Real-Life Example:
Scenario: A car starts only if:
1. The key is in the ignition.
2. The start button is pressed.
Explanation:
o The car starts (true) only if both conditions are met: the key is in the ignition and the start
button is pressed.
o If either condition is missing, the car won't start.
Logic Representation:
Car Starts = (Key in Ignition) AND (Start Button Pressed)
Truth Table:
Key in Ignition Start Button Pressed Car Starts (AND)
0 (False) 0 (False) 0 (False)
0 (False) 1 (True) 0 (False)
1 (True) 0 (False) 0 (False)
1 (True) 1 (True) 1 (True)
COMPARISON SUMMARY FOR NEGATION, DISJUNCTION, AND
CONJUNCTION
Operation Rule Example Scenario Logic Expression
Light is off if the switch is
NOT Inverts the input. True ¬(Switch Pressed)
NOT pressed.
(Negation) becomes false, false
becomes true.
Doorbell rings if the button (Button Pressed) ∨ (Motion Detected)
OR True if at least one
is pressed OR motion is
(Disjunction) condition is true. detected. .
AND True only if all Car starts when the key is in (Key in Ignition) ∧ (Start Button
(Conjunction) conditions are true. the ignition AND the start Pressed)
button is pressed.
5
LOGICAL FUNCTIONS
The 16 logical functions of two variables, x and y, include AND, OR, NOT, NAND, NOR,
XOR, XNOR, TRUE, FALSE, and various combinations of these with the NOT operator. These
functions represent all the possible outcomes of x and y.
Here are the definitions of the 16 basic logic operations:
1. AND (Conjunction): The result is true (1) only when both operands are true (1).
Otherwise, the result is false (0).
A B (A ∧ B)
0 0 0
0 1 0
1 0 0
1 1 1
2. OR (Disjunction): The result is true (1) if at least one of the operands is true (1). The
result is false (0) only when both operands are false (0).
A B A∨B
0 0 0
0 1 1
1 0 1
1 1 1
3. XOR (Exclusive OR): The result is true (1) when the operands are different. The result
is false (0) when both operands are the same.
A B A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
4. NAND (Not AND): The result is the negation of the AND operation. It is true (1) unless
both operands are true (1).
6
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
5. NOR (Not OR): The result is the negation of the OR operation. It is true (1) only when
both operands are false (0).
A B A NOR B
0 0 1
0 1s 0
1 0 0
1 1 0
6. XNOR (Exclusive NOR): The result is the negation of the XOR operation. It is true (1)
when the operands are the same.
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
7. NOT A (Negation): This is a unary operation that inverts the value of operand A. If A is
true (1), the result is false (0); if A is false (0), the result is true (1).
A NOT A
0 1
1 0
7
8. Implication (A → B): The result is false (0) only when A is true (1) and B is false (0).
Otherwise, the result is true (1).
A B A→B
0 0 1
0 1 1
1 0 0
1 1 1
9. Converse Implication (B → A): The result is false (0) only when B is true (1) and A is
false (0). Otherwise, the result is true (1).
A B B→A
0 0 1
0 1 0
1 0 1
1 1 1
10. Bi-conditional (A ↔ B): The result is true (1) when both operands are the same (both
true or both false); otherwise, the result is false (0).
A B A↔B
0 0 1
0 1 0
1 0 0
1 1 1
8
11. NAND (Not AND) with negated operands: This operation applies negation to both
operands before performing the AND operation. The result is the negation of the AND.
A B NOT A NOT B A And B
0 0 1 1 0
0 1 1 0 1
1 0 0 1 1
1 1 0 0 1
12. NOR with negated operands: This operation applies negation to both operands before
performing the OR operation. The result is the negation of the OR.
A B NOT A NOT B A NOR B
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 0 0 0
13. Converse Implication (A ← B): This is the converse of implication. It is true (1) when
B implies A, i.e., when B is true (1) or A is true (1).
A B A←B
0 0 1
0 1 1
1 0 1
1 1 1
9
14. TRUE (Tautology): This operation always returns true (1), regardless of the values of the
operands.
A NOT A
0 1
1 1
15. FALSE (Contradiction): This operation always returns false (0), regardless of the
values of the operands.
A NOT A
0 0
1 0
16. A AND (NOT B): This operation performs an AND operation between A and the
negation of B. The result is true (1) only when A is true (1) and B is false (0).
A B NOT B A And B
0 0 1 0
0 1 0 0
1 0 1 1
1 1 0 0
STRATEGIES TO SOLVE LOGIC OPERATIONS
Here are some strategies to solve logic operations effectively:
1. Understand the Operators: Familiarize yourself with the meaning of each logic operator
(AND, OR, NOT, IMPLIES, BICONDITIONAL) and how they affect the truth values of
statements.
10
2. Use Truth Tables: Create truth tables for complex expressions to visualize how different
combinations of truth values affect the overall result. This helps in systematically evaluating
the expression.
3. Break Down Complex Statements: If you have a complicated expression, break it down
into smaller parts. Evaluate each part separately before combining them using the appropriate
operators.
4. Apply Logical Identities: Use logical identities (like De Morgan's laws) to simplify
expressions. For example, ¬(P ∧ Q) is equivalent to ¬P ∨ ¬Q.
5. Check for Contradictions: Look for contradictions in the statements. If you find that a
certain condition leads to both true and false outcomes, it can help simplify or eliminate parts
of your expression.
6. Practice with Examples: Work through various examples and problems to become more
comfortable with logic operations. The more you practice, the easier it becomes to recognize
patterns and solutions.
By using these strategies, you can effectively tackle problems involving logic operations! If
you have a specific problem in mind, let me know, and I can help you solve it!
APPLICATIONS OF LOGIC OPERATIONS
Logic operations have numerous applications in:
1. Digital Circuit Design: Logic operations are used to design and implement digital
circuits, such as arithmetic logic units (ALUs) and digital signal processing (DSP) circuits.
2. Computer Programming: Logic operations are used in programming languages, such as
C, C++, and Java, to implement conditional statements, loops, and functions.
3. Computer Architecture: Logic operations are used in computer architecture to design
and implement digital systems, such as central processing units (CPUs) and memory
management units (MMUs).
4. Artificial Intelligence: Logic operations are used in artificial intelligence (AI) to
implement decision-making algorithms, such as decision trees and neural networks.
11
CONCLUSION :
To solve problems involving logic operations, it's essential to:
Understand each logical operator.
Use truth tables to evaluate expressions.
12
Apply Boolean algebra rules and De Morgan’s Laws.
Simplify expressions using logical equivalences.
13