BOOLEAN ANGEBRA AND LOGIC GATES
Class: Comp. Sc & ICT A/L By: NDANG George
We are familiar with the arithmetic operators add (+), subtract (-), multiply (x) and divide (/) which operate n
numbers. Apart from these arithmetic operators, we can define logical operators which operate on what we
called truth values. A truth value can be TRUE or FALSE and the common operators are: AND, OR, NOT.
These logical operators are alsocalled Boolean operators, from the English mathematician George Boole, who
th
developed the theory of mathematic logic in the 19 century. This chapter aims to present the concept of
Boolean algebra and its applications on logic circuits
Learning objectives
After studying this lesson, student should be able to:
Use AND, OR and NOT operators and apply them on lo.gic gates
Understand the laws and the principles of Boolean algebra.
Gibe the logic function of a logic circuit and vice-versa
Understand and use the rules of Boolean algebra to simplify functions and to minimize logic circuits
Table of Contents
I. BOOLEAN ALGEBRA.................................................................................2
II. LOGIC GATES..............................................................................................4
III.COMBINATION OF LOGIC GATES............................................................5
IV.LOGIC CIRCUITS AND BOOLEAN FUNCTIONS....................................7
V. SIMPLIFICATION OF LOGIC FUNCTIONS..............................................8
VI.EXAMPLE OF BASIC DIGITAL CIRCUIT................................................10
EXERCISES........................................................................................................11
I- LOGIC GATES
The term gate is used to describe the set of the basic electronic components, which when combined with
each other are able to perform complex logical and arithmetic operations. As discussed earlier, everything in the
digital world is based on the binary number system. Numerically, this involves only two symbols: 0 and 1.
Thus, when dealing with digital logic, we can specify that: 0 = False = No. 1 = True = Yes
I.1 Logic Operations and basic logic gates
There exist basically three logical operations: AND, OR and NOT. Each operator
I.1.1 AND Operation and AND Gate
The AND gate is composed of two or more inputs and a single output, and performs logical multiplication. In
the AND operation, a result of 1 occurs when all the input variables are 1. The standard symbol for the AND
gate and its truth are shown below. The expression X =A.B reads as'X equals A AND B'.
A B X=A.B
0 0 0
0 1 0
1 0 0
1 1 1
I.1.2 OR Operation and OR Gate
A B X=A+B
0 0 0
0 1 1
1 0 1
1 1 1
According to the OR operation, a result of 1 is obtained when any of the input variable is 1. Or a result of 0
only when all the input variables are 0. The OR gate is composed of two or more inputs and a single output, and
performs logical addition. The + sign stands for the OR operation, and not for ordinary addition.
I.1.3 NOT Operation and NOT Gate
Unlike the “OR” and “AND” operations the NOT operation can be performed on a single-input variable. The
NOT gate performs a basic logic function called inversion or complementation. In terms of bits, the NOT
operation changes '1' to '0' and vice versa.
A X=⃗
A
0 1
1 0
x = A′ or Ā where the prime (′) represents the NOT operation. This expression is read as:xequals the inverse
of A. x equals the complement of A.
II- COMBINATION OF LOGIC GATES
Using combinations of logic gates, complex operations can be performed, since in practice, there is a limit
to the number of gates that can be packed into a given physical space. Some basic combination gates are:
NAND gate, NOR gate, Exclusive-OR (XOR) and Exclusive-NOR (XNOR) gate
II.1. NAND Gate
The term 'NAND' is formed by the combination of NOT-AND and implies an AND function with an
inverted output.
X= ↑
A B (NAND)
0 0 1
0 1 1
1 0 1
1 1 0
IV. 2. NOR Gate
A B X = ↓ (NOR)
0 0 1
0 1 0
1 0 0
1 1 0
The term 'NOR' is formed by the combination of NOT-OR and implies an OR function with an inverted
output.
IV.3. Exclusive-OR (XOR) and Exclusive-NOR (XNOR) Gate
These gates are usually formed from the combination of the other logic gates already discussed. However,
because of their functional importance, these gates are treated as basic gates with their own unique symbols.
The truth tables and the standard symbols for the XOR and XNOR gates, are listed below respectively.
A B = ⨁ (XOR) = ⨀ (XNOR)
0 0 0 1
0 1 1 0
1 0 1 0
1 1 0 1
The exclusive-OR gate and exclusive-NOR gate are denoted by the ⨁and ⨀, respectively.In addition, these
gates perform the following Boolean functions.
IV.4. Minimization with NAND or NOR gates
When designing combinatorial circuits, efficiency is sought by minimising the number of gates in a circuit. It
has been proved that all the basic logical operators can be represented using only NAND operator or NOR
operator. They are then called universal gates
II- BOOLEAN ALGEBRA
Boolean algebra is a mathematical system, developed by the English mathematician, George Boole. It is
the mathematics of digital systems. Boolean algebra deals with the binary numbersystem, the variables
used in the Boolean equations have only two possible values (0 or 1). Thus, for performing the logical
algebraic operations, that is, 'addition' and 'multiplication', Boolean algebra follows certain rules.
II.1 Rules of Boolean algebra
Addition Rules (a) Multiplication Rules (b)
1 0+0=0 0·0=0
2 0+1=1 0·1=0
3 1+0=1 1·0=0
4 1+1=1 1·1=1
5 A+0=A A·0=0
6 A+1=1 A·1=A
7 A+A=A A·A=A
8 A+Ā=1 A·Ā=0
9 A + AB = A A(A+B)=A
10 A+ĀB=A+B
11 (A+B)(A+C) = A + BC
12 AC+AC = A(B+C)
These rules are shown in the table below. A, B and C represent a single variable or a combination
variables.
These rules can be checked by the use of truth table. Some of these rules can be derived from simpler
identities derived in this package.
II.2 Laws of Boolean algebra
The following are different laws of Boolean algebra:
Law 13 Addition (a) Multiplication (b)
Commutative 14 A + B = B + A AB = BA
A + (B + C) =
Associative 15 A (BC) = (AB) C
(A + B) + C
(a) A (B + C) = AB + AC
Distributive 16
(b) A + (BC) = (A + B) (A + C)
̅̅̅̅̅̅̅̅
De Morgan's (a) ̅̅
Law 17
+ = .
(b)
Someproofs
IV. LOGIC CIRCUITS AND BOOLEAN FUNCTIONS
IV.1 Definition
A Logic circuit to a number of gates joined together to produce a specific output from given inputs. For example,
let’s consider the following circuit: It contains three inputs A, B and C
A Boolean function is an expression formed with binary variables and logical operators (OR, AND, NOT
and equal sign). For example, the Boolean function of the above logic circuit can be expressed X = f(A, B,
C) = A · B + A · C.
The function can be represented by a truth table as follow
Inputs Output
A B C A.B A.C F
0 0 0 0 0 0
0 0 1 0 0 0
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 0 0 0
1 0 1 0 1 1
1 1 0 1 0 1
1 1 1 1 1 1
IV.2 Algebraic expression of a Boolean expression
In general, the unique algebraic expression for any Boolean function can be obtained from its truth table by
using an:
- OR operator to combined all minterms for which the function is equal to 1.
- AND operator to combined all maxterms for which the function is equal to 0
n
A minterm, denoted as mi, where 0 ≤ i < 2 , is a product (AND) of the n variables in which each variable is
complemented if the value assigned to it is 0, and uncomplemented if it is 1.
1-minterms= minterms for which the function F = 1.
0-minterms= minterms for which the function F= 0.
n
A maxterm, denoted as Mi, where 0 ≤ i < 2 , is a sum (OR) of the n variables in which each variable is
complemented if the value assigned to it is 1, and uncomplemented if it is 0.
Note that each maxterm is the complement of its corresponding minterm and vice versa.
Any Boolean function can be expressed as a sum (OR) of its 1-minterms (sum of products SOP) or product
of 0-maxterms (product of sums POS)
Note that each maxterm is the complement of its corresponding minterm and vice versa.
Any Boolean function can be expressed as a sum (OR) of its 1-minterms (sum of products SOP) or
product of 0-maxterms (product of sums POS).
Example: Let us consider the function F = A·B + A·C whose truth table is given as shownbelow
The function F can then be
expressed as the sum of minterms
corresponding to the value 1 of F
or as the product of maxterms
corresponding to the value 0 of F.
V. SIMPLIFICATION OF LOGIC FUNCTIONS
A simplified Boolean expression uses the fewest gates possible to implement a given expression.
V.1 Simplification using Boolean algebra
Using the theorems of Boolean Algebra, the algebraic forms of functions can often be simplified, which leads to
simpler (and cheaper) implementations.
Example: Using Boolean algebra techniques, simplify this expression: AB + A(B + C) + B(B + C)
Solution
Step 1: Apply the distributive law to the second and third terms in the expression, asfollows:
AB + AB + AC + BB + BC
Step 2: Apply rule 7b (BB = B) to the fourth term. AB + AB + AC + B + BC
Step 3: Apply rule 7a (AB + AB = AB) to the first two terms. AB + AC + B + BC
Step 4: Apply rule 10 (B + BC = B) to the last two terms. AB + AC + B
Step 5: Apply rule 10 (AB + B = B) to the first and third terms. B+AC At
this point the expression is simplified as much as possible.
V.2 Simplification usingKarnaughMap
A K-map provides a systematic method for simplifying Boolean expressionsand, if properly used, will
produce the simplest SOP or POS expression possible,known as the minimum expression. A K-map is
similar,to a truth table becauseit presents all of the possible values of input variables and the resulting
output for each value. Instead of being organized into columns and rows like a truth table, the K-map is an
array of cells in which each cell represents a binary value of theinput variables. The number of cells in
aK- map is equal to the total numberof possible input variable combinations as is the number of rows in a
truth table. For three variables, the number of cells is 23= 8. For four variables, the number of cells is 24= 16.
Example:
(Practical example and explanation to be given)
VI. EXAMPLE OF BASIC DIGITAL CIRCUIT
VI.1 A half adder
The half adder adds two single binary digits A and B. It has two outputs, sum (S) and carry (C). The carry
signal represents an overflow into the next digit of a multi-digit addition. The The simplest half-adder design,
pictured on the right, incorporates an XOR gatefor S and an AND gateforC. One of the main uses for
theBinary Adderis in arithmetic and countingcircuits.
1-bit Adderwith Carry-Out
Symbol Truth Table
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
Boolean Expression: Sum = A ⊕ B
1 1 0 1
Carry = A . B
VI.2 Full Adder
Two half adders can be combined to make a full adder. The main difference between the FullAdder and
the previous seen Half Adder is that the full-adder accepts an input carry..
Full Adder with Carry-In
Symbol Truth Table<
A B C-in Sum C-out
0 0 0 0 0
0 1 0 1 0
1 0 0 1 0
1 1 0 0 1
0 0 1 1 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 1
Boolean Expression: Sum = A ⊕ B ⊕ C-in
VI.3 Flip-Flops
"Flip-flop" is the common name given to two-state devices which offer basic memory forsequential
logicoperations.Flip-flops are heavily used for digital data storage and transferand are commonly used in
banks called "registers" for the storage of binary numerical data.
EXERCISES
Exercise 1 MCQ
1.Select the Boolean expression that is not equivalent to x · x + x · x
(a) x · (x + x)(b) (x + x) · x (c) x (d) x
2.Select the expression which is equivalent to x · y + x · y · z
(a) x · y (b) x · z(c) y · z (d) x · y · z
3.Select the expression which is equivalent to (x + y) · (x + y)
(a) y (b) y (c) x(d) x
4. Select the expression that is not equivalent to x · (x+ y) + y
(a) x · x+ y · (1 + x) (b) 0 + x · y + y (c) x · y (d) y
Exercise 2 : Use logic gates to represent these expressions and draw up the correspondingtruth tables.
1. x ( y + x) 2. a+(𝑏̅c) 3. b(a+(b+c))
Exercise 3: Write down the Boolean expression for each of the circuits below.
Exercise 4: Show if these combinatorial circuits are equivalent by working out the
Booleanexpression and the truth table for each circuit.
Exercise 5: Draw the truth table for the Boolean function defined as f ( a , b , c )=a(b+c )
Exercise 6: For the given truth table, form a Boolean function
A B C F (A,B,C)
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
Exercise 7: A burglar alarm for a house is controlled by a switch. When the switch is on, thealarm sounds
if either the front or back doors or both doors are opened. The alarm will not work if the switch is off.
Design a circuit of logic gates for the alarm and draw up the corresponding truth table.
Exercise 8: Find the disjunctive normal form of the Boolean function for these truth tables:
Exercise 9: Design circuits for each of the following using only NAND gates and then NORgates.
1) AB 2) A B 3) A B+ B 4) A+ B
Exercise 10: Simplify the following expressions and check your answer by drawing up truthtables.
(a) abc +a bc
(b) a+ a bc+ a b c
(c) pq+ ( p+q ) (r + s)
Exercise 11
(a) Establish a truth table for the Boolean function f ( a , b , c )=( a+b ) (c +b)
(b) Design a circuit using as few AND, OR and NOT gates as possible to model the function in (a).