Unit6 Boolean Algebra and LOgical Gates
Unit6 Boolean Algebra and LOgical Gates
Unit6 Boolean Algebra and LOgical Gates
Before we look at logic gates, let us try to represent basic logic operations using an
arrangement of switches that can control the states of a light bulb, either to go ON or OFF.
Battery Bulb
Bulb
c) NOT Operation
1. NOT circuit
In this circuit, when switch A is open, the bulb comes ON since there is a complete flow of
electrical current in the circuit. However, when A is closed, the bulb finds itself in between two
+ve opposing voltages that are equal to each other so it goes OFF. Therefore, when the state of
the switch is 1, that of the bulb is at 0. This is a generally referred to as the inversion or NOT
operation i.e. it inverts the input from 1 to 0 and vice versa.
2. AND circuit
Both switch A AND B must be closed (in state 1) before the bulb can light. If either or both
switches are open, the bulb is also OFF. This circuit represents the AND logic where all the
switches must be closed in order to light the bulb.
3. OR Logic
In this case if either switch A OR B is closed, the bulb will light. The bulb will be off only if
both switches A and B are open at the same time.
LOGIC GATE
A logic gate is the basic building block of a digital circuit. A digital circuit is one that can only be in
one of two states at any one time, either ON or OFF. An ON means there is high voltage in the
circuit while an OFF means zero or no voltage in the circuit. It usually has an input side (with one,
two or more inputs) and a single output.
There are quite a number of different logic gates. However, the basic ones are shown in table
6.1 below. Before discussing each one of them, take note of their names and drawing. You
should be able to identify and/or draw the representation of a particular gate.
The truth tables are important because they help us to know the output of each individual gate
given certain inputs hence we can use them to construct more complex logic circuits that can
solve real problems.
Truth tables for various logic gates
Based on the characteristics of individual logic gates, we can be able to investigate the
behaviour of each gate when a combination of inputs are used. For the sake of simplicity, we
look at gates that have only two inputs and one output. We accomplish this by constructing truth
tables. A truth table arranges all possible input combinations and their relevant outputs. In this
case, A and B represent inputs to the logic gate while Q the output.
Boolean algebra
Boolean algebra was invented by George Boole in 1654. It can be used to automate the
manipulation of objects that control real life processes. This is because computers are made up
of digital switches that are either ON or OFF. Since the inputs and outcomes of Boolean algebra
are either 1 or 0, it is a more natural way of representing digital information or computing logic.
The algebra is used to explain or solve problems related to logic and digital circuits.
There are several laws of Boolean algebra. The most common operators that are used to
manipulate the various logic elements are the OR (+) and the AND (•) e.g.
A + B means A OR B.
A•B means A AND B or mostly just written as AB without the (•) symbol.
1. Commutative law
The commutative law states as follows:
A+B=B+A
A•B = B•A
2. Associative law
The associative law states as follows:
(A+B)+C=A+(B+C)
(A•B)•C = A•(B•C)
3. Distributive law
The distributive law states as follows:
A•(B+C) = A•B + A•C
A + (B•C) = (A+B).(A+C)
4. Identity law
The identity law states as follows:
–
(i) A + A = A
–
(ii) A•A = A
Also:
–
NB: If A = 1 then A = 0. The bar on top signifies a NOT operation on the variable.
5. Redundance law
The redundance law states as follows:
A+A•B=A
A•(A+B) = A
6. De Morgans law
(i) =A.B
– –
(ii) (A•B) = A + B
NB: One of the most common mistakes that learners make is to assume that:
(A•B) = A•B.
7. Boolean constants
Using boolean algebra which entails applying identities and De-Morgan’s law.
Using truth tables to simplify Boolean equations is good and straight forward. However, when
the logic circuits become more complex with more inputs, truth tables become very
cumbersome. It is desired therefore to find a better way of representing logic in such scenarios.
We use a standard form of boolean equations known as the canonical form written in SOP or
POS format. The SOP and POS equations help a person to quickly derive solutions from a
given logic table and come up with equivalent logic circuits.
Sum of products
We have so far seen that given a boolean value A, we assume that A = 1 and its complement is
A = 0. Conventionally, we can write a boolean expression which has three variables in the
following form:
This kind of expression has three groups of the products of the variables A, B and
(AND operations) which are summed together (ORed). We therefore call such an expression a
sum of products (SOP). Each term in the equation is called a minterm
e.g. ABC is one of the three minterms. However, note that the domain of three binary variables
is capable of generating eight different minterms but only three were chosen for the above
equation. We are going to see how such equations are generated from truth tables.
In the SOP arrangement, the AND operations have precedence over the OR operations.
That means we first AND the terms in the minterms before we do the OR operations.