CS 1111-01 - AY2025-T4: Introduction to Computer Science UoPeople
Thomas Tewodros Amha
CS 1111-01 - AY2025-T4: Introduction to Computer Science
Instructor: Bhavya Varshney
Assignment Activity: Unit 3
Date of Submission: May 1, 2025
Question 1
a. Define Boolean expressions for the following conditions:
Let: M = Motion sensor in the living room is triggered D = Front door is opened
Then: i) Motion sensor triggered → M
ii) Front door opened → D
b. Simplify the Boolean expressions using Boolean algebra laws:
i) M – already in simplified form
ii) D – already in simplified form.
Question 2
a. Apply De Morgan's Theorems to negate the conditions:
Let: S = Smoke is detected in the kitchen W = Windows are close
Then: i) NOT smoke detected → ¬S
ii) NOT windows closed → ¬W
b. Relationship with other Boolean laws:
CS 1111-01 - AY2025-T4: Introduction to Computer Science UoPeople
De Morgan’s Theorems:
¬(A ∧ B) ≡ ¬A ∨ ¬B
¬(A ∨ B) ≡ ¬A ∧ ¬B
These theorems simplify expressions involving negation.
They also work with
Distributive Law: A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)
Commutative Law: A ∨ B ≡ B ∨ A
Associative Law: (A ∨ B) ∨ C ≡ A ∨ (B ∨ C)
Question 3
a. Truth table for AND gate (M ∧ D):
M D M∧D
0 0 0
0 1 0
1 0 0
1 1 1
b. Truth table for NOR gate (SA NOR W):
Let: SA = Security alarm armed
W = Windows closed
Question 4
a. Check the equivalence of the Boolean expression and truth table:
SA ∨
SA W ¬(SA ∨ W )
W
0 0 0 1
CS 1111-01 - AY2025-T4: Introduction to Computer Science UoPeople
SA ∨
SA W ¬(SA ∨ W )
W
0 1 1 0
1 0 1 0
1 1 1 0
Expression: M ∧ D
Truth table matches the logic of the expression
b. Explanation:
The output is high (1) only when both M and D are 1.
This behavior is identical in both the expression and the truth table.
Question 5
a. Integration of expressions and logic gates:
Intrusion condition → M ∧ D (AND gate)
Security condition → ¬(SA ∨ W) (output of NOR gate)
Final alarm logic:
Alarm = (M ∧ D) ∧ ¬(SA ∨ W)
b. Logic gate structure
One AND gate for M ∧ D
One NOR gate for SA NOR W
One final AND gate to combine the two outputs
Conclusion:
The alarm will only activate if:
Motion is detected and the door is opened
The security system is not armed and windows are not closed