CHAP 10 BOOLEAN LOGIC
Boolean Logic:
Boolean logic is a fundamental concept in computer science and mathematics, named after the
mathematician George Boole. It deals with the logical operations on binary variables, which can
have only two possible values: true (usually represented as 1) or false (usually represented as
0).
Standard logic gate symbols:
Thousands of logic gates make up the electronic circuits in solid state drives, controlling
devices, and computers. Logic gates generate binary outputs from binary inputs. A logic circuit
is made up of multiple logic gates that work together to accomplish a certain task.
Logic gate symbols:
This chapter will examine six distinct logic gates:
Truth tables:
Sure, truth tables are used to represent the outputs of logic gates for all possible combinations
of inputs.
A logic circuit can have more than two inputs, even if each logic gate can only have one or two;
for instance, three inputs can result in a potential 23 (=8) binary choices. Additionally, there are
24 (=16) potential binary combinations for four inputs. It is evident that in every scenario, the
number of binary combinations that are feasible is greater than or equal to 2. A truth table's
potential inputs can be summed up as follows:
NAVID SAQIB : 03334259883 1
CHAP 10 BOOLEAN LOGIC
The function of the six logic gates:
AND Gate:
Only when all of its inputs are 1 (true) does the AND gate produce an output of 1 (true). If not,
an output of 0 (false) is produced. It basically verifies that each and every condition is met.
Example: An AND gate in a security system could be used to make sure that before allowing
access, a valid fingerprint and the proper password are provided.
Truth Table Symbol
OR Gate:
If any of the inputs to the OR gate are 1 (true), the OR gate outputs 1 (true). Only when all of
the inputs are 0 (false) does it produce an output of 0 (false). It's similar to asking, "Is at least
one of the conditions true?
Example: In a smart home system, an OR gate might be used to trigger the lights to turn on if
either motion is detected or it's after sunset.
NAVID SAQIB : 03334259883 2
CHAP 10 BOOLEAN LOGIC
Truth Table Symbol
NOT Gate (Inverter):
The NOT gate outputs the opposite of what it received. An output of 0 (false) results from an
input of 1 (true), and vice versa. In essence, it rejects the input.
Example: In a simple alarm system, a NOT gate might be used to sound the alarm if a window is
NOT closed (meaning the window is open).
Truth Table Symbol
NAND Gate (AND with NOT):
The NAND gate functions similarly to an AND gate that is succeeded by a NOT gate. When every
input is 1 (true), it generates an output of 0 (false); otherwise, it generates an output of 1
(true).
Example: In a digital circuit, NAND gates are often used to construct other types of gates
because they are universal gates, meaning any other type of gate can be constructed using only
NAND gates.
Truth Table Symbol
NOR Gate (OR with NOT):
An OR gate followed by a NOT gate is how the NOR gate operates. Only when all of its inputs
are 0 (false) does it create an output of 1 (true); otherwise, it produces an output of 0 (false).
Example: In a computer's arithmetic logic unit (ALU), NOR gates might be used to perform
various logical functions in conjunction with other gates.
NAVID SAQIB : 03334259883 3
CHAP 10 BOOLEAN LOGIC
Truth Table Symbol
XOR Gate (Exclusive OR):
If there are more odd numbers of 1s in the inputs than even numbers, the XOR gate outputs 1
(true). It yields a result of 0 (false) if the number of 1s is even.
Example: In digital communication systems, XOR gates are used for error detection and
correction, ensuring that transmitted data remains intact.
Truth Table Symbol
Logic circuits, logic expressions, truth tables and problem statements:
Example 1: Produce a truth table for the following logic circuit (note the use of black circles at
the junctions between wires):
This logic circuit has three inputs, which means that eight binary values could possibly be
entered.
To progressively demonstrate the creation of the truth table, the logic circuit has been divided
NAVID SAQIB : 03334259883 4
CHAP 10 BOOLEAN LOGIC
into three sections, as indicated by the dotted lines; P, Q, and R represent the intermediate
values.
Part 1:
Finding the intermediate values of P and Q is the first task in this section of the logic circuit.
The AND gate, with A and B as inputs, yields the value of P. The NOR gate, whose inputs are B
and C, yields the value of Q. The logic function descriptions are used to create an intermediate
truth table.
Logic Circuit
Part 2:
P and Q are the inputs of the second portion of the logic circuit, and R is the intermediate
output:
The intermediate truth table that results from this is as follows. (Note: we have generated eight
binary values in part 1, and these must all be used in this second truth table, even though the
logic gate only has two inputs).
NAVID SAQIB : 03334259883 5
CHAP 10 BOOLEAN LOGIC
Part 3:
R and C are the inputs of the last section of the logic circuit, and X is the output:
The third intermediate truth table is thus produced:
The ultimate truth table, which depicts the initial logic circuit, is created by adding the three
intermediate truth tables:
Although you can leave the intermediate values out of the final truth table, it is advisable to
keep them in until you are comfortable creating the truth tables. This is how the final truth
table might appear:
NAVID SAQIB : 03334259883 6
CHAP 10 BOOLEAN LOGIC
Example 2: The logic expression that follows can be used to represent a logic circuit: (A NAND
B) OR (A XOR C) OR
From the preceding proposition, create a truth table and a logic circuit.
An OR linking logic gate is used in this example.
Thus, if we create the circuit's other half using (A XOR C), we obtain:
The circuit's opposite half can be located at (NOT C NAND B):
Now, if we put these two together to create the final logic circuit:
NAVID SAQIB : 03334259883 7
CHAP 10 BOOLEAN LOGIC
NAVID SAQIB : 03334259883 8