SlideShare a Scribd company logo
Bolean Algebra
SOP, POS
BA
Boolean algebra is a branch of algebra in which the values of the variables are true
or false, typically denoted by 1 or 0, respectively. It is used to analyse and simplify
digital logic circuits, as well as to represent certain types of mathematical relations.
Boolean algebra is based on the operations of AND, OR, and NOT, and the laws that
govern them, such as the commutative and associative laws, the distributive laws,
and De Morgan's laws. Boolean algebra is used in computer science, electrical
engineering, and mathematics to design logic circuits and other digital systems.
Boolean Algebra
3
• Boolean Algebra (named for its developer, George Boole), is the algebra of
digital logic circuits that all computers use.
• It is a symbolic representation of logic principles that date back to Greek
logic studies (Aristotle, ~384-322 BC).
• In the Victorian Age, mathematicians began to apply formal principles to
Aristotelian logic, which led to the field of symbolic logic.
• Technically, “Boolean Algebra” refers to a family of logic systems, but it is
generally used to refer to one system -- and that is how we will use it.
• George Boole (1815-1864) was a mathematician and teacher, the self-
educated son of a cobbler, who married Mary Everest (niece of Sir George
Everest of mountain fame).*
• Boole’s thinking was typical of Victorians: All processes (even thinking!)
could be represented by formal rules. His intent was to formalize the “rules
of thinking” with logic equations – a well-meant but totally impossible task.
• Scientists soon began to apply “switching algebra” to logic problems.
* His key work was “An Investigation of the Laws of Thought on Which are Founded the Mathematical Theories of Logic and Probabilities.”
George Boole
George Boole (/buːl/; 2 November
1815 – 8 December 1864) was a
largely self-
taught English mathematician, philoso
pher, and logician, most of whose
short career was spent as the first
professor of mathematics at Queen's
College, Cork in Ireland. He worked in
the fields of differential
equations and algebraic logic, and is
best known as the author of The Laws
of Thought (1854) which
contains Boolean algebra. Boolean
logic is credited with laying the
foundations for the Information Age.[4]
More In Boolean algebra, the variables can take on only
two possible values: true or false, represented by 1
or 0, respectively. The basic operations in Boolean
algebra are AND, OR, and NOT.
The AND operation is denoted by the symbol "∧"
and is true only if both of its operands are true. The
OR operation is denoted by the symbol "∨" and is
true if at least one of its operands is true. The NOT
operation is denoted by the symbol "¬" and is used
to negate the value of its operand.
Boolean algebra has several laws that govern the
behavior of these operations, such as the
commutative law, associative law, distributive law
and De Morgan's laws.
More
The commutative law states that the order of the operands does not affect the
result of the operation, for example A∧B = B∧A and A∨B = B∨A. The
associative law states that the grouping of the operands does not affect the
result of the operation, for example (A∧B)∧C = A∧(B∧C) and (A∨B)∨C =
A∨(B∨C). The distributive law states that the AND operation distributes over
the OR operation, for example A∧(B∨C) = (A∧B)∨(A∧C) and A∨(B∧C) =
(A∨B)∧(A∨C).
De Morgan's laws are two theorems that relate the NOT operation to the AND
and OR operations. They state that ¬(A∧B) = ¬A∨¬B and ¬(A∨B) = ¬A∧¬B.
In addition to these laws, Boolean algebra also includes identities such as the
identity laws, inverse laws and the complement laws.
Boolean algebra is used in many different fields, including digital logic design
and computer science, particularly in the design of digital systems.
Boolean Algebra (2)
– 0 = “off,” “not present,” “false,” “de-asserted.”
– 1 = “on,” “present,” “true,” “asserted.”
• All computer circuits solve problems by performing Boolean
transformations on binary (0-1) variables. It could be said that
Boolean algebra is the algebra of binary systems.
• Boolean Algebra is “1-0 logic.”
statement!!!!
8
What is Logic Logic is the study of reasoning and argumentation. It
is the study of the principles and methods used to
distinguish good reasoning from bad reasoning. Logic
is a branch of philosophy and mathematics that deals
with the structure of arguments and the relationships
between propositions. It is used to study the
correctness and soundness of reasoning and
arguments.
In the context of computer science, logic is also used
to analyze and design digital systems. Digital
systems, such as computers and digital circuits, are
built using gates, which are electronic devices that
perform logical operations on their inputs to produce
an output. Boolean algebra is used to represent the
behavior of these gates and to analyze and simplify
the behavior of digital systems.
Boolean Algebra in the Computer
1
0
• In a computer, logic levels 1 and 0 correspond to voltages:
– “Positive logic” uses a + voltage (e.g., 5 V) for 1 and 0 V for 0.
• There are two classes of digital or computer logic:
– Combinational logic – output depends only on the inputs.
– Sequential logic – output depends on the inputs, the internal state of the
logic, and possibly a clock or timing mechanism (studied later).
• We will only cover circuit behavior in terms the manipulation of 1’s
and 0’s.
• A logic circuit (“gate”), is an electronic device that performs a
Boolean function* on one or more inputs, and provides at least one
output.
• There are three basic Boolean functions: AND OR NOT
* Afunction is an action that can be performed on a value, state, or number, resulting in a new value, state, or number.
Combinational logic vs Sequential logic
Combinational logic refers to a type of
digital logic circuit in which the output
depends only on the current input. The
output of a combinational logic circuit is
a function of its current input, and it does
not depend on the previous input or
output. Combinational logic circuits are
used to perform mathematical
operations, such as addition,
subtraction, and multiplication, as well as
to implement Boolean functions, such as
AND, OR, and NOT.
Sequential logic, on the other hand,
refers to a type of digital logic circuit in
which the output depends not only on
the current input, but also on the
previous input and output. Sequential
logic circuits are used to store and
process information over time. They
include flip-flops and registers, which are
used to store binary data, and counters
and state machines, which are used to
keep track of the system state.
Boolean Functions: Logical Negation
• NOT is the simplest logical function: 1 input and 1 output.
• NOT is defined as follows: “The output f of NOT, given an input
a, is the complement or opposite of the input.” Or :f  a
• Since NOT can have only a 0 or 1 input, the output of NOT is the
reverse, or complement, of the input.
– If the input of NOT is 1, the output is 0.
– If the input of NOT is 0, the output is 1.
• The NOT function is called inversion, and the digital circuit which
inverts is an inverter. The electronic circuit symbol for NOT is:
a a
1
3
Switch Output
1 0
0 1
Boolean
Expression
not-A or A
NOT Function Truth Table
Truth Tables
1
7
• The input/output relationship is
easy to show for an inverter (see
last slide).
• For more complex functions, a
table of outputs versus inputs is
helpful.
• Such a table is called a truth table,
since the table indicates the 1 (or
“true”) outputs, although the
table normally shows outputs for
all input combinations.
• We will use truth tables to
demonstrate many Boolean
functions.
Boolean Function Truth Table
Input x Input y Output f
0 0 0
0 1 1
1 0 1
1 1 0
Logical AND
• AND has two or more inputs.
• The truth table for a two-input AND with
a and b inputs is shown in the chart.
• AND is defined as follows: a AND b = 1 if
and only if (iff) a = 1 and b = 1.
• Mathematically, we represent “a AND b”
as ab (an unfortunate choice).
• AND may have more than two inputs, i.
e.: a AND b AND c AND d.
• The electronic circuit symbols for 2- and
4-input AND’s are shown at the right.
• Regardless of the number of inputs, the
output of AND is 1 iff all inputs are 1.
2-Input AND
1
8
4-Input AND
ab
abcd
b
c
a
b
a
d
a b a AND b
0 0 0
0 1 0
1 0 0
1 1 1
AND Truth Table
Switch
A
Switch
B
Output Description
0 0 0
A and B are both open, lamp
OFF
0 1 0
A is open and B is closed,
lamp OFF
1 0 0
A is closed and B is open,
lamp OFF
1 1 1
A is closed and B is closed,
lamp ON
Boolean Expression (A
AND B)
A . B
AND Function Truth Table
Logical OR
• OR has two or more inputs.
• The truth table for two inputs a, b is shown
in the adjacent chart.
• OR is defined as follows: a OR b = 1 if
either a or b or both a and b = 1.
• Another way to way this is that a OR b = 0
iff a = b = 0.
• Mathematically, we represent “a OR b” as
a  b (another bad choice).
• OR may have many inputs, e. g.: a+b+c+d.
• The electronic circuit symbols for 2- and 4-
input OR’s are shown at the right.
• Regardless of the number of inputs, the
output of OR is 0 iff all inputs are 0.
a
7
a  b
2-Input OR
a  b  c  d
4-Input OR
a
b
b
c
d
a b a O R b
0 0 0
0 1 1
1 0 1
1 1 1
OR Truth Table
Switch
A
Switch
B
Output Description
0 0 0
A and B are both open, lamp
OFF
0 1 1
A is open and B is closed,
lamp ON
1 0 1
A is closed and B is open,
lamp ON
1 1 1
A is closed and B is closed,
lamp ON
Boolean Expression (A
OR B)
A + B
Logic OR Function Truth Table
Illustration of AND and OR with “Goofy Flashlights”
Switches
Light Bulb
AND
• The AND “goofy flashlight” is a
circuit connecting batteries to a
light bulb via series switches, a & b.
• The bulb will be lighted only if both
switches are closed.
• Thus we say that the “AND light
bulb function” = a AND b = a · b.
a·b
a b
Batteries
OR
• The OR “goofy flashlight” connects
batteries to a light bulb via parallel
switches, a & b.
• The bulb will be lighted if either
switch is closed.
• Thus we say that the “OR light
bulb function” = a OR b = a + b.
a+b
a
b
NAND and NOR
• Both NAND and NOR are composite functions, but we discuss
them here, since they are commercially available.
• The NAND function is inverted AND; NOR is inverted OR.
• Mathematically, we use a horizontal bar to indicate the inversion,
i.e.: a NAND b is written asab, and a NOR b is written as a  b
• As NAND is the reverse of AND, the NAND output is 1 unless all
inputs are 1. Likewise, NOR outputs 0 unless all inputs are 0.
a
b
a
b
NAND NOR
a
b
a
b
a b a N O R b
0 0 1
0 1 0
1 0 0
1 1 0
a  b
a  b
NAND Truth Table NOR Truth Table
a b a N A N D b
0 0 1
0 1 1
1 0 1
1 1 0
ab
ab
Switch
A
Switch
B
Outpu
t
Description
0 0 1
A and B are both open,
lamp ON
0 1 1
A is open and B is closed,
lamp ON
1 0 1
A is closed and B is open,
lamp ON
1 1 0
A is closed and B is closed,
lamp OFF
Boolean Expression
(A AND B)
A . B
NAND Function Truth Table
Switch
A
Switch
B
Outpu
t
Description
0 0 1
Both A and B are open,
lamp ON
0 1 0
A is open and B is closed,
lamp OFF
1 0 0
A is closed and B is open,
lamp OFF
1 1 0
A is closed and B is closed,
lamp OFF
Boolean Expression
(A OR B)
A + B
Logic NOR Function Truth Table
Next Session
Exclusive OR/Exclusive NOR (XOR/XNOR)
• XOR and XNOR are useful logic functions.
• Both have two or more inputs. The truth
table for two inputs is shown at right.
• a XOR b = 1 if and only if (iff) a ≠ b.
• a XNOR b = 1 if and only if (iff) a = b.
• Both may also have many inputs. For >2
inputs, the XOR output is 1 for an odd
number of 1 inputs; XNOR has a 1 output
for an even number of 1 inputs.
• Symbols are shown below and to the right.
XOR/XNOR Truth Table
a b a XOR b a XNOR b
0 0 0 1
0 1 1 0
1 0 1 0
1 1 0 1
Like NAND and
NOR, XOR and
XNOR are not
basic Boolean functions,
but can be made from
AND, OR and NOT.
XOR = ab  ab
XNOR = ab  ab
a
b
a
b
XOR
XNOR
a  b
a b
Creating Boolean Functions
• As mentioned a few slides ago, digital circuits solve problems by
performing Boolean transformations on binary numbers.
• Any computer function can be created by combinations of Boolean
variables. Boolean functions created in this way are called
combinational logic.
• When a digital system is being designed, an engineer usually starts
with a specification (“spec”), which describes how the system
performs (“when the system inputs are this, the output is that”).
• We go from “spec” → truth table, from which we can derive a Boolean
expression, from which a circuit can be made.
Engineering Design Process
Specification
Defined
(Exact description of
how the system
performs)
Truth Table
(Detailed
performance
parameters)
Boolean
Expression
(Equation that
defines system
performance)
Digital Circuit
Sadfaf
ghftgyh
nbcvbnbv
Khgvujm
Fgrdtfbsntr
Bfrbsed xgfr
Se esr gse g
er98790ykiuh
x y z f
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
f  wx yz  wx yz  wxyz  wxyz
Engineering design process
The engineering design process is a systematic approach to solving
problems and creating new designs. The process typically involves
several steps, which may include the following:
1.Defining the problem: Clearly stating the problem to be solved and
identifying the design constraints, such as budget, materials, and safety
requirements.
2.Researching the problem: Gathering information about the problem and
identifying potential solutions.
3.Generating ideas: Brainstorming and generating a list of potential
solutions.
4.Choosing a solution: Evaluating the potential solutions and selecting
the best one based on criteria such as feasibility, cost, and safety.
Continue
1.Developing a prototype: Creating a physical or virtual model of the solution.
2.Testing and evaluating: Testing the prototype and evaluating its
performance to identify any problems or areas for improvement.
3.Improving the design: Making changes to the design based on the results of
testing and evaluation.
4.Implementing the solution: Producing the final design and implementing it in
the real world.
The engineering design process is iterative, meaning that it often involves
repeating steps or going back to previous steps as new information is
discovered or new problems arise. It's an important tool for engineers to come
up with creative, effective and safe solutions to real-world problems.
It's a process of creativity, experimentation, critical thinking and problem-
solving. It's used in many different fields of engineering, including mechanical,
electrical, civil, chemical, aerospace, and software engineering.
Boolean Funcion
A Boolean function is a mathematical function
that takes one or more Boolean inputs (i.e., true
or false values) and produces a single Boolean
output. Boolean functions are used to represent
the behavior of digital logic circuits and Boolean
expressions, and they are defined by a truth
table.
A truth table lists all possible combinations of
input values and the corresponding output value.
For example, a Boolean function with two inputs,
A and B, and one output, C, would have a truth
table with four rows, one for each possible
combination of input values (00, 01, 10, and 11).
Each row in the truth table defines the output
value for a particular combination of input
values.
Continue
Boolean functions can also be represented by
Boolean expressions, which are mathematical
expressions that use logical operators such as
AND, OR, and NOT to combine the input
variables. Boolean expressions are used to
simplify and analyze digital logic circuits.
Boolean functions are used to represent the
behavior of digital logic gates, such as AND,
OR, and NOT gates, and can be used to
design and analyze digital systems, such as
computers and digital circuits. Boolean
algebra is used to manipulate Boolean
functions and to simplify the behavior of digital
systems.
Circuit Derived from Boolean Expression
• We will look at the entire process
later: Let’s now examine the
Boolean function → circuit design
process.
• Assume we have some Boolean
functions that represent computer
circuits that we want to design.
How do we go from the Boolean
function to the computer circuit?
• Consider these functions:
f  a  b  c
f  a  b
f  (ab)  c
(and a bit more complicated one!):
f  (a  b)(c  d)
1:
2:
3:
4:
Digital Circuit
A circuit is an interconnection of electrical components that allows
electricity to flow through it. The components can include resistors,
capacitors, transistors, diodes, and other types of electronic devices.
Circuits can be classified into two main categories: analog and
digital.
Analog circuits are designed to handle continuous signals, such as
electrical voltages and currents. They are used in applications such
as amplifiers, oscillators, and filters. Analog circuits are typically less
precise than digital circuits and are more sensitive to noise and other
external factors.
Digital circuits, on the other hand, are designed to handle discrete
signals, such as binary numbers. They are used in applications such
as computers, cell phones, and digital cameras. Digital circuits are
more precise and less sensitive to noise than analog circuits. They
are based on Boolean algebra and the use of binary numbers (0s
and 1s) and digital gates.
Analog circuits handle continuous signals, while digital circuits
handle discrete signals. Digital circuits are more common in modern
electronic devices and have a wider range of application due to their
precision and robustness.
Exercise 1
• Now let’s try a few digital
circuit designs from the
Boolean expressions:
f  abc
f  (a  b)c
f  (a  b)(cd)
f  a  (bc)  d
Combinational
logic
Combinational logic refers to a type
of digital logic circuit in which the
output depends only on the current
input. The output of a
combinational logic circuit is a
function of its current input, and it
does not depend on the previous
input or output. Combinational logic
circuits are used to perform
mathematical operations, such as
addition, subtraction, and
multiplication, as well as to
implement Boolean functions, such
as AND, OR, and NOT.
Complex Boolean Functions: “Combinational Logic”
• Any Boolean function f maps a total of n inputs (x1, x2, x3, ...... xn)
into one output (0,1). That is, a Boolean function f of n variables
produces a single output for each unique combination of inputs.
• Remember:
– There are only two Boolean variables: 0 or 1.
– A Boolean function in which the output f depends only on the input
variables is called combinational logic.
– No matter how complex, a Boolean function can always be defined by
using a truth table, as we have done previously.
• Principle: Any combinational logic function may be represented by
two levels of logic: a level of AND gates followed by an OR gate, or a
level of OR gates followed by an AND gate.
SOP and POS Boolean Representations
• If we have AND functions followed by an OR, then we have a “Sum
of Products” (SOP) representation, a misnomer from mathematics.*
• If we have OR’s followed by an AND, we say that we have a
“Product of Sums” (POS) representation (also misnamed).
• A “Sum of Products” function looks like this: f  (ab)  (c d) .
– The Boolean function f is the OR of two functions, a AND b & c AND d.
It is an SOP since the AND’s come first, and then the OR.
is also SOP, even with inverted inputs.
– Likewise, g  (ab)  (c d)
AND Level
OR Level SOPIllustration:
f  (ab)  (c d)
SOP and POS (Continued)
• A “Product of Sums” looks like this: f  (a  b)(c  d) .
– In this case, f is a Boolean AND of two OR functions, a OR b &
c OR d. It is POS since the OR’s come first, and then the AND.
– In the same way, g  (a  b)(c  d) is also POS. It is also 2-
level, even though there are also two variable inversions.
OR Level
AND Level
POS Illustration:
f  (a  b)(c  d)
Using a Truth Table to Find Boolean Expressions
• In digital circuit design, inputs and outputs are normally defined.*
• Since computer circuits use only binary numbers, input values will
always be only 0 and 1, and the output will always be 0 and 1.
• The engineer designs the “stuff in the middle” between input and
output by:
– Making a truth table to represent the input/output relationship.
– Defining a Boolean expression in SOP or POS form that satisfies the
truth table.
– Constructing a circuit that represents the “stuff in the middle” that
performs the Boolean function on the inputs to get the desired output.
* Once again, we get this output-versus-input information from a product or performance
specification, or a “spec.”
Establish
inputs and
outputs
Construct
Truth
Table
Define Boolean
expression in
SOPor POS form
Design digital circuit
based on Boolean
expression
Examples: Sum-of-Products Form
• Assume that we have a specification that
gives the outputs of function f for the 8
possible combinations of inputs x, y, z.
• We can then build the truth table shown.
• We then define the two AND functions
that result in 1’s being output from the
function f for each x, y, z combination.
• Note that the two AND functions are
unique.
*Note thatAND produces a single, unique output of 1 for only one combination of its inputs!
x y z f(x, y, z) AND’s
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1 x  y z
1 0 0 0
1 0 1 1 x  y z
1 1 0 0
1 1 1 0
For the x, y, z combination (0,1,1),
f will only be 1 for f  x  y z .
For the x, y, z combination (1,0,1),
f will be one for f  x  y z (only).
Sum-of-Products Boolean Form (2)
x y z f(x, y, z) AND’s
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1 x  y z
1 0 0 0
1 0 1 1 x  y z
1 1 0 0
1 1 1 0
• Now we wish to complete the
SOP Boolean expression for
the function which will result
in 1’s for the two cases shown.
• We know that in SOP form the
second level of Boolean
operator will be an OR.
• Thus we define f as:
f  (x  y z)  (x  y z)
• The Boolean expression is fully
defined.
For f  (x  y z)  (x  y z) , note
that f = 1 only for the two cases in the
truth table.
Boolean Notation; Minterms and Maxterms
•
• In SOP notation, which contain AND terms OR’ed together, the
AND and the parentheses are often omitted for simplicity.
Thus, the SOP expression f  (abc)  (acd)  (abd) (bcd)
could also be written as: f  abc  acd  abd  bcd.
• The AND symbols are implied in this representation and are still
used when the expression might not be clear if they were left out.
• Since SOP is more compact, it is sometimes called the minterm form,
and the AND components minterms. Similarly, POS is often
referred to as the maxterm form, and the OR’s maxterms, since POS
terms are more unwieldy: f  (a  b  c)(a  c  d)(b  c  d)
• Since this is a customary terminology, the names minterm and
maxterm will be used occasionally in future lectures.
Product-of-Sums Boolean Form
• A POS representation will contain
a first level of OR’s.
• In the SOP example, we looked
for the 1 outputs in f.
• For POS, we look for outputs that
are 0.*
• Here, f is 0 only for two
combinations of x, y, and z.
• We represent these conditions in
OR form.
• Each OR will produce a 0 only for
the exact OR expression shown.
A truth table example, with 0’s
represented by Boolean OR terms.
*OR produces a single, unique output of 0 for only one combination of its inputs, just asAND produces
a single unique output of 1 for only one combination of inputs.
x y z f(x, y, z) OR’s
0 0 0 1
0 0 1 1
0 1 0 0 x  y  z
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0 x  y  z
1 1 1 1
POS Boolean Expressions (2)
x y z f(x, y, z) OR’s
0 0 0 1
0 0 1 1
0 1 0 0 x  y  z
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0 x  y  z
1 1 1 1
For f  (x  y  z)(x  y  z) ,
note that f=0 only for the two cases
in the truth table. Again, try other
combinations of x, y, and z to prove
this to yourself.
• We now complete the Boolean
POS expression for the truth
table shown.
• Since in POS, the second level
of logic will be an AND, we
know that the two OR terms
must be ANDed together:
f  (x  y  z)(x  y  z)
• The Boolean expression is now
fully defined.
SOP versus POS Representations (1)
a b f SOP POS
0 0 0 a  b
0 1 0 a  b
1 0 1 ab
1 1 1 ab
• Any Boolean expression can be
represented in SOP or POS form.
• Consider the truth table shown.
• If we represent f in SOP form,
we have f  ab  ab .
• If we represent f in POS form,
we have f  (a  b)(a  b) .
• Either representation is correct. In general, we pick the
representation that is simplest.
• The SOP form is used more frequently, simply because the notation
is easier, but the POS form can have an advantage by making the
Boolean function being represented much simpler to express.
SOP versus POS Representations (2)
• In the example at
the right (seen
previously), note
how the SOP form
of the Boolean
expression is much
simpler.
• We could also make
up a truth table so
that the POS form
was much simpler
to use as the
representation.
x y z f(x, y, z) OR’s AND’s
0 0 0 0 x  y  z
0 0 1 0 x  y  z
0 1 0 0 x  y  z
0 1 1 1 xyz
1 0 0 0 x  y  z
1 0 1 1 x yz
1 1 0 0 x  y  z
1 1 1 0 x  y  z
POS: f  (x  y  z)(x  y  z)(x  y  z)
(x  y  z)(x  y  z)(x  y  z)
SOP: f  xyz  x yz
Exercise 2
• Let’s try our hand at starting with a truth table and developing the
Boolean expression:
x y z f AND
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
x y z f OR
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
SOP
POS
Finding the Truth Table, Given SOP Expression
• We can also go the other way, Boolean
expression → truth table.
• Consider the SOP Boolean expression:
f  xyz  xyz  x yz  xyz
– The first term will be 1 when x, y, and z
are 1, the second when x = y = 1, and z =
0, the third when x = z = 1, and y = 0,
and the last when y = z = 1, and x = 0.
• We insert the 1 outputs in the truth
table at right. By default all the other
values of f must be 0.
x y z f(x, y, z) AND’s
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1 xyz
1 0 0 0
1 0 1 1 x yz
1 1 0 1 xyz
1 1 1 1 xyz
Step-by-Step Logic Circuit Design
• We usually go truth table → circuit,
however. Consider this truth table:
• Output f will be 1 when x = 0, y = 1.
x
y
x
y
– The Boolean expression for this term is
xy .
• Output f is also 1 when x = 1, y = 0.
– The Boolean expression for this term is
xy .
• The circuit equivalents of these two
AND terms are shown to the right.
x y f(x, y,) SOP
Terms
0 0 0
0 1 1 xy
1 0 1 xy
1 1 0
xy
xy
Step-by-Step Logic Circuit Design (2)
x
y
f
• We now add the OR level to
our SOP representation to get
the circuit which will produce
the correct output for all
possible input combinations of
the two variables x and y.
• The resulting Boolean
expressions is:
f  xy  x y
• Then
Note that this is also in SOPform.
Another Boolean Function
• Suppose a specification has given
us the following truth table:
– a b c y
– 0 0 0 0
– 0 0 1 0
– 0 1 0 0
– 0 1 1 1
– 1 0 0 1
– 1 0 1 1
– 1 1 0 0
– 1 1 1 0
c
The circuit implementation
is shown above.
a
b y
abc
abc
abc
y  abc  abc  abc .
Exercise 3: Specification → Circuit
• Now let’s try a design going from
“spec” to circuit. Below are 2
very simple “specs.” Use each
set to create (1) a truth table, (2)
a Boolean expression, and (3) the
corresponding digital circuit.
1. A function f has inputs a and b.
It’s output is true (or 1) only
when a is 1 and b is 0.
2. Function g has inputs x and y.
Its output is 1 only when the
inputs are opposite (i.e., 1-0 or
0-1).
0 0
0 1
1 0
1 1
a b f
0 0
0 1
1 0
1 1
x y g
Looking for the Simplest Expression
• Since Boolean expressions represent logical circuit functions that
the engineer may want to build, it is always important to get the
simplest Boolean circuit representation (simplest = cheapest).
• Since we chose the SOP or POS form of Boolean expression to
reduce the number of terms, one might think that the resulting
circuit would be the simplest possible digital circuit.
• Unfortunately, even a SOP or POS Boolean expression may NOT
be in the simplest form!
• However, it is possible to reduce a Boolean expression to its
simplest form (in a future lecture, we will study simplification of a
circuit using a graphical technique called the Karnaugh Map).
Boolean Theorems: Commutativity
• Boolean relations follow simple rules. We discuss some
of these rules or principles before developing more
complex functions. The first is commutativity:
– The Boolean functions AND and OR are commutative. That
is: x · y = y · x, and x + y = y + x
– Using logic circuits, we can illustrate this as:
a
b
=b
a
= a ·b
a
b
= b
a
a + b
Distributivity
• The AND and OR functions are both distributive:
x·(y+z) = (x·y) + (x·z), and
x + (y·z) = (x+y) · (x+z)
• We can illustrate the AND version of this relation as:
=
x
y
z
x·(y+z)
(x·y)+(x·z)
x
y
x
z
• The OR version can be illustrated similarly. If you
don’t believe these assertions, make up the two AND
truth tables and prove it to yourself!
Other Fundamental Boolean Theorems
• The following Boolean theorems are often useful:
• And, finally, we note that:
• x  x
OR Form
• x+0=x
• x  x  1
• x+x=x
• x+1=1
AND Form
• x·1 = x
• x  x  0
• x·x=x
• x·0=0
DeMorgan’s Laws
• One other useful relationship in manipulating Boolean expressions is
DeMorgan’s Law. There are OR and AND versions of the law.
• The OR version of DeMorgan’s law states that the complement of (x
OR y) is equal to x-complement AND y-complement, or:
x  y  x  y
• Likewise, the AND version states that the complement of (x AND y) is
equal to x-complement OR y-complement, or:
x  y  x  y
Simplifying a Boolean Expression
• Consider the following Boolean expression: f  abc  abc .
• Is this the simplest possible POS expression? Clearly, the
expression is in proper SOP form. However, as stated earlier, even
a proper SOP function may not be in the simplest form.
• Since Boolean expressions are distributive ([ab+ac]=a[b+c]), we
can express the above as: f  ab(c  c) .
• Now, from the Boolean identity list, we know thatc  c  1 .
Substituting, f  ab(c  c)  ab(1)  ab .
• Clearly this second Boolean expression, which is equivalent, is
much the simpler and therefore, easier and cheaper to build.
A More Complicated Example
a b c f AND
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1 abc
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1 abc
• Assume the following expression:
f  ((abc  ab  bc)a  b)c abc
• This expression is certainly NOT in
proper SOP or POS form.
• However, we can input its values in
the truth table at the right. Using
the truth table, the equivalent SOP
expression is f  abc  abc .
• Using Boolean identity x  x 1 ,
f  abc  abc  (a  a)bc.
• Since (a  a)  1, then f = bc is the
simplified SOP term.
Implementation of Three Forms
Original circuit
f
a
b
c
Proper
SOPForm
b
c
f
Simplified SOPForm
f
c
b
a
Exercise 4
• A Boolean expression f
has two inputs, x and y.
• The output is 1 when x
and y are both 1 or when
x = 0 and y = 1.
• Construct a truth table.
• Develop an SOP
expression.
• Simplify if possible.
• Draw the circuit.
x y f
0 0
0 1
1 0
1 1
Summary
• Digital circuits are electronic implementations of Boolean expressions.
• Computer circuits are all composed of logic gates such as we have
discussed: AND, OR, NOT, NAND, NOR, etc.
• Logic circuits whose outputs only depend on their inputs are called
combinational logic.
• Combinational logic with more than two levels of logic may always be
simplified into sum of products (SOP) or product of sums (POS) form
using a truth table.
• An SOP (or POS) expression may not always be in the simplest
possible form. We can use De Morgan’s Law or other Boolean
identities to simplify an expression, if simplification is possible.
Design Problem
• You have now seen how to go from a requirement to a truth table to a
Boolean Expression to a circuit (and even how to simplify the circuit).
• Here is the requirement (“spec”): A circuit has three input variables,
x, y, and z. Its output is 1 for the conditions x, y, z = 0, x, y = 0; z = 1,
and x = 0; y, z = 1. Do the following:
– Make a truth table from the requirements.
– Devise an SOP Boolean expression from the truth table. Simplify it using
the relationships discussed today, but keep in SOP form.
– Using all combinations of the 8 input variables
Thanks
Boolean
Expression
Description
Equivalent
Switching Circuit
Boolean Algebra
Law or Rule
A + 1 = 1
A in parallel with
closed = “CLOSED”
Annulment
A + 0 = A
A in parallel with
open = “A”
Identity
A . 1 = A
A in series with
closed = “A”
Identity
A . 0 = 0
A in series with
open = “OPEN”
Annulment
A + A = A
A in parallel with
A = “A”
Idempotent
A . A = A
A in series with
A = “A”
Idempotent
NOT A = A
NOT NOT A
(double negative) = “A”
Double Negation
A + A = 1
A in parallel with
NOT A = “CLOSED”
Complement
A . A = 0
A in series with
NOT A = “OPEN”
Complement
A+B = B+A
A in parallel with B =
B in parallel with A
Commutative
A.B = B.A
A in series with B =
B in series with A
Commutative
A+B = A.B invert and replace OR with AND de Morgan’s Theorem
A.B = A+B invert and replace AND with OR de Morgan’s Theorem
Truth Tables
Week4_BooleanAlgebra.pptx

