Boolean Logic
Boolean logic is based on binary logic, where you start with two inputs and end up with one output. Just like when you add two numbers together to make a combined single number.
Imagine two inputs, both of which can be either 0 or 1.The state of the two inputs are compared and an output is produced, the value of which can also be either 0 or 1.
The value of the output is dependent on which Boolean operation you perform on the two inputs. Operations that can be performed are AND, OR, NOT, NAND, NOR and XOR - exclusive OR.
Boolean logic is actually based on logic gates. Logic gate are used in the construction of logic circuits and a logic gate accepts two incoming voltages and output a single voltage.
For the purpose of understanding IP address and subnet masks, the only logic operation you need to understand is the AND gate.
AND GATE
The AND gate produces a 1 only if both inputs are 1 . Otherwise a 0 is produced.
Have a look at the four possible outputs you can have with two inputs...
Here is part of a truth table for the AND gate:-
x |
y |
Q = (x.y) |
0 |
0 |
0 |
0 |
1 |
|
1 |
0 |
|
1 |
1 |
|
Would you like to fill in the rest using the diagrams for reference?
OR GATE
Just for the record, here is the OR gate:-
The OR gate produces a 1 if at least one input is 1 . Otherwise a 0 is produced.
Have a look...
Here is part of a truth table for the OR gate:-
x |
y |
Q = (x + y) |
0 |
0 |
0 |
0 |
1
|
|
1 |
0 |
|
1 |
1 |
|
Would you like to fill in the rest using the diagrams for reference?
NOT GATE
Here is a NOT gate:-
The NOT gate inverts an input so a 1 becomes a 0 and a 0 becomes a 1 .
Have a look...
Here is the truth table for the NOT gate:-
|