Title: Boolean Algebra and Logic Gates
1Boolean Algebra and Logic Gates
2The variables used in Boolean algebra have a
unique characteristic. They may assume only one
of two possible values, usually represented by
the symbols 1 or 0 ( or T and F )
If an equation describing logical circuitry has
several variables, it is still understood that
each of the variables can assume only the value 1
or 0.
3How to count in binary
Counting from 00 to 11
00
01
10
11
4Counting from 000 to 111
000 001 010 011
100 101 110 111
5If we define a symbol, the symbol, or ?, called
logical addition and OR operation, we have a
binary operation.
When or ? is placed between two variables, say
x and y, since x, y can only take values 0, 1 we
can define or v by listing all possible
combinations of x and y and the resulting values
of x y or x ? y
6- The possible input and output combinations may be
arranged as follows
7- Also written as
- This is the logical addition table also called
the logical OR table
- 0 v 0 0
- 0 v 1 1
- 1 v 0 1
- 1 v 1 1
8Another important operation in Boolean algebra is
logical multiplication or logical AND operation.
We use the symbol . or ?. The rules for this
operation can be given by simply listing all the
values that might occur
9- This can be written
- 0.0 0
- 0.1 0
- 1.0 0
- 1.1 1
- Or
- 0?0 0
- 0?1 0
- 1?0 0
- 1?1 1
10Both of these operators and . or ? and ? obey
the mathematical rule called the associative law
i.e. ( x y ) z x ( y z ) or ( x ? y )
? z x ? ( y ? z ) and ( x.y ).z x.( y.z )
or ( x ? y ) ? z x ? ( y ? z )
11When we mix logical addition and multiplication
we have to be careful Does a.b c mean (a.b) c
or a.( b c )? Rule Do . or ? before or ?
12Simple Gates There are 3, 5 or 7 simple gates
that you need to learn about, depending on how
you want to count them (you will see why in a
moment). With these simple gates you can build
combinations that will implement any digital
component you can imagine.
13The simplest possible gate is called an
"inverter", or a NOT gate. It takes 1 bit as
input and produces as output its opposite. The
table below shows a logic table for the NOT gate
and the normal symbol for it in circuit diagrams
14NOT Gate
A Q 0 1 1 0
15You can see in this figure that the NOT gate has
one input called A and one output called Q (Q is
used because if you used O (for Output) you would
easily confuse it with zero). The table shows how
the gate behaves. When you apply a 0 to A, Q
produces a 1. When you apply a 1 to A, Q produces
a 0. Nothing could be simpler.
16The AND gate performs a logical AND operation on
two inputs, A and B
The idea behind an AND gate is, "If A AND B are
both 1, then Q should be 1." You can see that
behavior in the logic table for the gate. You
read this table row by row, like this
17AND Gate
- A B Q
- 0 0 0
- 0 1 0
- 1 0 0
- 1 1 1
18A B Q Output 0 0 0 If A is 0 AND B is 0, Q is
0 0 1 0 If A is 0 AND B is 1, Q is 0 1 0 0 If A
is 1 AND B is 0, Q is 0 1 1 1 If A is 1 AND B is
1, Q is 1
19The next gate is an OR gate. It's basic idea is,
"If A is 1 OR B is 1 (or both), then Q is 1."
20OR Gate
- A B Q
- 0 0 0
- 0 1 1
- 1 0 1
- 1 1 1
21Those are the 3 basic gates (that's one way to
count them). It is quite common to recognize two
others as well the NAND and the NOR gate. These
two gates are simply combinations of an AND or an
OR gate with a NOT gate.
If you include these two gates, then the count
rises to 5. Here's the basic operation of NAND
and NOR gates - you can see they are simply
inversions of AND and OR gates
22NOR Gate
- A B Q
- 0 0 1
- 0 1 0
- 1 0 0
- 1 1 0
23NAND Gate
- A B Q
- 0 0 1
- 0 1 1
- 1 0 1
- 1 1 0
24The final two gates that are sometimes added to
the list are the XOR and XNOR gates, also known
as "Exclusive Or" and "Exclusive Nor" gates. Here
are their tables
25XOR Gate
- A B Q
- 0 0 0
- 0 1 1
- 1 0 1
- 1 1 0
26XNOR Gate
- A B Q
- 0 0 1
- 0 1 0
- 1 0 0
- 1 1 1
27The idea behind an XOR gate is, "If either A or B
is 1 but not both, Q is 1." The reason why XOR
might not be included in a list of gates is
because you can implement it easily using the
original 3 gates listed. Here is one
implementation
28(No Transcript)
29If you try all four different patterns for A and
B and trace them through the circuit, you will
find that Q behaves like an XOR gate. Since there
is a well-understood symbol for XOR gates, it is
generally easier to think of XOR as a "standard
gate" and use it in the same way as AND and OR in
circuit diagrams.
30Example of an OR Gate with three inputs
A B C QABC 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 1 1 1 1 1
31Example of an AND Gate with three inputs
A B C Q ( A.B.C) 0 0 0 0 0 0 1 0 0 1 0 0 0 1
1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1
32Construct a truth table for xy.-z
33Construct a truth table for xy.(-x-y)
34Prepare a truth table for the following boolean
expressions
35Prove the following rules using proof by perfect
induction
Note Parts (a) and (b) are called DeMorgans
theorems