Resources | Subject Notes | Computer Science
Boolean logic is the foundation of digital circuits and computer science. It deals with logical operations that can be represented by binary values (0 for false and 1 for true). Understanding Boolean logic is crucial for analyzing and designing digital systems.
There are three main Boolean operators:
A truth table shows all possible input combinations and their corresponding output values for a Boolean expression.
Input A | Input B | Output (A AND B) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Input A | Input B | Output (A OR B) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Input | Output (NOT Input) |
---|---|
0 | 1 |
1 | 0 |
Logic gates are electronic circuits that implement Boolean operations. We can write logic expressions based on the output of these circuits.
If the inputs are A and B, the output is A AND B, which can be represented as: $A \land B$ or $A \cdot B$
If the inputs are A and B, the output is A OR B, which can be represented as: $A \lor B$ or $A \vee B$
If the input is A, the output is NOT A, which can be represented as: $eg A$ or $\overline{A}$
We can derive logic expressions directly from truth tables. Each row in the truth table represents a specific combination of inputs and outputs. We can use these to construct logical statements.
For example, consider the following truth table:
A | B | C | Output |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
We can observe that the output is 1 only when A is 1 and B is 1. Therefore, the logic expression is: $A \land B$
Practice writing logic expressions from simple circuits and truth tables. This will solidify your understanding of Boolean logic.