Hardware Reference
In-Depth Information
side, first calculate ( b
c ), which is 100, and then add this amount to a , yielding
800. To compute the right-hand side, first calculate ( a
b ), which gives an over-
flow in the finite arithmetic of three-digit integers. The result may depend on the
machine being used but it will not be 1100. Subtracting 300 from some number
other than 1100 will not yield 800. The associative law does not hold. The order
of operations is important.
As another example, consider the distributive law:
a
+
c
Let us evaluate both sides for a
×
( b
c )
=
a
×
b
a
×
=
5, b
=
210, c
=
195. The left-hand side is
5
b overflows.
Judging from these examples, one might conclude that although computers are
general-purpose devices, their finite nature renders them especially unsuitable for
doing arithmetic. This conclusion is, of course, not true, but it does serve to illus-
trate the importance of understanding how computers work and what limitations
they have.
×
15, which yields 75. The right-hand side is not 75 because a
×
A.2 RADIX NUMBER SYSTEMS
An ordinary decimal number with which everyone is familiar consists of a
string of decimal digits and, possibly, a decimal point. The general form and its
usual interpretation are shown in Fig. A-1. The choice of 10 as the base for expo-
nentiation, called the radix , is made because we are using decimal, or base 10,
numbers. When dealing with computers, it is frequently convenient to use radices
other than 10. The most important radices are 2, 8, and 16. The number systems
based on these radices are called binary , octal , and hexadecimal , respectively.
100's
place
10's
place
1's
place
.1's
place
.01's
place
.001's
place
.
d n
d 2
d 1
d 0
d -1
d -2
d -3
d -k
n
Σ
Number =
d i ×10 i
i=-k
Figure A-1. The general form of a decimal number.
A radix k number system requires k different symbols to represent the digits 0
to k
1. Decimal numbers are built up from the 10 decimal digits
 
 
 
Search WWH ::




Custom Search