Boolean logic (3)
Resources |
Revision Questions |
Computer Science
Login to see all questions
Click on a question to view the answer
1.
A company is designing a security system for a sensitive area. The system should only allow access if both the correct access card is presented AND the correct PIN is entered. Describe how you would use logic gates to create a logic circuit that implements this security requirement. Include a logic expression and a truth table to demonstrate your design.
To implement this security system, we need a circuit that outputs a 'TRUE' (access granted) only when both the access card is correct (represented by 'A') and the PIN is correct (represented by 'P') are both 'TRUE'. This requires a logical AND operation. The logic expression for this is: Output = A AND P.
Here's the truth table:
Access Card (A) | PIN (P) | Output (A AND P) |
FALSE | FALSE | FALSE |
FALSE | TRUE | FALSE |
TRUE | FALSE | FALSE |
TRUE | TRUE | TRUE |
The logic circuit would consist of an AND gate with two inputs: one representing the access card and one representing the PIN. The output of the AND gate would indicate whether access is granted.
2.
Simplify the following Boolean expression using Boolean algebra laws: NOT (P OR Q) AND (P AND Q). Then, create a truth table for the simplified expression.
Simplification:
- NOT (P OR Q) AND (P AND Q) (Original Expression)
- NOT P AND NOT Q AND P AND Q (De Morgan's Law: NOT (A OR B) = NOT A AND NOT B)
- (NOT P AND P) AND (NOT Q AND Q) (Commutative Law)
- FALSE AND FALSE (Identity Law: A AND FALSE = FALSE)
- FALSE (The expression simplifies to FALSE)
Truth Table for Simplified Expression (FALSE):
P | Q | NOT (P OR Q) | P AND Q | NOT (P OR Q) AND (P AND Q) |
T | T | F | T | F |
T | F | T | F | F |
F | T | T | F | F |
F | F | T | F | F |
3.
Consider a logic circuit with inputs X and Y, and output Z. The circuit is represented by the following truth table:
Write a logic expression for the output Z in terms of X and Y.
Logic Expression: Z = (X AND Y) XOR (X AND Y)
Alternatively, Z = (X AND Y) NOT (X AND Y)
Which simplifies to Z = NOT (X AND Y)
Or, using DeMorgan's Law: Z = NOT X OR NOT Y