Boolean Algebra - 2
Boolean Algebra - 2
Logical Operations
If an equation describing logical circuitry has several variables, it is understood
that each of the variables can assume only the values of 0 or 1. This can be
described using logic gates.
Addition
The symbol "+" is used for logical addition operations. It is also known as
the OR operator. We can define the + symbol (OR operator) by listing all the
possible combinations of A and B and the resulting value of C in the relation A
+ B = C. It may be noted that since the variables can have only two possible
values (0 or 1) so only four (22) combinations of inputs are possible, as shown
in the truth table for the OR operator. Observe that the result is 0 only when
the value of both the input variables is 0. Otherwise, in case of all other inputs,
the result obtained is 1. This is the reason why the "+" symbol does not have
its arithmetical meaning, but is a logical addition operator; i.e., the equation A
+ B = C will be read as "A OR B equals C".
The truth table and logic gate describing the OR operator are given below.
Larger View
~1~
Multiplication
The symbol "." is used for logical multiplication. It is also known as
the AND operator. We can again define the . symbol (AND operator) by listing
all possible combinations of A and B and the resulting value of C in the
equation A . B = C. Observe from the truth table that the result is 1 only when
the value of both the input variables is 1, otherwise, it is 0. The equation A + B
= C will be read as "A AND B equals C". The truth table and logic gate
describing the AND operator are given below.
Larger View
Complementation
The two operations defined so far (OR and AND) are binary operations because
they define an operation on two variables. The complementation operation is
a unary operation which is defined on a single variable. The symbol ' is
normally used as the complementation operator. It is also known as
the NOT operator. That means, if we write A', it means NOT A, or the
complement of A. The truth table for NOT has only two possibilities. The truth
table and logic gate for NOT operator are shown below.
Larger View
~2~
Operator Precedence
Does A + B . C mean (A + B) . C or A + (B . C)?
The two generate different values for A=1, B=0, C=0, for then we have (1 + 0) .
0 = 0 and 1 + (0 . 0) = 1, which differ. Hence, it is necessary to define operator
precedence in order to correctly evaluate Boolean expressions.
~3~
a. x + (y + z) = (x + y) + z
b. x . (y . z) = (x . y) . z
These are the basic postulates of the algebraic structure and need no proof.
They are used to prove the theorems of Boolean algebra.
Theorem 5:
a. x . (x' + y) = x . y
b. x + x' . y = x + y
Duality Principle
Apart from these, there is the Principle of Duality that governs each Boolean
algebra operation.
~4~
In Boolean algebra, there is a precise duality between the operators .
(AND) and + (OR) and the digits 0 and 1.
The implication of this duality is that any theorem in Boolean algebra has
a dual, obtainable by interchanging + with 0 and . with 1.
Apart from these gates, combinations of one or more logic gates can be used, to
form logic circuits. The gates described above can be considered the basic
components, using which more complex circuits can be created.
Some derived components, such as the NAND (NOT AND) and NOR (NOT
OR) gates, are also used in logic circuits, in addition to the XOR(Exclusive
OR) gate.
Larger View
~5~
An example of a Logic Circuit. It depicts the relation (X + Y). (X' + Z') + (Y
+ Z)
But, before I start describing the gates, I think I should try to make it simpler.
You must be wondering why and how Boolean Algebra is connected with
computers. The answer lies here:
We will first see the relation of the gates to physical, electrical, circuits.
Larger View
NAND Gate
This is simply an AND gate with its output inverted by a NOT gate. The
arrangement and symbol of the NAND gate are as shown. Following them is
the truth table for a 2-inputNAND gate.
Larger View
~6~
NOR Gate
This similarly is an OR gate with its output inverted by a NOT gate. The
arrangement and symbol of the NOR gate are as shown. Following them is
the truth table corresponding to the figure given.
Larger View
Both these gates, the NAND, and the NOR, are known as universal gates.
These are less expensive and are easier to design. Also, the
other switching functions (like AND, OR) can easily be implemented by
using NAND and NOR gates. Thus, they are known as universal gates.
This gate is special as it gives a true output if either of its inputs are true,
but not if both inputs are true. The combination of simple gates to produce
an XOR gate, and its symbol, are as shown. Following them is the truth
table corresponding to the figure given.
Larger View
Some typical logic circuit implementations are the Half-Adder and Full-
Adder.
Binary addition is a very simple operation. There are four basic rules as given
below:
A+B=S C
0+0=0 0
0+1=1 0
1+0=1 0
~7~
1+1=0 1
where A, B, S, C are called addend, augend, sum and carry respectively. It may
be noted that the output in each case is of two bits - the right bit for
the sum and the left bit for thecarry. We can rearrange the four cases in the
form of the truth table given below.
Open table as spreadsheet
A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Now, if we design the digital circuit for the sum and carry, we will see the
implementation of a half-adder. (See figure). This circuit is called a half-
adder because it has only two inputs which it can add together. It does not
consider a possible carry from the previous digits to be added. Along with the
circuit, the figure also shows the implementation of the circuit through
an XOR gate.
Larger View
~8~
5.2.5 Full Adder
The above circuit, called a half adder, is sufficient only in case of two inputs,
and that too where a carry is not involved. The circuit described above does not
consider a possible carryfrom the previous digits to be added. Therefore, if we
desire to add two binary numbers with more than one digit, the half adder will
not be sufficient.
For example, consider the addition of the two binary numbers given below.
For each column three binary digits (bits) must be added; that is, two original
bits in each column plus the carry digit from the previous addition. The
addition of multibit numbers, involves the following four operations :
▪ Add 1 + 1 with no carry gives sum = 0 and Cout = 1
▪ Add 0 + 1 with a carry 1 gives sum = 1 and Cout = 1
▪ Add 1 + 0 with a carry 1 gives sum = 0 and Cout = 1
▪ Add 1 + 1 with a carry 1 gives sum = 1 and Cout = 1
An adder with this property is called a full adder. The truth table for full
adder is shown below.
Larger View
Example 1.
~9~
Draw the diagram of the digital circuit for the function
Solution:
How about taking a test to see how much we have understood here. After all,
the circuits are quite interesting, even though it is very easy to get confused.
Let's see how you fare in this test.
QUESTIONNAIRE
~ 10 ~
2. True or False: The NOT gate is also called the inverter.
3. The two universal logic gates are
a. RAND and ROR
b. AND and OR
c. NAND and NOR
d. None of these
4. The total number of combinations possible in a truth table of a logic
circuit having N input variables, is
a. N
b. 2N
c. 2N
d. N2
5. The complement of (B + D') (A + C') is
a. B'D+A'C
b. BD' + AC'
c. B.D+A.C
d. B . D' + A . C'
6. True or False: A + A' = A.
7. The dual of the expression (A + BC + AB) is
a. A + (B + C) + (A + B)
b. A + (B . C) + (A + B)
c. A . (B + C) . (A + B)
d. A . (B + C) + (A . B)
8. True or False: The half adder adds 2 bits, whereas
a full adder adds 4 bits.
9. The gate shown below is
a. NOR
b. AND
c. NAND
d. XOR
10. True or False : By De Morgan's laws, (X + Y) ' = X' . Y'
Answers
~ 11 ~
1. (a)
2. True
3. (c)
4. (b)
5. (a)
6. False
7. (c)
8. False
9. (c)
10. True
~ 12 ~