Download Boolean Algebra and Logic Gates

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

TRIAC wikipedia , lookup

Flip-flop (electronics) wikipedia , lookup

Rectiverter wikipedia , lookup

Boolean satisfiability problem wikipedia , lookup

CMOS wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

Digital electronics wikipedia , lookup

Transcript
Boolean Algebra &
Logic Gates
CHAPTER 3
© Oxford University Press 2013. All rights reserved.
1
Overview






Identify a binary logic variable.
Explain the three basic operations of Boolean
algebra.
Explain some axioms and theorems of Boolean
algebra
Analyse Boolean expressions and functions and
their simplification methods.
Explain the different forms of representing a
Boolean function.
identify logic ‘ true’ and ‘false’ by high and low
voltage levels.
© Oxford University Press 2013. All rights reserved.
2
Overview





Explain gates AND, OR, NOT, NAND, NOR, XOR,
and XNOR.
Explain the construction of logic gates using
electronic devices such as diodes and transistors
Use Boolean algebra for describing the function
of logic gates
Explain how complex logic circuits described by
Boolean expressions are constructed using logic
gates
Construct AND, OR, and NOT gates using NAND
and NOR gates
© Oxford University Press 2013. All rights reserved.
3
Key Words






TRUE: In Boolean algebra true means “1”.
FALSE: In Boolean algebra false means “0”.
Boolean algebra: Boolean algebra is the algebra of
propositions. It deals with two values, 0 and 1 or true
and false.
Boolean or logic variable: It is a variable that can
be assigned any one of the two values, 0 or 1.
Axiom: It is an established statement or proposition.
AND: It is an operation in which the output is “ true”
only when all the inputs are true.
© Oxford University Press 2013. All rights reserved.
4
Key Words





OR: It is an operation in which the output is true
whenever at least one of the inputs is true.
NOT: It is an operation that produces an output which
is the complement of the input.
NAND: It is an operation in which the output is formed
by AND-ing all inputs and then complementing it.
NOR: It is an operation in which the output is formed
by OR-ing all inputs and then complementing it.
Duality: It is the property in which any algebraic
equality derived from the axioms of Boolean algebra
remains true when the operators OR and AND are
interchanged and the identity elements 0 and 1 are
interchanged.
© Oxford University Press 2013. All rights reserved.
5
Key Words
Literal :A literal is a variable or its complement. Example: X, X, Y,
Y.
 Boolean function: A Boolean function is a Boolean variable that
has a value, 0 or 1, which gets evaluated from logic computations
involving Boolean variables and logic operators like ‘ . ’ , ‘ + ’,
‘ — ’.
 Truth Table: It is a table that depicts the boolean value, 0 or 1,
of the output boolean function for different sets of boolean values
of the boolean inputs.
 Term: A term is a collection of boolean variables formed by ANDing or OR-ing , e.g. ABC or (a + c + d).
 Product term: It is a term formed by AND-ing two or more
boolean variables.
 Sum term: It is a term formed by OR-ing two or more boolean
variables.

© Oxford University Press 2013. All rights reserved.
6
Key Words





Sum of products: It is a function formed with the “ sum “
of product terms.
Product of sums: It is a function formed with the “
product “ of sum terms.
Canonical form: It is a function formed by min terms or
max terms.
Min term: It is a special product of literals, in which each
input variable appears exactly once. A function with n input
variables has 2n min terms , since each variable can
appear complemented or un-complemented.
Max term: It is a sum of literals, in which each input
variable appears exactly once. A function with n variables
has 2n max terms, because each variable can appear
complemented or un-complemented.
© Oxford University Press 2013. All rights reserved.
7
Introduction to Boolean Algebra




Boolean algebra deals with logic variables, which
may either be 1, that is TRUE or 0, that is FALSE.
It uses logic variables and logic operations to
develop, manipulate, and simplify logic
expressions, following set rules.
Boolean algebra, introduced by George Boole in
1854, differs significantly from conventional
algebra.
The rules of Boolean algebra are simple and
straightforward, and can be applied to any logical
expression.
© Oxford University Press 2013. All rights reserved.
8
Boolean Algebra

The rules of Boolean algebra that define three basic logic
operations and some combinations of these, sometimes called
axioms, are:
9
© Oxford University Press 2013. All rights reserved.
Theorems

