Resources | Subject Notes | Computer Science
Boolean logic is the foundation of digital circuits and computer science. It deals with logical operations that can produce either true or false results. These operations are represented by logic gates.
Boolean logic uses two basic values: True and False. These values are often represented by 1 and 0 respectively.
Boolean operators are used to combine or manipulate Boolean values. The main operators are:
&
or &
|
or | |
~
or '
Truth tables are used to show the output of a Boolean expression for all possible combinations of input values.
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 logic operations. They are constructed using transistors.
An AND gate outputs True only if both of its inputs are True. It's represented by a circle with a connecting line.
An OR gate outputs True if at least one of its inputs is True. It's represented by a circle with a connecting line and a dot.
A NOT gate inverts its input. If the input is True, the output is False, and vice versa. It's represented by a circle with a slash through it.
A NAND gate is the inverse of an AND gate. It outputs False only if both of its inputs are True. It has an AND gate symbol with a circle added to the output.
A NOR gate is the inverse of an OR gate. It outputs True only if both of its inputs are False. It has an OR gate symbol with a circle added to the output.
An XOR (Exclusive OR) gate outputs True if only one of its inputs is True. It outputs False if both inputs are the same (both true or both false).
Combinational logic circuits are circuits where the output depends only on the current input values. They are built using logic gates.
Examples include:
Explore different combinations of logic gates and how they can be used to create more complex digital circuits.