More Related Content

Similar to Week4_BooleanAlgebra.pptx

UNIT1-part2.pptx
UNIT1-part2.pptxUNIT1-part2.pptx
UNIT1-part2.pptx
AshokRachapalli1
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
nanishajieha
 
Chapter_11.pdf
Chapter_11.pdfChapter_11.pdf
Chapter_11.pdf
Upinder Kaur
 
Boolean Expression.pptx
Boolean Expression.pptxBoolean Expression.pptx
Boolean Expression.pptx
EdFeranil
 
boolean algrebra and logic gates in short
boolean algrebra and logic gates in shortboolean algrebra and logic gates in short
boolean algrebra and logic gates in short
Rojin Khadka
 
1,basic and derived logic gates.pdf
1,basic and derived logic gates.pdf1,basic and derived logic gates.pdf
1,basic and derived logic gates.pdf
DamotTesfaye
 
Boolean algebra
Boolean algebraBoolean algebra
Boolean algebra
LouieDiane
 
Ass.(2)applications of logic u.s d.m
Ass.(2)applications of logic u.s d.mAss.(2)applications of logic u.s d.m
Ass.(2)applications of logic u.s d.m
Syed Umair
 
Boolean Logic.pptx
Boolean Logic.pptxBoolean Logic.pptx
Boolean Logic.pptx
akshat205573
 
