
42-10
REFERENCE DATA FOR ENGINEERS
computers use a total of
32
bits or more for the
mantissa, exponent, and sign fields.
Many computers use a “single precision” floating-
point format developed by the IEEE Standards Com-
mittee. This format uses a 24-bit mantissa and an 8-bit
exponent to represent signed numbers with absolute
values in the range of about 2-Iz7 to
2’12’
to
The IEEE standard also specifies a 64-bit
(‘‘double precision”) format and gives guidelines for
extended formats (e.g., 128-bit “quad precision” for-
mat).
Computer systems may use either of two methods to
provide floating-point operations. Some computers
have built-in hardware and instructions to process
floating-point numbers in a prescribed format. Others
have software programs that operate
on
floating-point
numbers using sequences of primitive arithmetic in-
structions. The hardware approach typically performs
operations
100
times faster than the software approach.
A computer that “supports” floating-point numbers
is one that provides a minimum set of floating-point
instructions including addition, subtraction, multiplica-
tion, division, and comparison of floating-point num-
bers, and conversion to and from integer fixed-point
format. Special algorithms are needed to perform these
instructions, including scaling or “normalization” of
operands and results, as well as arithmetic manipula-
tions of mantissas and exponents.
BCD
Representation
The
binary-coded decimal
(BCD)
number system
encodes the digits
0
through
9
by their 4-bit unsigned
binary representations,
0000
through 1001. The codes
1010
through
1
11
1
are not used. Conversions between
BCD and decimal representations are trivial, a direct
substitution of four bits for each decimal digit. Two
BCD digits may be packed into one byte; thus one byte
may represent the values from
0
to
99
as opposed to
0
to
255
for a normal unsigned 8-bit binary number. Binary-
coded decimal numbers with any desired number of
digits may be obtained by using a string of bytes, one
byte for each two digits.
Computers “support” BCD representation by pro-
viding instructions that perform arithmetic on packed-
BCD numbers. Some computers have a “decimal
adjust” instruction that corrects the result of an ordi-
nary 8-bit add instruction, assuming that the operands
were packed-BCD bytes. Others have decimal add,
subtract, multiply, and divide instructions that operate
directly on packed-BCD bytes, words,
or
arbitrary-
length strings of bytes.
Character Codes
A string of bits in a computer need not represent a
number;
in
fact most input and output
of
contemporary
computers is nonnumeric. The most common type
of
nonnumeric data is
text,
strings of characters from
some character set. Each character is represented in the
computer by a bit string according to an established
convention.
The most commonly used character code is ASCII,
the American Standard Code for Information Inter-
change. This code represents each of 128 different
characters by a 7-bit string, as shown in Table
3.
Thus,
the text string “Yeccch!” is represented by a rather
innocent looking list of seven 7-bit numbers:
1011001 1100101 1100011 1100011 1100011
1101o000100001
Some
of
the 7-bit strings in ASCII denote device
control functions instead of “printing” characters. For
example, CR (0001 101) returns the print head
or
cursor
on a printer or display toL the first column, and LF
(0001010) advances to the next line. Most of the other
control characters are intended for use by data commu-
nication links, but different computer systems may use
these characters for different functions.
Most computers manipulate
an
8-bit quantity as a
single unit, a byte, and store one character in each byte.
The disposition of the extra bit when 7-bit ASCII is
used depends on the system
or
program. Sometimes
this bit is set to a particular value, sometimes it is
ignored, and sometimes it is used to encode an addi-
tional 128 non-ASCII characters.
An important feature of ASCII is that the bit strings
for letters and digits form a reasonable numerical
sequence,
so
that text strings can be sorted by computer
instructions that compare numerical values.
BASIC COMPUTER
ORGANIZATION
A computer system consists of three major subsys-
tems: processor, memory, and input/output
(UO),
as
shown in Fig.
2.
Processors
The
processor
(or
central processing unit,
CPU)
is
the heart of the computer. Shown in Fig.
3,
a simple
processor contains control circuits for fetching and
executing instructions, an arithmetic logic unit
(ALU)
for manipulating data, and registers for storing proces-
sor status and a small amount of data. It
also
has
interface circuits for controlling and communicating
with the memory and
YO
subsystems.
Different processors have different organizations,
both in their internal implementations and
in
their
architectures as seen by programmers. Typical organi-
zations can be roughly classified as accumulator-based
processors, general-register processors, and stack ma-
chines. Recently,
a
number
of
new general-register
processor architectures have employed principles
of
reduced instruction-set computing
(RISC)
to
obtain
performance advantages over older processor architec-