From the previous axioms , we can derive the
following theorems.
© Oxford University Press 2013. All rights reserved.
10
Duality


Any algebraic equality derived from the axioms of
Boolean algebra remains true when the operators
OR and AND are interchanged and the identity
elements 0 and 1 are interchanged.
This property is called duality. For example,
◦ x+1=1
◦ x . 0 = 0 (dual)


Because of the duality principle, for any given
theorem its dual may be easily obtained.
The two De Morgan’s theorem are dual of each
other.
© Oxford University Press 2013. All rights reserved.
11
Duality
© Oxford University Press 2013. All rights reserved.
12
Boolean Expression

A Boolean or logic expression is a logic variable
or a number of logic variables involved with one
another through the logical operations ‘.’, ‘+’, and
‘–’. For logic variables A and B, the following are
some examples of Boolean expressions:

13
© Oxford University Press 2013. All rights reserved.
Example
14
© Oxford University Press 2013. All rights reserved.
Boolean Function & Truth Tables

A Boolean function of one or more logic variables, also
known as Boolean variable, is a binary variable, the value
of which depends on the values of these logic variables.
For example, independent Boolean variables A and B may
have arbitrarily chosen values while the Boolean function f
(A,B) has values that depend on the values of A and B,
hence:

The truth table for this function is shown in the Table :

15
© Oxford University Press 2013. All rights reserved.
Constructing Truth Tables from
Boolean Expressions

A Boolean function can be built from the value of a given truth table.
Considering previous Table, the value of f(A,B) is 1 when
◦
◦ The above conditions may also be written as
◦ These conditions may further be rewritten as the following logical products:
◦
◦ Terms: A combination of logic variables forming a group in a Boolean
function is called a term.
◦ Literals: Each complemented or uncomplemented variable in a term is
called a literal.
© Oxford University Press 2013. All rights reserved.
16
Canonical & Standard Form

In a Boolean function, if all terms are written as AND
combinations of the Boolean variables, there are 2n such AND
‘terms’ for n variables.
◦ These AND terms are called min terms.
◦ Min terms are designated as m0, m1, ... mn, etc., where the subscripts
represent the decimal values obtained from the equivalent binary value
of the combined variables.
© Oxford University Press 2013. All rights reserved.
17
Numerical Representation : Boolean
Function in Canonical Form

A Boolean function, with the canonical sum of product terms, can
be expressed in a compact form by listing the decimal value
corresponding to the min term for which the function value is 1.
◦ As an example, the truth table of a three-variable function is shown
below. Three variables, each of which can take the values 0 or 1, yield
eight possible combinations of values for which the function may be
true.
18
© Oxford University Press 2013. All rights reserved.
Logic Gates

The Boolean functions or expressions can be realized by
using electronic gates.
◦ It must be understood that the logic `1 ` and logic `0’, which
are fed as input to the gates, are represented by two distinct
voltage levels.
◦ Even the output, which is either logic `1’ or `0’, is represented
by distinct voltage levels.
◦ There are three fundamental logical operations from which all
other Boolean functions, no matter how complex, can be
derived.
◦ These operations are implemented by three basic gates: AND,
OR, and NOT.
◦ Four other gates NAND, NOR, XOR, and XNOR, which are
derived gates, are also used to construct logic functions.
© Oxford University Press 2013. All rights reserved.
19
AND Gate
The AND gate is an electronic circuit that has two or more inputs
and only one output.
 It gives a HIGH output (1) only if all its inputs are HIGH. If A and
B are logic inputs to a two input AND gate, then output Y is equal
to A . B.
 The dot (.) indicates an AND operation . The AND gate is also
called an all or nothing gate.
 The truth table for the AND gate is given in Table :

© Oxford University Press 2013. All rights reserved.
20
AND Gate

This dot is usually omitted, as shown in the
output in Fig.
21
© Oxford University Press 2013. All rights reserved.
OR Gate




The OR gate is an electronic circuit that has two or more
inputs and only one output.
It gives a HIGH output if one or more of its inputs are
HIGH. For a two-input OR gate, where A and B are the logic
inputs, the output Y is equal to A + B.
A plus (+) indicates an OR operation.
The truth table for a two input OR gate is given in Table:
22
© Oxford University Press 2013. All rights reserved.
Two Input OR Gate
© Oxford University Press 2013. All rights reserved.
23
NOT gate or INVERTER
The inverter is a little different from AND and OR
gates as it has only one input and one output.
Whatever logic state is applied to the input, the
opposite state will appear at the output.
 The NOT function is denoted by a horizontal bar over
the value to be inverted, as shown in the Fig.
 In some cases, a prime symbol (`) may also be used
