Algebraic Notation
Algebraic Notation
Writing AND , OR , NOT etc. is long-winded and tedious. We
generally use a more compact notation:
xy | means | x AND y |
x+y | means | x OR y |
[`x] | means | NOT x |
x Åy | means | x XOR y
|
The operations can be combined to form algebraic expressions
representing logic functions.
Examples:
is the majority voting function from the previous lecture.
means
means
and also
Multi-input Gates
The AND and OR operations can be generalized to take any number
of inputs. Algebraically, we simply write xyz for the three-input
AND of x, y and z. Similarly we write x+y+z for the
three-input OR of x, y and z. In circuit diagrams we use the
same symbols as before, but with additional input wires:
The definitions of multi-input AND and OR are the
obvious ones: AND is true if and only if all the inputs are
true; OR is true if and only if at least one of the inputs
is true.
Multi-input gates might be available as electronic components, if the
number of inputs is not too large. Otherwise, an n-input gate can
be synthesized from 2-input gates of the same type, e.g.
Multi-input NAND and NOR gates also exist.
Exercise How many 2-input AND gates are needed to synthesize an
n-input AND gate?
Algebraic Laws
The logical operations satisfy some algebraic laws, which can be used
to rewrite expressions. x, y and z stand for arbitrary expressions.
|
|
| (1) | |
|
| (2) | |
|
| (3) | |
|
| (4) | |
|
| (5) | |
|
| (6) | |
|
| (7) | |
|
| (8) | |
|
| (9) | |
|
| (10) | |
|
| (11) | |
|
| (12) | |
|
| (13) | |
|
| (14) |
|
These laws can be verified by thinking about the ordinary meanings of
AND , OR and NOT , or by truth tables.
The last two laws (technically, associativity of AND and
OR ) justify writing xyz and x+y+z for the 3-input versions of
the operators; it does not matter whether we interpret xyz as
x(yz) or as (xy)z.
Example
To verify that x(y + z) = xy + xz we construct the
truth tables for the left and right hand sides of the equation,
considering them both as functions of x, y and z. The columns
for x(y + z) and xy + xz are identical, indicating that the two
functions are equivalent.
Exercise In the same way, check that xy + x = x. Also try
to derive this equation algebraically, using the laws on the previous slide.
File translated from
TEX
by
TTH,
version 2.78.
On 27 Jul 2001, 10:19.