Boolean logic (3)
Resources |
Revision Questions |
Computer Science
Login to see all questions
Click on a question to view the answer
1.
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
2.
Consider a logic circuit with two inputs, X and Y. The output is 'TRUE' only if either X is 'TRUE' OR Y is 'TRUE'. Describe the logic gate(s) required to create this circuit. Write the corresponding logic expression and provide a truth table to illustrate its operation.
To create a circuit that outputs 'TRUE' if either X or Y is 'TRUE', we need a logical OR operation. The logic expression for this is: Output = X OR Y.
Here's the truth table:
| X | Y | Output (X OR Y) |
| FALSE | FALSE | FALSE |
| FALSE | TRUE | TRUE |
| TRUE | FALSE | TRUE |
| TRUE | TRUE | TRUE |
The logic circuit would consist of an OR gate with two inputs: one representing X and one representing Y. The output of the OR gate would indicate whether either X or Y is 'TRUE'.
3.
The expression (P AND Q) OR NOT R is a logical expression. (a) Create a truth table to show all possible combinations of inputs for this expression. (b) What is the output of the expression if P=TRUE, Q=FALSE, and R=TRUE?
(a) Truth Table:
| P | Q | R | P AND Q | NOT R | (P AND Q) OR NOT R |
| T | T | T | T | F | F |
| T | T | F | T | T | T |
| T | F | T | T | F | T |
| T | F | F | T | T | T |
| F | T | T | F | F | F |
| F | T | F | F | T | F |
| F | F | T | F | F | F |
| F | F | F | F | T | F |
(b) P=TRUE, Q=FALSE, R=TRUE
- P AND Q = TRUE AND FALSE = FALSE
- NOT R = NOT TRUE = FALSE
- (P AND Q) OR NOT R = FALSE OR FALSE = FALSE
Therefore, the output of the expression is FALSE.