for this purpose: 0` is 1 and 1` is 0.

24
© Oxford University Press 2013. All rights reserved.
NOT gate or INVERTER

In the inverter symbol shown in Fig.
25
© Oxford University Press 2013. All rights reserved.
NAND Gate

The NAND gate implements the NAND function, which means
NOT-AND.
◦ The inputs are AND & then NOT to get a single output.
◦ The output of NAND gate is HIGH if any or all of the inputs are
LOW.
◦ When all inputs are HIGH, the output is LOW. Below table
depicts the truth table for a two-input NAND gate.
26
© Oxford University Press 2013. All rights reserved.
NAND Gate

In Fig. , the circle at the output of the NAND gate
denotes the logical inversion, just as it did at the
output of the inverter.
27
© Oxford University Press 2013. All rights reserved.
NOR Gate

The NOR gate is an OR gate with inverted output.
◦ Whereas the OR gate allows the output to be HIGH (logic 1) if any one or more of its
inputs are HIGH, the NOR gate inverts this and forces the output to logic 0 when any
input is HIGH, i.e., the output of a NOR gate is LOW if any of the inputs are HIGH.
◦ The output is HIGH when all inputs are LOW.
◦ The NOR function uses the plus sign (+) operator with the output represented by an
expression with an over bar to indicate the OR inversion.
◦ The truth table of a two-input NOR gate is given in Table.
28
© Oxford University Press 2013. All rights reserved.
NOR Gate

The NOR function can also be performed by a
bubbled AND gate, as depicted in Fig.
© Oxford University Press 2013. All rights reserved.
29
XOR Gate

The Exclusive-OR or XOR gate is a two-input
circuit that will give a HIGH output if either, but
not both, of the inputs are HIGH.

The truth table of XOR gate is given in Table.
© Oxford University Press 2013. All rights reserved.
30
XOR Gate

An encircled plus
operation.
sign is used to show the XOR
© Oxford University Press 2013. All rights reserved.
31
XNOR Gate

The Exclusive-NOR gate is a XOR gate followed by a NOT gate.
XNOR gate is a two-input and one-output logic gate circuit.

In the gate, the output is HIGH if both inputs are either LOW or
HIGH. The logic symbol for a XNOR is shown in Fig.
32
© Oxford University Press 2013. All rights reserved.
Describing Logic Circuits
Algebraically
Any logic circuit, no matter how complex, may be
completely described using the Boolean operations
because the OR, AND, and NOT gates are the basic
building blocks of digital systems.
 The algebraic expression that relates the logic output
of a logic circuit with the binary inputs of the logic
circuit, is called a Boolean expression.

© Oxford University Press 2013. All rights reserved.
33
Describing Logic Circuits
Algebraically



If an expression contains both AND & OR operations, the
AND operations are performed first.
For example, in Y = AB + C, AB is performed first, unless
there are parentheses in the expression, in which case the
operation inside the parentheses is performed first.
That is, in Y = (A + B) + C, A + B is performed first.
34
© Oxford University Press 2013. All rights reserved.
Realization of Logic Circuits from
Boolean Expression



If the operation of a circuit is defined by a Boolean expression,
a logic-circuit diagram can be developed directly from the
expression.
Suppose a circuit has to be constructed whose output is
Y = AC + B`C + A`BC.
This implies that a three-input OR gate is required with inputs
that are equal to AC, B`C and A`BC respectively.
35
© Oxford University Press 2013. All rights reserved.
Universality : NAND & NOR Gates

NAND and NOR are called universal gates since the AND, OR, and
NOT gates can be constructed with either of them.
◦ It is possible to implement any logic expression using only NAND gates.
◦ This is because NAND gates, in the proper combination, can be used to
perform each of the Boolean operations OR, AND, and NOT.
◦ Figure shows how NAND gates are used to implement AND, OR, and
NOT operations.
36
© Oxford University Press 2013. All rights reserved.
Universality : NAND & NOR Gates

Similarly, Fig. depicts how NOR gates are used to
implement AND, OR, and NOT operations.
© Oxford University Press 2013. All rights reserved.
37