Boolean Algebra and Logic Gates: Outline
Boolean Algebra and Logic Gates: Outline
Ranga Rodrigo
July 5, 2009
Outline
Contents
1 Introduction 1
1.1 Manual Building of Digital Systems . . . . . . . . . . . . . . . . . . . . . 2
1.2 HDL Building of Digital Systems . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Digital Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Binary Numbers 3
2.1 Numbers with Different Bases . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Complements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Binary Logic 6
3.1 Logic Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Boolean Functions 9
5.1 Algebraic Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1 Introduction
In the present information age, digital electronic circuits are the workhorses of al-
most every device that we encounter. Many consumer products, cell phones, MPEG
players, digital cameras, personal digital assistants, GPS devices, use a digital circuit
as their main functional unit.
In this course, we will discuss the fundamentals, the design, and applications of
simple and moderately complex digital circuits. At the end of this course you will be
able to manually design simple combinational and sequential circuits, and design
slightly larger ones using computer-based tools.
In order to achieve this we must learn two design methods
1
2. Computer-based design.
In the manual design, we will use truth tables, state transition tables, and such to
express the functional need and simplify them using tools such as Karnaugh maps.
Then we will use gates and flip-flops to realize out designs.
In the computer-based method we will use a hardware description language
(such as Verilog or VHDL) to do the combinational and sequential implementa-
tions, and realize the design using programmable logic devices such as field pro-
grammable grate arrays FPGAs. However, we will stop at the simulation level.
2
2 Binary Numbers
A decimal number such as 352 represents a quantity equal to 3 hundreds, 5 tens,
plus 2. 352 is the short-hand notation of what should be written as
The convention is to write only the coefficients. each coefficient is any of the ten dig-
its, 0,1, . . . , 9. The decimal number system is said to be of base, or radix 10, because
it uses 10 digits and and the coefficients are multiplied by powers of 10. The binary
system is a different number system. The coefficients of the binary number system
have only tow possible values: 0 and 1. The first digit (bit) from right represents 20 s
or ones, the second digit represents 21 = 2s, the third digit represents 22 = 4s, and so
on.
Example 1. Convert 1101012 to a decimal number.
Example 2. What is the decimal equivalent of the binary number 1010.112 to a dec-
imal number.
3
2.1 Numbers with Different Bases
2.2 Complements
Complements are used in digital computer to simplify the subtraction operation.
There are two types of complements for each base r system.
Diminished radix complement ((r − 1)’s complement). E.g., 1’s complement in bi-
nary.
4
Given a number N in base r having n digits, the (r − 1)’s complement of N is
defined as (r n − 1) − N . Therefore, 1’s complement of a binary number is obtained
by changing 1s to 0s and 0s to 1s.
Example 3. What is the 1’s complement of the binary number 10110002 ?
Radix Complement
The r ’s complement of an n-digit number N is defined as r n − N for N 6= 0 and
0 for N = 0. Comparing with (r − 1)’s complement, we note that r ’s complement is
obtained by adding 1 to the (r − 1)’s complement, since r n − N = [(r n − 1) − N ] + 1.
Example 4. What is the 10’s complement of the number 01239810 ?
2. If M ≥ N , the sum will will produce an end carry r n , which can be discarded.
What is left in the result is M − N .
3. If M < N , the sum does not produce an end carry and is equal to r n − (N − M ),
which is the r ’s complement of (N − M ). To obtain the answer in a familiar
form, take r ’s complement of the sum place a negative sign in front.
Example 5. Using 10’s complement, subtract 72532 − 3250.
5
Example 6. Using 10’s complement, subtract 3250 − 72532.
Example 7. Given the two binary numbers X = 1010100 and Y = 1000011, perform
the subtraction (a) X − Y and (b) Y − X by using 2’s complement.
3 Binary Logic
Binary logic deals with variable that take on two discrete values and with operations
that assume logical meaning(true or false). The binary logic is equivalent to an al-
gebra called boolean algebra. Binary logic consist of binary variables and a set of
logical operations.The variables are designated by letters of the alphabet, such as
A, B,C , x, y, z etc., with each variable having two and only two distinct possible val-
ues: 1 and 0. There are three basic logical operations. AND, OR, AND not.
6
3.1 Logic Gates
Logic gates are electronic circuits that operate on one or more input signals to pro-
duce an output signals interpreted to be either 0 or 1 and produce an output signal
of similar kind. In reality, however, these signals are wither voltages or currents.
Therefore,a range of values is defined as logic zero and a different range as logic 1.
7
together with two binary operators, + and ·, provided that the following (Hunting-
ton) postulates are satisfied:
1. (a) The structure is called with respect to the operator +. (b) The structure is
called with respect to the operator ·.
2. (a) The element 0 is an identity element with respect to +; that is, x +0 = 0+x =
x. (b) The element 1 is an identity element with respect to ·; that is, x ·1 = 1·x =
x.
1. Huntington postulates do not include the associative law. However this law
holds for Boolean algebra and can be derived (for both operators) from the
order postulates.
3. Boolean algebra does not have additive multiplicative inverses; therefore, there
are no subtraction or division operations.
8
5 Boolean Functions
Boolean algebra is an algebra that deals with binary variables and logic operations. A
Boolean function described by an algebraic expression consists of binary variables,
the constants 0 and 1, and the logic operations symbols. For a given value of bi-
nary variable, the function can be equal to either 0 or 1. A Boolean function can be
represented in a truth table uniquely. However, the algebraic representation is not
unique, that is, the same function can be expressed in a variety of ways, but equiv-
alent in logic. A Boolean function can be transformed from an algebraic expression
into a circuit diagram composed of logic gates.
Example 8. In regard to the following Boolean functions, give the truth table and the
circuit:
F 1 = x + y 0 z,
F2 = x 0 y 0 z + x 0 y z + x y 0 .
9
Example 9. Simplify the following Boolean functions to a minimum number of lit-
erals.
F 1 = x(x 0 + y),
F 2 = x + x 0 y,
F 3 = (x + y)(x + y 0 ),
F 4 = x y + x 0 z + y z,
F 5 = (x + y)(x 0 + z)(y + z).
10
Example 10. Find the complements of the following Boolean functions.
F 1 = x 0 y z 0 + x 0 y 0 z,
F 2 = x(y 0 z 0 + y z).
A simpler way to for obtaining the complement of a function is to take the dual
of the function and complement each literal.
11
x y z Term Designation Term Designation
0 0 0 x0 y 0z0 m0 x +y +z M0
0 0 1 x0 y 0z m1 x + y + z0 M2
.. .. .. .. .. ..
. . . . . .
12
As the aforementioned example shows, any Boolean fucntion can be expressed
as a sum (ORing) of minterms. Now consider the complement of a Boolean function.
It may be read form the truth table by forming a minterm for each combination that
produces a 0 in the function and then ORing those terms. The complement of f 1 is
read as
13
An alternative way is to use the truth table.
Example 13. Express the Boolean function F = x y + x 0 z as a product of maxterms.
14