Mohd Uzir Kamaluddin / July 2019 page 1
COURSE / CODE DIGITAL SYSTEMS FUNDAMENTAL (ECE 421)
DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422)
BOOLEAN ALGEBRA
Boolean Logic
Boolean logic is a complete system for logical operations. It is used in countless systems. It was named
after George Boole, who first defined an algebraic system of logic in the mid 19th century. Boolean logic
has many applications in electronics, computer hardware and software, and is the base of all modern
digital electronics. In 1938, Claude Shannon showed how electric circuits with relays were a model for
Boolean logic. This fact soon proved enormously consequential with the emergence of the electronic
computer.
Boolean logic is also used for circuit design in electrical engineering; here 0 and 1 may represent the
two different states of one bit in a digital circuit, typically high and low voltage. Circuits are described
by expressions containing variables, and two such expressions are equal for all values of the variables
if, and only if, the corresponding circuits have the same input-output behavior. Furthermore, every
possible input-output behavior can be modeled by a suitable Boolean expression.
Basic logic gates such as AND, OR, and NOT gates may be used alone, or in conjunction with NAND,
NOR, and XOR gates, to control digital electronics and circuitry. Whether these gates are wired in
series or parallel controls the precedence of the operations.
Truth Table
A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra,
Boolean functions, and propositional calculus—to compute the functional values of logical expressions
on each of their functional arguments, that is, on each combination of values taken by their logical
variables. In particular, truth tables can be used to tell whether a propositional expression is true for all
legitimate input values, that is, logically valid.
Practically, a truth table is composed of one column for each input variable (for example, A and B), and
one final column for all of the possible results of the logical operation that the table is meant to
represent (for example, A XOR B). Each row of the truth table therefore contains one possible
configuration of the input variables (for instance, A=true B=false), and the result of the operation for
those values.
Logic Circuits:
1. From logic circuit to Boolean expression. Write down the Boolean expression for output Q in the
following circuits.
Mohd Uzir Kamaluddin / July 2019 page 2
2. From Boolean expression to logic circuit. Draw the logic circuit for the following expression.
a) ZYWZYXWF
b) DBCADCBADCBADCBAF
Boolean Algebra
Boolean algebra developed in 1854 by George Boole in his book “An Investigation of the Laws of
Thought”, is a variant of ordinary algebra as taught in high school. Boolean algebra differs from
ordinary algebra in three ways: in the values that variables may assume, which are of a logical instead
of a numeric character, prototypically 0 and 1; in the operations applicable to those values; and in the
properties of those operations, that is, the laws they obey.
Prove the following:
1. A+AB = A
2. A(A+B) = A
3. A+ A B = A+B (Hint: replace A with A+AB)
4. A( A +B) = AB
5. ( A +B)(A+B) = B
Exercises
1. If A=0, what does and equal?
2. Determine the values of A, B and C that makes the sum term C equal to 0.
3. Determine the values of A, B and C that makes the product term C equal to 1.
4. Prove the following using truth tables and then by Boolean algebra.
a) A + AB = A b) B = A + B c) (A + B)(A + C) = A + BC
5. Simplify the following expressions using Boolean algebra.
a) ))(( ACABCA
b) AB + A(B+C) + B(B + C)
c) )())(( CCC
d) ABCBAAB )(
e) )]([ ACBCCABABC
Mohd Uzir Kamaluddin / July 2019 page 3
De Morgan’s Theorem
This theorem basically states that:
1. the complement of the product of a given set of variables is equal to the sum of the
complements of the individual variables; and
2. the complement of the sum of a given set of variables is equal to the product of the
complements of the individual variables. De Morgan's Theorem applies to any arbitrary
number of variables.
The important implication of De Morgan's Theorem is that any logic gate or circuit can be replaced
by an equivalent circuit composed of other gates, as long as the NOT function can be provided by at
least one of the substitute gates. This is useful in digital electronics design wherein there is a need to
minimize the variety and number of logic gate IC's used.
Two forms of De Morgan's Theorem implemented with basic gates.
Exercises
1. Apply De Morgan’s Theorems to the following expressions.
a) BA b) )( DCBA c) )( DCBA + DABC
2. Simplify the following expressions using Boolean algebra and De Morgan’s theorem. Then draw
the resulting logic circuit.
a) )(( CBABACABAY b) ACCDABY
c) ))(( DCBAY d) BCCDCBAX )(
3. Using Boolean algebra techniques, simplify as much as possible the following Boolean
expressions:
a) ABCBAAB )( b) )]([ ACBCCABABC
4. Without simplifying the expression, draw the logic circuit and its truth table for the following
Boolean expressions:
a) )]([ CBDCBA b) ))(( CBBA
5. Simplify the following logic circuits.
Mohd Uzir Kamaluddin / July 2019 page 4
Convert a logic circuit into NAND gates only
The NAND gate is called a universal gate because combinations of it can be used to accomplish all the
basic functions.
The following logic circuits are the same.
Exercises
1. What gate can implement any possible binary logic function?
2. Determine the output expression in
the following circuit:
3. Convert the following logic circuits into its NAND equivalent circuit.
Sum-of-Products Expression (SOP)
A sum-of-products (SOP) expression is a Boolean expression in a specific format. The term sum-of-
products comes from the expression's form: a sum (OR) of one or more products (AND). As a digital
circuit, an SOP expression takes the output of one or more AND gates and OR's them together to create
the final output.
The inputs to the AND gates are either inverted or non-inverted input signals. This limits the number
of gates that any input signal passes through before reaching the output to an inverter, an AND gate,
and an OR gate. Since each gate causes a delay in the transition from input to output, and since the SOP
Mohd Uzir Kamaluddin / July 2019 page 5
format forces all signals to go through exactly two gates (not counting the inverters), an SOP expression
gives us predictable performance regardless of which input in a combinational logic circuit changes.
This is an example of an SOP expression: DCBADCADCBA
There are no parentheses in an SOP expression since they would necessitate additional levels of logic.
This also means that an SOP expression cannot have more than one variable combined in a term with
an inversion bar.
Converting an SOP expression to a Truth Table
To convert an SOP expression to a truth table, examine each product to determine when it is equal to 1.
Where there that product is a 1, a 1 will also be outputted from the circuit.
Converting a Truth Table to an SOP expression
Any truth table can be converted to an SOP expression. The conversion process goes like this: identify
the rows with ones as the output, and then come up with the unique product to put a one in that row.
Note that this will give us an SOP expression where all of the products use all of the variables for
inputs. This usually gives us an expression that can be simplified.
OR’ing all these products together will give the SOP expression: CABCBABCACBAX
The short hand form, X can be written as: )6,4,3,1(mX
Product-of-Sums Expression (POS)
The product-of-sums (POS) format of a Boolean expression is much like the SOP format with its two
levels of logic (not counting inverters). The difference is that the outputs of multiple OR gates are
combined with a single AND gate which outputs the final result. This expression adheres to the format
of a POS expression. ))()(( CBACBACBA
Mohd Uzir Kamaluddin / July 2019 page 6
Converting a POS expression to Truth Table
Converting a POS expression to a truth table follows a similar process as the one used to convert an
SOP expression to a truth table. The difference is this: where the SOP conversion focuses on rows with
a 1 output, the POS conversion focuses on rows with a 0 output.
Converting a Truth Table to a POS expression
Just as with SOP expressions, any truth table can be converted to a POS expression. The conversion
process goes like this: identify the rows with zeros as the output, and then come up with the unique
sum to put a zero in that row. The final group of sums can then be AND'ed together producing the POS
expression.
AND’ing all these sums together will give the POS expression:
))()()(( CBACBACBACBAX
The short hand form, X can be written as: )7,5,2,0(MX
Exercises
1. Convert the following expressions to sum-of-product (POS) forms:
a) ))(( BCBA b) ))(( ACABCA
2. Develop a truth table for the standard SOP expression CCC
3. Create a truth table for the standard SOP expression CCB
Mohd Uzir Kamaluddin / July 2019 page 7
4. From the given truth table, determine the standard SOP expression and the equivalent standard POS
expression. From the expressions obtained, draw the logic circuit. Redraw the logic circuit using
NAND gates only.
INPUTS
A B C
OUTPUT
X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
5. For each of the truth tables given, write the Boolean expression for the output X. Reduce the
expression to its minimum sum of product (SOP) form and draw its logic circuit.
Inputs
A B C
Output
X
Inputs
A B C
Output
X
0 0 0 1 0 0 0 0
0 0 1 1 0 0 1 1
0 1 0 0 0 1 0 1
0 1 1 1 0 1 1 0
1 0 0 1 1 0 0 1
1 0 1 1 1 0 1 0
1 1 0 0 1 1 0 0
1 1 1 1 1 1 1 1
Minimization of Logic Functions
Many times in the application of Boolean algebra, a particular expression need to be reduced to its
simplest form or change its form to a more convenient one to implement the expression efficiently.
1) By using Boolean algebra
Minimize the following functions to its simplest form:
a) F = CDBAACDDADCBDCBA
b) F = AB + A(B + C) + B(B + C)
c) F = CBABDCBA ))((
d) F = ABCCBACBACBABCA
Boolean algebra has the disadvantage of being unsystematic in solving expressions and also it is
unknown whether the expression has reached its simplest form.
2) By using K-map method
The Karnaugh map, also known as a Veitch diagram (K-map or KV-map for short), is a tool to facilitate
management of Boolean algebraic expressions. A Karnaugh map is unique in that only one variable
changes value between squares, in other words, the rows and columns are ordered according to the
principles of Gray code.
Mohd Uzir Kamaluddin / July 2019 page 8
In a Karnaugh map with n variables, a Boolean term mentioning k of them will have a corresponding
rectangle of area 2n − k. Common sized maps are of 2 variables which is a 2x2 map; 3 variables which is
a 2x4 map; and 4 variables which is a 4x4 map.
Karnaugh Maps - Rules of Simplification
The Karnaugh map uses the following rules for the simplification of expressions by grouping together
adjacent cells containing 1s.
Groups may not include any cell containing a 0.
Groups may be horizontal or vertical, but not diagonal.
Groups must contain 1, 2, 4, 8, or in general 2n cells. That is if n = 1, a group will contain two 1's
since 21 = 2. If n = 2, a group will contain four 1's since 22 = 4.
Each group should be as large as possible.
Mohd Uzir Kamaluddin / July 2019 page 9
Each cell containing a 1 must be in at least one group.
Groups may overlap.
Groups may wrap around the table. The leftmost cell in a row may be grouped with the
rightmost cell and the top cell in a column may be grouped with the bottom cell.
There should be as few groups as possible, as long as this does not contradict any of the
previous rules.
Exercises
Q1.
a) What is the use of Karnaugh Map?
b) How is the number of cells in a K-Map determined?
c) To how many variables does the K-Map suitable to be used?
Mohd Uzir Kamaluddin / July 2019 page 10
d) Draw the 2-variable K-map with inputs XY and show the standard product terms for each cell.
e) Draw the 3-variable K-map with inputs ABC and show the standard product terms for each cell.
f) Draw the 4-variable K-map with inputs ABCD and show the standard product terms for each
cell.
g) What is the meaning of cell adjacency? Why is it important?
Q2.
a) In a 3-variable K-Map, what is the binary value for the cell in each of the following locations?
i) upper left corner ii) lower right corner
iii) lower left corner iv) upper right corner
b) What is the standard product term for each cell in Q2a) for variables X, Y and Z?
c) Repeat Q2a) for a 4-variable map.
d) Repeat Q2b) for a 4-variable map using variables W, X, Y and Z.
e) Why K-Map is not suitable for more than 4
variables? What is the other methods that can be
used to simplify Boolean expressions?
Q3.
a) Obtain the simplest SOP expression for each of
the given 3 variable K-map.
b) Map the SOP expression
CCCC on a K-map.
c) Map the SOP expression
DCDCDCCD on a K-
map.
c) Prove the following using K-map:
i) A + AB = A ii) B = A + B iii) (A + B)(A + C) = A + BC
Q4.
Use Karnaugh map to simplify the following expressions to a minimum sum-of-product (SOP) and
product-of-sum (POS) forms:
a) )()( CBBCACBBCA b) )]([ CBBBAC
Q5.
a) From each of the following truth tables, draw the K-map.
b) From the K-map in Q5a), obtain the minimum SOP expression.
c) Draw the logic circuit using the expression obtained in Q5b) using NOR gates only.
d) Draw the logic circuit using the expression obtained in Q5b) using NAND gates only.
INPUTS
A B C
OUTPUT
X
INPUTS
P Q R
OUTPUT
Y
0 0 0 0 0 0 0 1
0 0 1 0 0 0 1 1
0 1 0 0 0 1 0 0
0 1 1 1 0 1 1 0
1 0 0 1 1 0 0 1
1 0 1 0 1 0 1 0
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
AB
C 00 01 11 10AB
C 00 01 11 10
0 1 0 1 1
1 1 1 1 1
AB
C 00 01 11 10AB
C 00 01 11 10
0 1 1 0 1 1 1
1 1 1 1 1 1
AB
C 00 01 11 10AB
C 00 01 11 10
0 1 1 1 0 1 1 1
1 1 1 1 1 1 1
Mohd Uzir Kamaluddin / July 2019 page 11
Q6.
Using K-map, simplify the following Boolean expressions:
a) ABCBAAB )( b) )]([ ACBCCABABC
Example 1: Design a combinational logic circuit with three inputs and one output. The output is a ‘1’
when the binary value of the input is less than three. Otherwise the output is ‘0’.
Example 2: A logic circuit that has three inputs A, B, C and one output F has the following truth table.
Input
A B C
Output
F
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
Write down the Boolean function of the truth table as sum-of-products (SOP) and product-of-sum
(POS) forms, then simplify it using K-map for both the SOP and POS expressions and draw the logic
circuit.
The K-map is:
AB
C 00 01 11 10
0 1 0 1 0
1 1 1 1 0
To get the SOP expression, read the 1’s in groups. BCABBAF or CAABBAF
To get the POS expression, read the 0’s in groups (careful!) ))(( CBABAF
Exercise 1a: A logic circuit that has three inputs A, B, C and one output F. The output F is high only
when the majority of its input is high. Implement the logic circuit.
Exercise 1b: There are three sensors A, B, C to detect the presence of unwanted visitors at a place.
Sensor Z is to indicate whether it is daytime or nightime.
Mohd Uzir Kamaluddin / July 2019 page 12
Z A B C
1 =Daytime 1=Detect Movement
0=Detect Break-In
1=Detect Sound
i) Draw the truth table for this system if it is to be operated during night-time only.
ii) Otain the simplest expression for the ouput using K-map method.
iii) Draw the logic diagram.
Execise 1c: A coin is tossed three times. A win is said to occur if the result obtained is Heads for at least
2 tosses. Taking A, B, C as inputs and W as output, write a truth table, given that A, B, C are 1 if the
result is Heads or 0 if the result is Tails, and W is 1 if a win occurs, otherwise it is 0. Obtain the simplest
expression for W using the K-map method.
Exercise 1d: Sensors are used to monitor the pressure and the temperature of a chemical solution stored
in a vat. The circuitry for each sensor produces a HIGH voltage when a specified maximum value is
exceeded. An alarm requiring LOW voltage input must be activated when either the pressure or the
temperature is excessive. Design the logic circuit for this application.
Exercise 1e: A lamp in a room is to be operated from two switches, one at the back door and one at the
front door. The lamp is to be on if the front switch is ON and the back switch is OFF, or if the front
switch is OFF and the back switch is ON. The lamp is to be off if both switches are OFF or if both
switches are ON. Let a HIGH output represent the on condition and a LOW output represent the off
condition. Develop the logic circuit necessary to meet the requirements.
Exercise 2: Simplify the following Boolean functions, using a K-map.
a) )6,4,2,1,0(mX b) )6,5,4,2,0(MX c) CBACBCABA
Exercise 3. Using K-map, minimize the following Boolean expressions:
a) ABCBAAB )( b) Z = f(A,B,C) = + B + AB + AC
c) Z = f(A,B,C) = B + B + BC + A
Exercise 4. Reduce the following logic circuit into its simplest form.
A
B
C
D
X
Exercise 5. Simplify the following logic circuit into its simplest form by the use of Boolean algebra and
then implement the resulting circuit.
Mohd Uzir Kamaluddin / July 2019 page 13
Exercise 6.
a) Examine the circuit shown below and determine the Boolean equation representing the circuit.
b) Simplify the Boolean equation using (i) Boolean reduction and (ii) Karnaugh mapping.
c) Draw a truth-table for the circuit.
d) Perform a logic simulation of the circuit using Logisim and compare the results with the truth
table obtained earlier.
e) Construct the circuit as shown and verify that it functions according to the truth-table.
f) Using the results from (b) design the simplest circuit which performs the same function as the
original circuit. (The minimal solution consists of 2 gates.)
g) Perform a logic simulation of the simplified circuit in order to verify the design.
h) Finally, construct the simplified solution and confirm that it is correct.
Four variables K-map
Mohd Uzir Kamaluddin / July 2019 page 14
For the following K-maps, find their minimal SOP expressions.
Exercise 1. Minimize the following expressions using four variable K-Map.
a) F(x,y,w,z) = Σm(0, 1, 2, 3, 4, 6, 11, 14)
b) F(x,y,w,z) = Σm (0, 2, 4, 6, 12, 14)
c) F(x,y,w,z) = Σm (0, 2, 5, 7, 8, 11, 13, 15)
Exercise 2. Draw the truth table with inputs D, C, B, A and
output F. If the input DCBA is a prime number, then F is high,
otherwise low. The prime numbers in the range 0 to 15 are 3, 5,
7, 11, 13. The truth table is constructed and shown. Using a K-
Map, find the simplest expression for F.
Exercise 3. Given the following truth table, find the simplest expression for
the output.
Exercise 4. Draw the truth table for 4 bit Binary (B3,B2,B1,B0) to Gray code
(G3,G2,G1,G0). Obtain the simplest expression for the outputs using K-maps
and draw the resulting circuit diagram.
A good website that explain and solve K-maps online:-
http://electronics-course.com/karnaugh-map