Logic Reference Guide: Advanced Micro Devices
Logic Reference Guide: Advanced Micro Devices
Logic Reference Guide: Advanced Micro Devices
Advanced
Micro
Devices
Conversion Between Canonical Forms One can convert back and forth between these repre-
sentations by using the rules shown in Table 6.
It is a simple matter to convert between canonical forms.
Given a truth table for a function F, there are four differ-
ent representations that can be used:
Sum-of-minterms form of F
Product-of-maxterms form of F
Sum-of-minterms form of /F
Product-of-maxterms form of /F
Minterm/
Maxterm
A B C D X Y Number
0 0 0 0 1 1 0
0 0 0 1 0 1 1
0 0 1 0 1 1 2
0 0 1 1 1 1 3
0 1 0 0 0 1 4
0 1 0 1 1 0 5
0 1 1 0 0 0 6
0 1 1 1 1 1 7
1 0 0 0 1 1 8
1 0 0 1 1 1 9
1 0 1 0 0 0 10
. . . . . . .
. . . . . . .
. . . . . . .
1 1 1 1 0 0 15
a. Truth Table
X = m0+m2+m3+m5+m7+m8+m9 X = M1*M4*M6*M10*M11*M12*M13*M14*M15
= ∑m (0,2,3,5,7,8,9) ΠM (1,4,6,10,11,12,13,14,15)
= /A * /B * /C * /D ;m0 =(A+B+C+/D) ;M1
+ /A * /B * C * /D ;m2 *(A+/B+C+D) ;M4
+ /A */B* C * D;m3 *(A+/B+/C+D) ;M6
+ /A * B * /C * D ;m5 *(/A+B+/C+D) ;M10
+ /A * B * C * D ;m7 *(/A+B+/C+/D) ;M11
+ A * /B * /C * /D ;m8 *(/A+/B+C+D) ;M12
+ A */B* /C * D;m9 *(/A+/B+C+/D) ;M13
*(/A+/B+/C+D) ;M14
Y = m0+m1+m2+m3+m4+m7+m8+m9 *(/A+/B+/C+/D) ;M15
= ∑m (0,1,2,3,4,7,8,9)
Y = M5*M6*M10*M11*M12*M13*M14*M15
= /A * /B * /C * /D ;m0 = ΠM (5,6,10,11,12,13,14,15)
+ /A */B* /C * D;m1
+ /A */B* C * /D;m2 =(A+/B+C+/D) ;M5
+ /A */B* C * D;m3 *(A+/B+/C+D) ;M6
+ /A * B * /C * /D ;m4 *(/A+B+/C+D) ;M10
+ /A * B * C * D ;m7 *(/A+B+/C+/D) ;M11
+ A */B* /C * /D;m8 *(/A+/B+C+D) ;M12
+ A */B* /C * D;m9 *(/A+/B+C+/D) ;M13
*(/A+/B+/C+D) ;M14
*(/A+/B+/C+/D) ;M15
Simplifying Logic There are four basic postulates, two of which are the
commutative and distributive laws which were dis-
Canonical forms are convenient in that it is easy to de-
cussed above. From these postulates, it is possible to
rive and convert them. However, the representation is
derive nine basic theorems. The postulates and theo-
bulky, since all variables must appear in each sum or
rems are listed in Table 7.
product. These expressions can be simplified by apply-
ing the basic laws and theorems of Boolean algebra.
Table 7. Postulates and Theorems of Boolean Algebra
Postulate 1 (A) X + FALSE = X
(B) X*TRUE = X
Postulate 2 (A) X + /X = TRUE
(B) X * /X = FALSE
Postulate 3 (A) X + Y = Y + X
(B) X*Y = Y*X
Postulate 4 (A) X * (Y + Z) = (X*Y) + (X*Z)
(B) X + (Y*Z) = (X + Y) * (X + X)
Theorem 1 (A) X + X = X
(B) X * X = X
Theorem 2 (A) X + TRUE = FALSE
(B) X*FALSE = FALSE
Theorem 3 / (/X) = X
Theorem 4 (A) X + (Y + Z) = (X + Y) + Z
(B) X * (Y*Z) = (X*Y) * Z
Theorem 5 (A) / (X + Y) = /X * /Y
(B) / (X * Y) = /X + /Y
Theorem 6 (A) X + (X * Y) = X
(B) X * (X + Y) = X
Theorem 7 (A) (X*Y) + (X*/Y) = X
(B) (X + Y) * (X + /Y) = X
Theorem 8 (A) X + (/X*Y) = X + Y
(B) X * (/X + Y) X*Y
Theorem 9 (A) (X*Y) + (/X*Z) + (Y*Z) = (X*Y) + (/X*Z)
(B) (X + Y) * (/X + Z) * (Y + Z) = (X + Y)*(/X + Z)
Notice that each theorem and postulate (with the excep- As the logic expression is simplified, it no longer con-
tion of theorem 3) has two forms. This is a result of the tains minterms (or maxterms), since some of the
duality principle; once one form of a theorem is estab- minterms and literals are being eliminated. What was a
lished, the dual representation follows immediately. sum-of-minterms (product of maxterms) representation
Theorem 3 has no dual because it does not involve any is now simplified to a sum-of-products (product of
of the elements that have duals (+, *, 1, or 0). sums).
Karnaugh Maps: Minimizing Logic In this manner, two product terms are combined into
one. This procedure can conceptually be repeated to al-
Simplifying by hand by using algebraic manipulation can low groupings of two, four, eight, or any group of
be a tedious and error-prone procedure. When only a adjacent cells whose size is a power of two. A cell may
few variables are used (generally less than 5 or 6), appear in more than one group. Just enough groups are
Karnaugh maps (also called K-maps) provide a simpler found to include all of the 1’s. The groups should be as
graphical means of simplifying logic. K-maps not only al- large as possible.
low for logic simplification, but for logic minimization,
where an expression has a minimal number of product This process provides a minimal sum of products. The
terms (or sum terms) and literals. product-of-sums form can be obtained by grouping 0’s
instead of 1’s and inverting the header for each cell.
A Karnaugh map consists of a box which has one cell for
each minterm. These cells are arranged so that only one The two functions from Figure 3 have been placed into
literal is inverted when moving from one cell to an adja- K-maps in Figure 5. The groups are then used as indi-
cent cell. The headings placed by each row and column vidual product terms. When reading the product terms
indicate the polarities of the literals for that row or col- from the map, the only literals which will appear in the
umn. The literals themselves are indicated in the top left product term are the ones whose values are constant for
corner of the map. An example of a Karnaugh map for each cell in the group. If that value is 1, then the non-
three variables is shown in Figure 4. inverted form of the literal is used. If the value is 0, then
the inverted form of the literal is used.
For active-LOW functions, the same procedure is used,
except that the 0’s are grouped instead of the 1’s. The
active-LOW version of the functions from Figure 3 are
derived in Figure 6.
Hand simplification and minimization is not needed as
frequently today as in the past, since software is now
available for handling these logic manipulations. Most
software can perform logic simplification and minimiza-
tion automatically.
A A*/C*/D A /C*/D
C B C B
D 00 01 11 10 D 00 01 11 10
00 1 0 1 1 B*/C*D 00 1 1 1 1 A*B*/C
0 1 1 0 01 1 0 1 0
01 /A*/B*/C
11 0 0 0 0 11 0 0 0 0
10 1 1 0 0 10 1 1 0 0
X Y
X = /A*/B*/D Y = /A*/D
+ A*/C*/D + /C*/D
+ B*/C*D + /A*/B*/C
+ /A*C*/D + A*B*/C
90000A-4
A A*B*/C*/D A /A*B*D
C B C B
D 00 01 11 10 D 00 01 11 10
/B*D 1 0 1 1 1 1 1 1
00 00
A*/B*D
0 1 1 0 01 1 0 1 0
01
C*D C*D
11 0 0 0 0 11 0 0 0 0 A*C
10 1 1 0 0 10 1 1 0 0
A*C
X Y
/X = C*D /Y = C*D
+ /B*D + A*D
+ A*C + /A*B*D
+ /A*B*/C*/D + A*/B*D 90000A-5
When deriving equations from a Karnaugh map, XOR The XOR gate can be used as an “UNLESS” operator. In
and XNOR functions can usually be identified by their other words, the function, A = X :+: Y can be
characteristic pattern. Exactly what the operands are interpreted as:
may or may not be obvious for more complicated func-
tions. Some examples are shown in Figure 8. “A will have the same value as X UNLESS Y is true.”
This can be helpful when trying to derive a logic equation
for a function which can be described in words.
00 1 0 1 0 00 0 0 0 1
1 0 1 0 01 1 0 1 0
01
11 0 1 0 1 11 1 0 1 0
10 0 1 0 1 10 0 0 0 1
J K
J = /P*/Q*/R K = /P*/Q*S
+ P*Q*/R + P*Q*S
+ /P*Q*R + P*/Q*/S
+ P*/Q*R = ((/P*/Q) + (P*Q))*S
= ((/P*/Q) + (P*Q))*/R + P*/Q*/S
+ ((/P*Q)+(P*/Q))*R
= (P:*:Q)*/R = (P:*:Q)*S
+ (P:+:Q)*R + P*/Q/*/S
= /(P:+:Q)*/R
+ (P:+:Q)*R
= (P:+:Q):*:R 90000A-7
Unclocked Flip-Flops—Latches
90000A-8 S-R Latches
An S-R latch can be built out of NOR gates as shown in
Figure 10, and behaves according to the truth table in
Figure 9. Basic Storage Element Table 9. ‘S’ stands for ‘set’ and ‘R’ stands for ‘reset,’ as
suggested by the truth table.
In general, there are two primary classes of flip-flops:
Note that the latch actually has two outputs, which are
Unclocked flip-flops, or latches complementary. These are referred to as Q and Q. If
Clocked flip-flops both S and R are raised at the same time, then both Q
and Q will be HlGH; although this is physically possible,
Clocked flip-flops are sometimes referred to as regis- it does not make sense if Q and Q are to be complemen-
ters, although technically speaking, a register is a bank tary signals. Thus, this condition is not allowed.
of several flip-flops with a common clock signal.
Q Q
S S
R 0 1 R 0 1 S Q
S Q S Q
00 0 1 00 0 1
C C
01 01 R Q
0 0 0 0 R R Q Q
90000A-12
11 X X 11 X X
90000A-13
Q Q
D D
G 0 1 G 0 1
D S Q Q
D Q 00 0 1 00 0 1
G C
01 0 0 01 0 0
R Q Q G Q
90000A-14 11 1 1 11 1 1
10 0 1 10 0 1
Figure 15. A D-Type (Transparent) Latch
90000A-18
δτ δτ
Expected
Levels
a. Falling Edge Race Conditions
δτ δτ
Expected
Levels
b. Rising Edge Race Conditions
11 1 0 11 1 0
Figure 22. A T-Type Latch
10 1 1 10 1 1
Table 14. The Truth Table for a T-Type Latch
T Q+
Q+ /Q+ 0 Q
a. Q+ = J*/Q + /K*Q b. /Q+ = /J*/Q + K*Q 1 /Q
90000A-20
This Latch also has the problem that if T is left HIGH for
too long, the output will oscillate. However, since there is
Figure 21. Karnaugh Maps for a J-K Latch only one input, the race condition problems of the J-K
latch have been eliminated. Unfortunately, this comes at
T-Type Latches the cost of initialization. There is now no way to get the
output into a fixed state without knowing what the
T-type latches are formed by connecting the J and K in- previous state was. Thus, this device is not very useful
puts of a J-K latch together to form a single input, as without some kind of initialization circuit.
shown in Figure 22. This latch has two possible func-
tions: hold the present state or invert the output, as The general waveforms for a T-type latch are shown in
summarized in Table 14. ‘T’ stands for ‘trigger’ or Figure 23.
‘toggle’ depending on who you talk to. That is, when T is
HIGH, a change at the output is triggered; or, put an-
other way, raising T causes the output to toggle.
Clock
Qp
Qn
90000A-24
Figure 25. Behavior of a Clocked S-R Flip-Flop for Positive (Qp) and Negative
(Qn) Edge-Triggered S-R Flip-Flops
D Q
Clock Q
J J Q D Q Q J Q
K K Q Q Q K Q
Clock
Q D Q Q T Q
T T
Q Q Q Q
Clock
S S Q D Q Q S Q
R T Q Q Q R Q
Clock
Figure 26. Clocked Flip-Flops. All can be Emulated with a D-Type Flip-Flop
Binary Numbers decimal number 25 would be written 2510 if its base were
in doubt.
The concept of a number is taken for granted by most
people. And most people equate numbers in general A number can thus be expressed in terms of some base
with the decimal system, with which we are most famil- x as follows:
iar. However, there is nothing particularly special about
the decimal system; the choice of system is actually anxn+an-1xn-1+...+a1x1+a0x0+a–1x–1+...
rather arbitrary. History has chosen the decimal system +a–mX–m
for most humans. (1)
For electronic systems, the binary system is more ap- The numbers an...a–m are called digits. The value of
propriate. It makes possible arithmetic and logical each digit can range from 0 to x–1. Each digit is repre-
calculations that would be much more difficult—likely sented by a symbol, called a numeral. X numerals are
impractical—if implemented directly in a decimal sys- required to represent a number in base x. The most fa-
tem. Closely related to the binary system are the octal miliar numerals are the symbols ‘0,’ ‘1,’...‘9.’ There are
and hexadecimal systems, which will also be discussed ten of them, since they are used for the decimal system.
here. Arithmetic is normally performed using binary For binary numbers, only ‘0’ and ‘1’ are used; for octal
numbers in a computer. Octal and hexadecimal repre- numbers, the numerals ‘0’ through ‘7’ are used. Hexa-
sentations are generally used as a way to “abbreviate” decimal numbers are more difficult, since sixteen
what might otherwise be lengthy binary numbers. This numerals are required. Therefore, the numerals ‘0’
will be seen when conversion is discussed below. through ‘9’ are used to represent the quantities 010
through 910; the letters A through F are used to represent
There are several terms which must be defined before the quantities 1010 through 1510.
proceeding further. A number is an abstract entity
which is used to describe quantity. There are many The number expressed by equation 1 is normally repre-
ways of representing a number. Normally, the represen- sented as a string of digits:
tation is designed around a base. The number is
anan–1...a1a0.a–1...a–m
expressed as a sum of multiples of the powers of the
base. The decimal system is a base-10 system, mean- The digits representing negative powers of the base are
ing that 10 is used as the base. The binary system is separated from those representing non-negative pow-
base-2; the octal system is base-8; and the hexadecimal ers by a point. In the decimal system, this is referred to
system is base-16. The binary, octal, and hexadecimal as a decimal point; in the binary system, it is referred to
systems are closely related because 8 and 16 are both as a binary point.
powers of 2. When different bases are being used, a
number will often be followed by its base in subscript, to There are two basic classes of manipulation which will
indicate exactly what the base is. For example, the be discussed: conversions between bases and arithme-
tic within a base.
Subtract 7 from 7:
0111 7
+ 1000 + –7
1111 0 one of the
representations of 0