PHYSICS PROJECT 12.pptx
PHYSICS PROJECT 12.pptxPHYSICS PROJECT 12.pptx
PHYSICS PROJECT 12.pptx
DronBansal
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
Vanitha Chandru
 
BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE
Tamim Tanvir
 
2nd PUC computer science chapter 2 boolean algebra 1
2nd PUC computer science chapter 2  boolean algebra 12nd PUC computer science chapter 2  boolean algebra 1
2nd PUC computer science chapter 2 boolean algebra 1
Aahwini Esware gowda
 
Digital Electronics basics book1_pdf.pdf
Digital Electronics basics book1_pdf.pdfDigital Electronics basics book1_pdf.pdf
Digital Electronics basics book1_pdf.pdf
pradnyahirekhanATgma
 
Asima Final Presentation.pptx
Asima Final Presentation.pptxAsima Final Presentation.pptx
Asima Final Presentation.pptx
UmakantaKaran1
 
BOOLEAN ALGEBRA & LOGIC GATES.ppt
BOOLEAN ALGEBRA & LOGIC GATES.pptBOOLEAN ALGEBRA & LOGIC GATES.ppt
BOOLEAN ALGEBRA & LOGIC GATES.ppt
dhanamalathieee
 
DE notes
DE notesDE notes
Simplification of Circuits.pdf
Simplification of Circuits.pdfSimplification of Circuits.pdf
Simplification of Circuits.pdf
MaryJacob24
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
The University of Lahore
 

