Boolean Algebra1
Boolean Algebra1
Boolean
Algebra
Introduction
Boolean Algebra is used to analyze and simplify the digital (logic)
circuits. It uses only the binary numbers i.e. 0 and 1. It is also called as
Binary Algebra or logical Algebra. Boolean algebra was invented by
George Boole in 1854.
Computers, as we know them today, are implementations of Booles
Laws of Thought.
In the middle of the twentieth century, computers were commonly known
as thinking machines and electronic brains.
Nowadays, we rarely ponder the relationship between electronic digital
computers and human logic. Computers are accepted as part of our
lives.
Rule in Boolean Algebra
Following are the important rules used in Boolean algebra.
Variable used can have only two values. Binary 1 for HIGH and Binary 0 for LOW.
Complement of a variable is represented by an overbar (-). Thus, complement of
variable B is represented as B . Thus if B = 0 then B=1 and B= 1 then B = 0.
ORing of the variables is represented by a plus (+) sign between them. For
example ORing of A, B, C is represented as A + B + C.
Logical ANDing of the two or more variable is represented by writing a dot
between them such as A.B.C. Sometime the dot may be omitted like ABC.
Boolean Laws
There are six types of Boolean Laws.
Commutative law
i) A.B=B.A ii) A+B=B+A
Associative law
i) (A.B).C=A.(B.C) ii) (A+B)+C=A+(B+C)
This law states that the order in which the logic operations are performed is
irrelevant as their effect is the same.
Boolean Laws
Distributive law
i) A.(B+C)=A.B+A.C
Distributive law states the following condition.
AND law
i) A.0=0 ii) A.A=A
iii) A.1=A iv) A.A =0
These laws use the AND operation. Therefore they are called as AND laws.
Boolean Laws
OR law
i) A+0=A ii) A+A=A
iii) A+1=1 iv) A+A=1
These laws use the OR operation. Therefore they are called as OR laws.
INVERSION law
i) A = A
This law uses the NOT operation. The inversion law states that double inversion of a
variable results in the original variable itself.
Duality
There are useful identities of Boolean expressions that can help us to transform
an expression A into an equivalent expression B.
We can derive additional identities with the help of the dual of a Boolean
expression.
The dual of a Boolean expression is obtained by interchanging Boolean sums and
Boolean products and interchanging 0s and 1s.
Example
The dual of x(y + z) is x + yz.
A 1 0
A
1
0
Theorem 2: Idempotent Laws
Statement: For every a in B,
a+a=a and a * a = a.
Proof:
a + a = (a + a) * 1 (Identity)
= (a + a) * (a + a') (Complement)
= a + (a*a') (Distributive)
=a+ 0 (Complement)
=a (Identity)
A A A A
A A
Theorem 3: De Morgans Law
Theorem3: For every pair a, b in set B:
(a+b) = ab, and (ab) = a+b.
Proof: We show that a+b and ab are complementary.
In other words, we show that both of the following are true
(complement):
(a+b) + (ab) = 1, (a+b)(ab) = 0.
Proof (Continue):
(a+b)+(ab)
=(a+b+a)(a+b+b) (distributive)
=(1+b)(a+1) (complement)
=1 (Theorem 3)
2. (a+b)(ab)
=(ab)(a+b) (commutative)
=aba+abb (distributive)
=0*b+a*0 (complement)
=0+0
=0 (identity)
Theorem 4: Complement
Statement:
The complement of element 1 is 0 and vice versa, i.e.
0' = 1, 1' = 0.
Proof:
0 + 1 = 1 and 0 * 1 = 0 (Postulate 3)
Thus 0= 1, 1= 0 (Postulate 4 and Theorem 2)
Logic Gates
The three simplest gates are the AND, OR, and NOT
gates.
To get the desired canonical SOP expression we will add the minterms (product
terms) for which the output is 1.
F = AB + AB + AB
Product of Sums (POS)
A boolean expression consisting purely of Maxterms (sum terms) is said to be
in canonical product of sums form.
Example
Lets say, we have a boolean function F defined on two variables A and B. So, A
and B are the inputs for F and lets say, output of F is true i.e., F = 1 when
only one of the input is true or 1.
now we draw the truth table for F
Now we will create a column for the maxterm using the variables A and B. If
input is 1 we take the complement of the variable and if input is 0 we take
the variable as is.
To get the desired canonical POS expression we will multiply the maxterms (sum
terms) for which the output is 0.
F = (A+B) . (A+B)
Karnaugh Maps
Boolean algebra helps us simplify expressions and circuits
0 1 Y Y
0 xy xy X xy xy
X
1 xy xy X xy xy
Karnaugh Map Simplifications
Imagine a two-variable sum of minterms:
xy + xy
Both of these minterms appear in the top row of a Karnaugh map, which
means that they both contain the literal x
Y
xy xy
X xy xy
xy + xy = x(y + y) [ Distributive ]
= x 1 [ y + y = 1 ]
= x [x1=x]
A Three-Variable Karnaugh Map
For a three-variable expression with inputs x, y, z, the arrangement of
minterms is more tricky:
YZ YZ
00 01 11 10 00 01 11 10
0 xyz xyz xyz xyz 0 m0 m1 m3 m2
X X
1 xyz xyz xyz xyz 1 m4 m5 m7 m6
Y xyz + xyz
xyz xyz xyz xyz = xz(y + y)
X xyz xyz xyz xyz = xz 1
Z = xz
Y
0 1 0 0
X 0 1 1 1
Z
31
USE OF BOOLEAN ALGEBRA IN COMPUTER
SCIENCE
1. Boolean algebra is the branch of algebra in which the values of the variables are
the truth values true and false, usually denoted 1 and 0 respectively. Instead
of where the values of the variables are numbers, and the prime operations are
addition and multiplication, the main operations of Boolean algebra are
the conjunction and denoted as , the disjunction or denoted as , and
the negation not denoted as . It is thus a formalism for describing logical relations in
the same way that ordinary algebra describes numeric relations.
2. Boolean algebra has been fundamental in the development of digital electronics, and
is provided for in all modern programming languages. It is also used in set
theory and statsistics.
3. In the 1930s, while studying switching circuits,engineer Akira Nakashima
independently discovered Boolean algebra, which he was unaware of until 1938. In a
series of papers published from 1934 to 1936, he formulated a two-valued Boolean
algebra as a way to analyze and design circuits by algebraic means in terms of logic
gates.
In digital circuits the value is 1 for a current or voltage or 0 in the absence of
it. All the circuits in a electronic hardware can be used to form a circuit
diagram consisting of logic gates. Each gate implements a Boolean operation,
and is depicted schematically by a shape indicating the operation. The shapes
associated with the gates for conjunction (AND-gates), disjunction (OR-gates),
and complement (inverters) are as follows.
The basic gates are
1. AND gate
2. OR gate
3. NOT gate
By using boolean algebra we can control the flow of electron in the digital circuit and
thus can control the outcome. For example IC 7402 the circuit is shown below. From
these we can see the logic gates and inputs we can predict the outcome.
Today, all modern general purpose computers perform their functions using two-
value Boolean logic; that is, their electrical circuits are a physical manifestation
of two-value Boolean logic. They achieve this in various ways: as voltages on
wires in high-speed circuits and capacitive storage devices, as orientations of a
magnetic domain in ferromagnetic storage devices, as holes in punched cards or
paper tape, and so on.
All the programs or application in a computer coverts into 0 and 1 while running
in the system which operates the digital circuit inside it and give us the
outcome.
Using of Boolean Algebra in different
projects
Coffee, Tea, or Milk?
Snerdleys Automated Cafeteria orders a machine to dispense coffee, tea,
and milk. Design the machine so that it has a button (input line) for each
choice and so that a customer can have at most one of the three choices.
Two-Floor Elevator
Numerous functions must be performed by the circuitry of an elevator
(open/close door, move up/down, light up/down indicator, and so on). This
example focuses on one aspect of a two-floor elevator: deciding when to
move to the other floor.
Hallway Light
A hallway light is controlled by three switches. If the light is off, clicking
any one of the three switches turns it on. If the light is on, clicking any one
of the three switches turns it off. A fourth input variable is needed to
register the current state of the light (1 = on, 0 = off). The output variable
should be 1 when the light is to be turned on and 0 when it is to be turned
off.
Using of Boolean Algebra in different
projects
Car Garage
A car garage has a front door and one window, each of which has a sensor to
detect whether it is open. A third sensor detects whether it is dark outside. A
security system for the garage follows this rule: the alarm rings if and only if
the alarm switch is turned on and either the front door is not closed or it is
dark and the side window is not closed.
Nuclear Power Plant
A nuclear power plant contains three danger sensors, x, y,and z that can shut
down the plant. Sensor z is in such a sensitive location that it has a backup,
b. The plant is to be shut down if two of the three sensors x, y,and z indicate
danger. However, if sensor z is one of only two to register danger, zs backup,
b, must also register danger for the plant to be shut down.