BINARY LOGIC
Binary logic deals with variables
that take on two discrete values and with operations that assume logical
meaning. The two values the variables assume may be called by different names (true
and false, yes and no, etc.), but for our purpose, it is convenient to think in
terms of bits and assign the values 1 and 0. The binary logic introduced in
this section is equivalent to an algebra called Boolean algebra. The formal
presentation of Boolean algebra is covered in more detail in Chapter 2 . The
purpose of this section is to introduce Boolean algebra in a heuristic manner
and relate it to digital logic circuits and binary signals.
Definition of Binary Logic
Binary logic consists of binary
variables and a set of logical operations. The variables are designated by
letters of the alphabet, such as A, B, C, x, y, z, etc., with each variable
having two and only two distinct possible values: 1 and 0. There are three
basic logical operations: AND, OR, and NOT. Each operation produces a binary
result, denoted by z.
AND: This operation is represented
by a dot or by the absence of an operator. For example, x . y = z or xy = z is
read “x AND y is equal to z.” The logical operation AND is interpreted to mean
that z = 1 if and only if x = 1 and y = 1; otherwise z = 0. (Remember that x, y,
and z are binary variables and can be equal either to 1 or 0, and nothing
else.) The result of the operation x . y is z.
OR: This operation is represented by
a plus sign. For example, x + y = z is read “x OR y is equal to z,” meaning
that z = 1 if x = 1 or if y = 1 or if both x = 1 and y = 1. If both x = 0 and y
= 0, then z = 0.
NOT: This operation is represented
by a prime (sometimes by an overbar). For example, x_ = z (or x = z ) is read “not
x is equal to z,” meaning that z is what x is not. In other words, if x = 1,
then z = 0, but if x = 0, then z = 1. The NOT operation is also referred to as
the complement operation, since it changes a 1 to 0 and a 0 to 1, i.e., the
result of complementing 1 is 0, and vice versa.
Binary logic resembles binary
arithmetic, and the operations AND and OR havesimilarities to multiplication
and addition, respectively. In fact, the symbols used for .
Truth Tables of Logical Operations :
AND and OR are the same as those
used for multiplication and addition. However, binary logic should not be
confused with binary arithmetic. One should realize that an arithmetic variable
designates a number that may consist of many digits. A logic variable is always
either 1 or 0. For example, in binary arithmetic, we have 1 + 1 = 10 (read “one
plus one is equal to 2”), whereas in binary logic, we have 1 + 1 = 1 (read “one
OR one is equal to one”).
For
each combination of the values of x and y, there is a value of z specified by
the definition of the logical operation. Definitions of logical operations may
be listed in a compact form called truth tables. A truth table is a table of
all possible combinations of the variables, showing the relation between the
values that the variables may take and the result of the operation. The truth
tables for the operations AND and OR with variables x and y are obtained by
listing all possible values that the variables may have when combined in pairs.
For each combination, the result of the operation is then listed in a separate
row. The truth tables for AND, OR, and NOT are given in Table 1.8 . These tables
clearly demonstrate the definition of the operations.
Comments
Post a Comment