Similar to Week4_BooleanAlgebra.pptx (20)

9. logic gates._rr
9. logic gates._rr9. logic gates._rr
9. logic gates._rr
 
UNIT1-part2.pptx
UNIT1-part2.pptxUNIT1-part2.pptx
UNIT1-part2.pptx
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Chapter_11.pdf
Chapter_11.pdfChapter_11.pdf
Chapter_11.pdf
 
Boolean Expression.pptx
Boolean Expression.pptxBoolean Expression.pptx
Boolean Expression.pptx
 
boolean algrebra and logic gates in short
boolean algrebra and logic gates in shortboolean algrebra and logic gates in short
boolean algrebra and logic gates in short
 
1,basic and derived logic gates.pdf
1,basic and derived logic gates.pdf1,basic and derived logic gates.pdf
1,basic and derived logic gates.pdf
 
Boolean algebra
Boolean algebraBoolean algebra
Boolean algebra
 
Ass.(2)applications of logic u.s d.m
Ass.(2)applications of logic u.s d.mAss.(2)applications of logic u.s d.m
Ass.(2)applications of logic u.s d.m
 
Boolean Logic.pptx
Boolean Logic.pptxBoolean Logic.pptx
Boolean Logic.pptx
 
PHYSICS PROJECT 12.pptx
PHYSICS PROJECT 12.pptxPHYSICS PROJECT 12.pptx
PHYSICS PROJECT 12.pptx
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
 
BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE
 
2nd PUC computer science chapter 2 boolean algebra 1
2nd PUC computer science chapter 2  boolean algebra 12nd PUC computer science chapter 2  boolean algebra 1
2nd PUC computer science chapter 2 boolean algebra 1
 
Digital Electronics basics book1_pdf.pdf
Digital Electronics basics book1_pdf.pdfDigital Electronics basics book1_pdf.pdf
Digital Electronics basics book1_pdf.pdf
 
Asima Final Presentation.pptx
Asima Final Presentation.pptxAsima Final Presentation.pptx
Asima Final Presentation.pptx
 
BOOLEAN ALGEBRA & LOGIC GATES.ppt
BOOLEAN ALGEBRA & LOGIC GATES.pptBOOLEAN ALGEBRA & LOGIC GATES.ppt
BOOLEAN ALGEBRA & LOGIC GATES.ppt
 
DE notes
DE notesDE notes
DE notes
 
Simplification of Circuits.pdf
Simplification of Circuits.pdfSimplification of Circuits.pdf
Simplification of Circuits.pdf
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
 

Recently uploaded

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Week4_BooleanAlgebra.pptx

  • 2. BA Boolean algebra is a branch of algebra in which the values of the variables are true or false, typically denoted by 1 or 0, respectively. It is used to analyse and simplify digital logic circuits, as well as to represent certain types of mathematical relations. Boolean algebra is based on the operations of AND, OR, and NOT, and the laws that govern them, such as the commutative and associative laws, the distributive laws, and De Morgan's laws. Boolean algebra is used in computer science, electrical engineering, and mathematics to design logic circuits and other digital systems.
  • 3. Boolean Algebra 3 • Boolean Algebra (named for its developer, George Boole), is the algebra of digital logic circuits that all computers use. • It is a symbolic representation of logic principles that date back to Greek logic studies (Aristotle, ~384-322 BC). • In the Victorian Age, mathematicians began to apply formal principles to Aristotelian logic, which led to the field of symbolic logic. • Technically, “Boolean Algebra” refers to a family of logic systems, but it is generally used to refer to one system -- and that is how we will use it. • George Boole (1815-1864) was a mathematician and teacher, the self- educated son of a cobbler, who married Mary Everest (niece of Sir George Everest of mountain fame).* • Boole’s thinking was typical of Victorians: All processes (even thinking!) could be represented by formal rules. His intent was to formalize the “rules of thinking” with logic equations – a well-meant but totally impossible task. • Scientists soon began to apply “switching algebra” to logic problems. * His key work was “An Investigation of the Laws of Thought on Which are Founded the Mathematical Theories of Logic and Probabilities.”
  • 4. George Boole George Boole (/buːl/; 2 November 1815 – 8 December 1864) was a largely self- taught English mathematician, philoso pher, and logician, most of whose short career was spent as the first professor of mathematics at Queen's College, Cork in Ireland. He worked in the fields of differential equations and algebraic logic, and is best known as the author of The Laws of Thought (1854) which contains Boolean algebra. Boolean logic is credited with laying the foundations for the Information Age.[4]
  • 5. More In Boolean algebra, the variables can take on only two possible values: true or false, represented by 1 or 0, respectively. The basic operations in Boolean algebra are AND, OR, and NOT. The AND operation is denoted by the symbol "∧" and is true only if both of its operands are true. The OR operation is denoted by the symbol "∨" and is true if at least one of its operands is true. The NOT operation is denoted by the symbol "¬" and is used to negate the value of its operand. Boolean algebra has several laws that govern the behavior of these operations, such as the commutative law, associative law, distributive law and De Morgan's laws.
  • 6. More The commutative law states that the order of the operands does not affect the result of the operation, for example A∧B = B∧A and A∨B = B∨A. The associative law states that the grouping of the operands does not affect the result of the operation, for example (A∧B)∧C = A∧(B∧C) and (A∨B)∨C = A∨(B∨C). The distributive law states that the AND operation distributes over the OR operation, for example A∧(B∨C) = (A∧B)∨(A∧C) and A∨(B∧C) = (A∨B)∧(A∨C). De Morgan's laws are two theorems that relate the NOT operation to the AND and OR operations. They state that ¬(A∧B) = ¬A∨¬B and ¬(A∨B) = ¬A∧¬B. In addition to these laws, Boolean algebra also includes identities such as the identity laws, inverse laws and the complement laws. Boolean algebra is used in many different fields, including digital logic design and computer science, particularly in the design of digital systems.
  • 7.
  • 8. Boolean Algebra (2) – 0 = “off,” “not present,” “false,” “de-asserted.” – 1 = “on,” “present,” “true,” “asserted.” • All computer circuits solve problems by performing Boolean transformations on binary (0-1) variables. It could be said that Boolean algebra is the algebra of binary systems. • Boolean Algebra is “1-0 logic.” statement!!!! 8
  • 9. What is Logic Logic is the study of reasoning and argumentation. It is the study of the principles and methods used to distinguish good reasoning from bad reasoning. Logic is a branch of philosophy and mathematics that deals with the structure of arguments and the relationships between propositions. It is used to study the correctness and soundness of reasoning and arguments. In the context of computer science, logic is also used to analyze and design digital systems. Digital systems, such as computers and digital circuits, are built using gates, which are electronic devices that perform logical operations on their inputs to produce an output. Boolean algebra is used to represent the behavior of these gates and to analyze and simplify the behavior of digital systems.
  • 10. Boolean Algebra in the Computer 1 0 • In a computer, logic levels 1 and 0 correspond to voltages: – “Positive logic” uses a + voltage (e.g., 5 V) for 1 and 0 V for 0. • There are two classes of digital or computer logic: – Combinational logic – output depends only on the inputs. – Sequential logic – output depends on the inputs, the internal state of the logic, and possibly a clock or timing mechanism (studied later). • We will only cover circuit behavior in terms the manipulation of 1’s and 0’s. • A logic circuit (“gate”), is an electronic device that performs a Boolean function* on one or more inputs, and provides at least one output. • There are three basic Boolean functions: AND OR NOT * Afunction is an action that can be performed on a value, state, or number, resulting in a new value, state, or number.
  • 11. Combinational logic vs Sequential logic Combinational logic refers to a type of digital logic circuit in which the output depends only on the current input. The output of a combinational logic circuit is a function of its current input, and it does not depend on the previous input or output. Combinational logic circuits are used to perform mathematical operations, such as addition, subtraction, and multiplication, as well as to implement Boolean functions, such as AND, OR, and NOT. Sequential logic, on the other hand, refers to a type of digital logic circuit in which the output depends not only on the current input, but also on the previous input and output. Sequential logic circuits are used to store and process information over time. They include flip-flops and registers, which are used to store binary data, and counters and state machines, which are used to keep track of the system state.
  • 12.
  • 13. Boolean Functions: Logical Negation • NOT is the simplest logical function: 1 input and 1 output. • NOT is defined as follows: “The output f of NOT, given an input a, is the complement or opposite of the input.” Or :f  a • Since NOT can have only a 0 or 1 input, the output of NOT is the reverse, or complement, of the input. – If the input of NOT is 1, the output is 0. – If the input of NOT is 0, the output is 1. • The NOT function is called inversion, and the digital circuit which inverts is an inverter. The electronic circuit symbol for NOT is: a a 1 3
  • 14.
  • 15.
  • 16. Switch Output 1 0 0 1 Boolean Expression not-A or A NOT Function Truth Table
  • 17. Truth Tables 1 7 • The input/output relationship is easy to show for an inverter (see last slide). • For more complex functions, a table of outputs versus inputs is helpful. • Such a table is called a truth table, since the table indicates the 1 (or “true”) outputs, although the table normally shows outputs for all input combinations. • We will use truth tables to demonstrate many Boolean functions. Boolean Function Truth Table Input x Input y Output f 0 0 0 0 1 1 1 0 1 1 1 0
  • 18. Logical AND • AND has two or more inputs. • The truth table for a two-input AND with a and b inputs is shown in the chart. • AND is defined as follows: a AND b = 1 if and only if (iff) a = 1 and b = 1. • Mathematically, we represent “a AND b” as ab (an unfortunate choice). • AND may have more than two inputs, i. e.: a AND b AND c AND d. • The electronic circuit symbols for 2- and 4-input AND’s are shown at the right. • Regardless of the number of inputs, the output of AND is 1 iff all inputs are 1. 2-Input AND 1 8 4-Input AND ab abcd b c a b a d a b a AND b 0 0 0 0 1 0 1 0 0 1 1 1 AND Truth Table
  • 19. Switch A Switch B Output Description 0 0 0 A and B are both open, lamp OFF 0 1 0 A is open and B is closed, lamp OFF 1 0 0 A is closed and B is open, lamp OFF 1 1 1 A is closed and B is closed, lamp ON Boolean Expression (A AND B) A . B AND Function Truth Table
  • 20.
  • 21.
  • 22. Logical OR • OR has two or more inputs. • The truth table for two inputs a, b is shown in the adjacent chart. • OR is defined as follows: a OR b = 1 if either a or b or both a and b = 1. • Another way to way this is that a OR b = 0 iff a = b = 0. • Mathematically, we represent “a OR b” as a  b (another bad choice). • OR may have many inputs, e. g.: a+b+c+d. • The electronic circuit symbols for 2- and 4- input OR’s are shown at the right. • Regardless of the number of inputs, the output of OR is 0 iff all inputs are 0. a 7 a  b 2-Input OR a  b  c  d 4-Input OR a b b c d a b a O R b 0 0 0 0 1 1 1 0 1 1 1 1 OR Truth Table
  • 23.
  • 24. Switch A Switch B Output Description 0 0 0 A and B are both open, lamp OFF 0 1 1 A is open and B is closed, lamp ON 1 0 1 A is closed and B is open, lamp ON 1 1 1 A is closed and B is closed, lamp ON Boolean Expression (A OR B) A + B Logic OR Function Truth Table
  • 25. Illustration of AND and OR with “Goofy Flashlights” Switches Light Bulb AND • The AND “goofy flashlight” is a circuit connecting batteries to a light bulb via series switches, a & b. • The bulb will be lighted only if both switches are closed. • Thus we say that the “AND light bulb function” = a AND b = a · b. a·b a b Batteries OR • The OR “goofy flashlight” connects batteries to a light bulb via parallel switches, a & b. • The bulb will be lighted if either switch is closed. • Thus we say that the “OR light bulb function” = a OR b = a + b. a+b a b
  • 26. NAND and NOR • Both NAND and NOR are composite functions, but we discuss them here, since they are commercially available. • The NAND function is inverted AND; NOR is inverted OR. • Mathematically, we use a horizontal bar to indicate the inversion, i.e.: a NAND b is written asab, and a NOR b is written as a  b • As NAND is the reverse of AND, the NAND output is 1 unless all inputs are 1. Likewise, NOR outputs 0 unless all inputs are 0. a b a b NAND NOR a b a b a b a N O R b 0 0 1 0 1 0 1 0 0 1 1 0 a  b a  b NAND Truth Table NOR Truth Table a b a N A N D b 0 0 1 0 1 1 1 0 1 1 1 0 ab ab
  • 27. Switch A Switch B Outpu t Description 0 0 1 A and B are both open, lamp ON 0 1 1 A is open and B is closed, lamp ON 1 0 1 A is closed and B is open, lamp ON 1 1 0 A is closed and B is closed, lamp OFF Boolean Expression (A AND B) A . B NAND Function Truth Table
  • 28. Switch A Switch B Outpu t Description 0 0 1 Both A and B are open, lamp ON 0 1 0 A is open and B is closed, lamp OFF 1 0 0 A is closed and B is open, lamp OFF 1 1 0 A is closed and B is closed, lamp OFF Boolean Expression (A OR B) A + B Logic NOR Function Truth Table
  • 29.
  • 31. Exclusive OR/Exclusive NOR (XOR/XNOR) • XOR and XNOR are useful logic functions. • Both have two or more inputs. The truth table for two inputs is shown at right. • a XOR b = 1 if and only if (iff) a ≠ b. • a XNOR b = 1 if and only if (iff) a = b. • Both may also have many inputs. For >2 inputs, the XOR output is 1 for an odd number of 1 inputs; XNOR has a 1 output for an even number of 1 inputs. • Symbols are shown below and to the right. XOR/XNOR Truth Table a b a XOR b a XNOR b 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 Like NAND and NOR, XOR and XNOR are not basic Boolean functions, but can be made from AND, OR and NOT. XOR = ab  ab XNOR = ab  ab a b a b XOR XNOR a  b a b
  • 32.
  • 33. Creating Boolean Functions • As mentioned a few slides ago, digital circuits solve problems by performing Boolean transformations on binary numbers. • Any computer function can be created by combinations of Boolean variables. Boolean functions created in this way are called combinational logic. • When a digital system is being designed, an engineer usually starts with a specification (“spec”), which describes how the system performs (“when the system inputs are this, the output is that”). • We go from “spec” → truth table, from which we can derive a Boolean expression, from which a circuit can be made.
  • 34. Engineering Design Process Specification Defined (Exact description of how the system performs) Truth Table (Detailed performance parameters) Boolean Expression (Equation that defines system performance) Digital Circuit Sadfaf ghftgyh nbcvbnbv Khgvujm Fgrdtfbsntr Bfrbsed xgfr Se esr gse g er98790ykiuh x y z f 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 f  wx yz  wx yz  wxyz  wxyz
  • 35. Engineering design process The engineering design process is a systematic approach to solving problems and creating new designs. The process typically involves several steps, which may include the following: 1.Defining the problem: Clearly stating the problem to be solved and identifying the design constraints, such as budget, materials, and safety requirements. 2.Researching the problem: Gathering information about the problem and identifying potential solutions. 3.Generating ideas: Brainstorming and generating a list of potential solutions. 4.Choosing a solution: Evaluating the potential solutions and selecting the best one based on criteria such as feasibility, cost, and safety.
  • 36. Continue 1.Developing a prototype: Creating a physical or virtual model of the solution. 2.Testing and evaluating: Testing the prototype and evaluating its performance to identify any problems or areas for improvement. 3.Improving the design: Making changes to the design based on the results of testing and evaluation. 4.Implementing the solution: Producing the final design and implementing it in the real world. The engineering design process is iterative, meaning that it often involves repeating steps or going back to previous steps as new information is discovered or new problems arise. It's an important tool for engineers to come up with creative, effective and safe solutions to real-world problems. It's a process of creativity, experimentation, critical thinking and problem- solving. It's used in many different fields of engineering, including mechanical, electrical, civil, chemical, aerospace, and software engineering.
  • 37. Boolean Funcion A Boolean function is a mathematical function that takes one or more Boolean inputs (i.e., true or false values) and produces a single Boolean output. Boolean functions are used to represent the behavior of digital logic circuits and Boolean expressions, and they are defined by a truth table. A truth table lists all possible combinations of input values and the corresponding output value. For example, a Boolean function with two inputs, A and B, and one output, C, would have a truth table with four rows, one for each possible combination of input values (00, 01, 10, and 11). Each row in the truth table defines the output value for a particular combination of input values.
  • 38. Continue Boolean functions can also be represented by Boolean expressions, which are mathematical expressions that use logical operators such as AND, OR, and NOT to combine the input variables. Boolean expressions are used to simplify and analyze digital logic circuits. Boolean functions are used to represent the behavior of digital logic gates, such as AND, OR, and NOT gates, and can be used to design and analyze digital systems, such as computers and digital circuits. Boolean algebra is used to manipulate Boolean functions and to simplify the behavior of digital systems.
  • 39.
  • 40.
  • 41. Circuit Derived from Boolean Expression • We will look at the entire process later: Let’s now examine the Boolean function → circuit design process. • Assume we have some Boolean functions that represent computer circuits that we want to design. How do we go from the Boolean function to the computer circuit? • Consider these functions: f  a  b  c f  a  b f  (ab)  c (and a bit more complicated one!): f  (a  b)(c  d) 1: 2: 3: 4:
  • 42. Digital Circuit A circuit is an interconnection of electrical components that allows electricity to flow through it. The components can include resistors, capacitors, transistors, diodes, and other types of electronic devices. Circuits can be classified into two main categories: analog and digital. Analog circuits are designed to handle continuous signals, such as electrical voltages and currents. They are used in applications such as amplifiers, oscillators, and filters. Analog circuits are typically less precise than digital circuits and are more sensitive to noise and other external factors. Digital circuits, on the other hand, are designed to handle discrete signals, such as binary numbers. They are used in applications such as computers, cell phones, and digital cameras. Digital circuits are more precise and less sensitive to noise than analog circuits. They are based on Boolean algebra and the use of binary numbers (0s and 1s) and digital gates. Analog circuits handle continuous signals, while digital circuits handle discrete signals. Digital circuits are more common in modern electronic devices and have a wider range of application due to their precision and robustness.
  • 43. Exercise 1 • Now let’s try a few digital circuit designs from the Boolean expressions: f  abc f  (a  b)c f  (a  b)(cd) f  a  (bc)  d
  • 44. Combinational logic Combinational logic refers to a type of digital logic circuit in which the output depends only on the current input. The output of a combinational logic circuit is a function of its current input, and it does not depend on the previous input or output. Combinational logic circuits are used to perform mathematical operations, such as addition, subtraction, and multiplication, as well as to implement Boolean functions, such as AND, OR, and NOT.
  • 45. Complex Boolean Functions: “Combinational Logic” • Any Boolean function f maps a total of n inputs (x1, x2, x3, ...... xn) into one output (0,1). That is, a Boolean function f of n variables produces a single output for each unique combination of inputs. • Remember: – There are only two Boolean variables: 0 or 1. – A Boolean function in which the output f depends only on the input variables is called combinational logic. – No matter how complex, a Boolean function can always be defined by using a truth table, as we have done previously. • Principle: Any combinational logic function may be represented by two levels of logic: a level of AND gates followed by an OR gate, or a level of OR gates followed by an AND gate.
  • 46. SOP and POS Boolean Representations • If we have AND functions followed by an OR, then we have a “Sum of Products” (SOP) representation, a misnomer from mathematics.* • If we have OR’s followed by an AND, we say that we have a “Product of Sums” (POS) representation (also misnamed). • A “Sum of Products” function looks like this: f  (ab)  (c d) . – The Boolean function f is the OR of two functions, a AND b & c AND d. It is an SOP since the AND’s come first, and then the OR. is also SOP, even with inverted inputs. – Likewise, g  (ab)  (c d) AND Level OR Level SOPIllustration: f  (ab)  (c d)
  • 47. SOP and POS (Continued) • A “Product of Sums” looks like this: f  (a  b)(c  d) . – In this case, f is a Boolean AND of two OR functions, a OR b & c OR d. It is POS since the OR’s come first, and then the AND. – In the same way, g  (a  b)(c  d) is also POS. It is also 2- level, even though there are also two variable inversions. OR Level AND Level POS Illustration: f  (a  b)(c  d)
  • 48. Using a Truth Table to Find Boolean Expressions • In digital circuit design, inputs and outputs are normally defined.* • Since computer circuits use only binary numbers, input values will always be only 0 and 1, and the output will always be 0 and 1. • The engineer designs the “stuff in the middle” between input and output by: – Making a truth table to represent the input/output relationship. – Defining a Boolean expression in SOP or POS form that satisfies the truth table. – Constructing a circuit that represents the “stuff in the middle” that performs the Boolean function on the inputs to get the desired output. * Once again, we get this output-versus-input information from a product or performance specification, or a “spec.” Establish inputs and outputs Construct Truth Table Define Boolean expression in SOPor POS form Design digital circuit based on Boolean expression
  • 49. Examples: Sum-of-Products Form • Assume that we have a specification that gives the outputs of function f for the 8 possible combinations of inputs x, y, z. • We can then build the truth table shown. • We then define the two AND functions that result in 1’s being output from the function f for each x, y, z combination. • Note that the two AND functions are unique. *Note thatAND produces a single, unique output of 1 for only one combination of its inputs! x y z f(x, y, z) AND’s 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 x  y z 1 0 0 0 1 0 1 1 x  y z 1 1 0 0 1 1 1 0 For the x, y, z combination (0,1,1), f will only be 1 for f  x  y z . For the x, y, z combination (1,0,1), f will be one for f  x  y z (only).
  • 50. Sum-of-Products Boolean Form (2) x y z f(x, y, z) AND’s 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 x  y z 1 0 0 0 1 0 1 1 x  y z 1 1 0 0 1 1 1 0 • Now we wish to complete the SOP Boolean expression for the function which will result in 1’s for the two cases shown. • We know that in SOP form the second level of Boolean operator will be an OR. • Thus we define f as: f  (x  y z)  (x  y z) • The Boolean expression is fully defined. For f  (x  y z)  (x  y z) , note that f = 1 only for the two cases in the truth table.
  • 51.
  • 52.
  • 53. Boolean Notation; Minterms and Maxterms • • In SOP notation, which contain AND terms OR’ed together, the AND and the parentheses are often omitted for simplicity. Thus, the SOP expression f  (abc)  (acd)  (abd) (bcd) could also be written as: f  abc  acd  abd  bcd. • The AND symbols are implied in this representation and are still used when the expression might not be clear if they were left out. • Since SOP is more compact, it is sometimes called the minterm form, and the AND components minterms. Similarly, POS is often referred to as the maxterm form, and the OR’s maxterms, since POS terms are more unwieldy: f  (a  b  c)(a  c  d)(b  c  d) • Since this is a customary terminology, the names minterm and maxterm will be used occasionally in future lectures.
  • 54. Product-of-Sums Boolean Form • A POS representation will contain a first level of OR’s. • In the SOP example, we looked for the 1 outputs in f. • For POS, we look for outputs that are 0.* • Here, f is 0 only for two combinations of x, y, and z. • We represent these conditions in OR form. • Each OR will produce a 0 only for the exact OR expression shown. A truth table example, with 0’s represented by Boolean OR terms. *OR produces a single, unique output of 0 for only one combination of its inputs, just asAND produces a single unique output of 1 for only one combination of inputs. x y z f(x, y, z) OR’s 0 0 0 1 0 0 1 1 0 1 0 0 x  y  z 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 x  y  z 1 1 1 1
  • 55. POS Boolean Expressions (2) x y z f(x, y, z) OR’s 0 0 0 1 0 0 1 1 0 1 0 0 x  y  z 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 x  y  z 1 1 1 1 For f  (x  y  z)(x  y  z) , note that f=0 only for the two cases in the truth table. Again, try other combinations of x, y, and z to prove this to yourself. • We now complete the Boolean POS expression for the truth table shown. • Since in POS, the second level of logic will be an AND, we know that the two OR terms must be ANDed together: f  (x  y  z)(x  y  z) • The Boolean expression is now fully defined.
  • 56.
  • 57.
  • 58. SOP versus POS Representations (1) a b f SOP POS 0 0 0 a  b 0 1 0 a  b 1 0 1 ab 1 1 1 ab • Any Boolean expression can be represented in SOP or POS form. • Consider the truth table shown. • If we represent f in SOP form, we have f  ab  ab . • If we represent f in POS form, we have f  (a  b)(a  b) . • Either representation is correct. In general, we pick the representation that is simplest. • The SOP form is used more frequently, simply because the notation is easier, but the POS form can have an advantage by making the Boolean function being represented much simpler to express.
  • 59. SOP versus POS Representations (2) • In the example at the right (seen previously), note how the SOP form of the Boolean expression is much simpler. • We could also make up a truth table so that the POS form was much simpler to use as the representation. x y z f(x, y, z) OR’s AND’s 0 0 0 0 x  y  z 0 0 1 0 x  y  z 0 1 0 0 x  y  z 0 1 1 1 xyz 1 0 0 0 x  y  z 1 0 1 1 x yz 1 1 0 0 x  y  z 1 1 1 0 x  y  z POS: f  (x  y  z)(x  y  z)(x  y  z) (x  y  z)(x  y  z)(x  y  z) SOP: f  xyz  x yz
  • 60. Exercise 2 • Let’s try our hand at starting with a truth table and developing the Boolean expression: x y z f AND 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 x y z f OR 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1 SOP POS
  • 61. Finding the Truth Table, Given SOP Expression • We can also go the other way, Boolean expression → truth table. • Consider the SOP Boolean expression: f  xyz  xyz  x yz  xyz – The first term will be 1 when x, y, and z are 1, the second when x = y = 1, and z = 0, the third when x = z = 1, and y = 0, and the last when y = z = 1, and x = 0. • We insert the 1 outputs in the truth table at right. By default all the other values of f must be 0. x y z f(x, y, z) AND’s 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 xyz 1 0 0 0 1 0 1 1 x yz 1 1 0 1 xyz 1 1 1 1 xyz
  • 62. Step-by-Step Logic Circuit Design • We usually go truth table → circuit, however. Consider this truth table: • Output f will be 1 when x = 0, y = 1. x y x y – The Boolean expression for this term is xy . • Output f is also 1 when x = 1, y = 0. – The Boolean expression for this term is xy . • The circuit equivalents of these two AND terms are shown to the right. x y f(x, y,) SOP Terms 0 0 0 0 1 1 xy 1 0 1 xy 1 1 0 xy xy
  • 63. Step-by-Step Logic Circuit Design (2) x y f • We now add the OR level to our SOP representation to get the circuit which will produce the correct output for all possible input combinations of the two variables x and y. • The resulting Boolean expressions is: f  xy  x y
  • 64. • Then Note that this is also in SOPform. Another Boolean Function • Suppose a specification has given us the following truth table: – a b c y – 0 0 0 0 – 0 0 1 0 – 0 1 0 0 – 0 1 1 1 – 1 0 0 1 – 1 0 1 1 – 1 1 0 0 – 1 1 1 0 c The circuit implementation is shown above. a b y abc abc abc y  abc  abc  abc .
  • 65. Exercise 3: Specification → Circuit • Now let’s try a design going from “spec” to circuit. Below are 2 very simple “specs.” Use each set to create (1) a truth table, (2) a Boolean expression, and (3) the corresponding digital circuit. 1. A function f has inputs a and b. It’s output is true (or 1) only when a is 1 and b is 0. 2. Function g has inputs x and y. Its output is 1 only when the inputs are opposite (i.e., 1-0 or 0-1). 0 0 0 1 1 0 1 1 a b f 0 0 0 1 1 0 1 1 x y g
  • 66. Looking for the Simplest Expression • Since Boolean expressions represent logical circuit functions that the engineer may want to build, it is always important to get the simplest Boolean circuit representation (simplest = cheapest). • Since we chose the SOP or POS form of Boolean expression to reduce the number of terms, one might think that the resulting circuit would be the simplest possible digital circuit. • Unfortunately, even a SOP or POS Boolean expression may NOT be in the simplest form! • However, it is possible to reduce a Boolean expression to its simplest form (in a future lecture, we will study simplification of a circuit using a graphical technique called the Karnaugh Map).
  • 67. Boolean Theorems: Commutativity • Boolean relations follow simple rules. We discuss some of these rules or principles before developing more complex functions. The first is commutativity: – The Boolean functions AND and OR are commutative. That is: x · y = y · x, and x + y = y + x – Using logic circuits, we can illustrate this as: a b =b a = a ·b a b = b a a + b
  • 68. Distributivity • The AND and OR functions are both distributive: x·(y+z) = (x·y) + (x·z), and x + (y·z) = (x+y) · (x+z) • We can illustrate the AND version of this relation as: = x y z x·(y+z) (x·y)+(x·z) x y x z • The OR version can be illustrated similarly. If you don’t believe these assertions, make up the two AND truth tables and prove it to yourself!
  • 69. Other Fundamental Boolean Theorems • The following Boolean theorems are often useful: • And, finally, we note that: • x  x OR Form • x+0=x • x  x  1 • x+x=x • x+1=1 AND Form • x·1 = x • x  x  0 • x·x=x • x·0=0
  • 70. DeMorgan’s Laws • One other useful relationship in manipulating Boolean expressions is DeMorgan’s Law. There are OR and AND versions of the law. • The OR version of DeMorgan’s law states that the complement of (x OR y) is equal to x-complement AND y-complement, or: x  y  x  y • Likewise, the AND version states that the complement of (x AND y) is equal to x-complement OR y-complement, or: x  y  x  y
  • 71. Simplifying a Boolean Expression • Consider the following Boolean expression: f  abc  abc . • Is this the simplest possible POS expression? Clearly, the expression is in proper SOP form. However, as stated earlier, even a proper SOP function may not be in the simplest form. • Since Boolean expressions are distributive ([ab+ac]=a[b+c]), we can express the above as: f  ab(c  c) . • Now, from the Boolean identity list, we know thatc  c  1 . Substituting, f  ab(c  c)  ab(1)  ab . • Clearly this second Boolean expression, which is equivalent, is much the simpler and therefore, easier and cheaper to build.
  • 72. A More Complicated Example a b c f AND 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 abc 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 abc • Assume the following expression: f  ((abc  ab  bc)a  b)c abc • This expression is certainly NOT in proper SOP or POS form. • However, we can input its values in the truth table at the right. Using the truth table, the equivalent SOP expression is f  abc  abc . • Using Boolean identity x  x 1 , f  abc  abc  (a  a)bc. • Since (a  a)  1, then f = bc is the simplified SOP term.
  • 73. Implementation of Three Forms Original circuit f a b c Proper SOPForm b c f Simplified SOPForm f c b a
  • 74. Exercise 4 • A Boolean expression f has two inputs, x and y. • The output is 1 when x and y are both 1 or when x = 0 and y = 1. • Construct a truth table. • Develop an SOP expression. • Simplify if possible. • Draw the circuit. x y f 0 0 0 1 1 0 1 1
  • 75. Summary • Digital circuits are electronic implementations of Boolean expressions. • Computer circuits are all composed of logic gates such as we have discussed: AND, OR, NOT, NAND, NOR, etc. • Logic circuits whose outputs only depend on their inputs are called combinational logic. • Combinational logic with more than two levels of logic may always be simplified into sum of products (SOP) or product of sums (POS) form using a truth table. • An SOP (or POS) expression may not always be in the simplest possible form. We can use De Morgan’s Law or other Boolean identities to simplify an expression, if simplification is possible.
  • 76. Design Problem • You have now seen how to go from a requirement to a truth table to a Boolean Expression to a circuit (and even how to simplify the circuit). • Here is the requirement (“spec”): A circuit has three input variables, x, y, and z. Its output is 1 for the conditions x, y, z = 0, x, y = 0; z = 1, and x = 0; y, z = 1. Do the following: – Make a truth table from the requirements. – Devise an SOP Boolean expression from the truth table. Simplify it using the relationships discussed today, but keep in SOP form. – Using all combinations of the 8 input variables
  • 78. Boolean Expression Description Equivalent Switching Circuit Boolean Algebra Law or Rule A + 1 = 1 A in parallel with closed = “CLOSED” Annulment A + 0 = A A in parallel with open = “A” Identity A . 1 = A A in series with closed = “A” Identity A . 0 = 0 A in series with open = “OPEN” Annulment A + A = A A in parallel with A = “A” Idempotent A . A = A A in series with A = “A” Idempotent NOT A = A NOT NOT A (double negative) = “A” Double Negation A + A = 1 A in parallel with NOT A = “CLOSED” Complement A . A = 0 A in series with NOT A = “OPEN” Complement A+B = B+A A in parallel with B = B in parallel with A Commutative A.B = B.A A in series with B = B in series with A Commutative A+B = A.B invert and replace OR with AND de Morgan’s Theorem A.B = A+B invert and replace AND with OR de Morgan’s Theorem Truth Tables