Information Technology Reference
In-Depth Information
& CHAPTER 4
Computer Arithmetic
This chapter is dedicated to a discussion on computer arithmetic. Our goal is to
introduce the reader to the fundamental issues related to the arithmetic operations
and circuits used to support computation in computers. Our coverage starts with
an introduction to number systems. In particular, we introduce issues such as
number representations and base conversion. This is followed by a discussion on
integer arithmetic. In this regard, we introduce a number of algorithms together
with hardware schemes that are used in performing integer addition, subtraction,
multiplication, and division. We end this chapter with a discussion on floating-
point arithmetic. In particular, we introduce issues such as floating-point represen-
tation, floating-point operations, and floating-point hardware schemes. The IEEE
floating-point standard is the last topic discussed in the chapter.
4.1. NUMBER SYSTEMS
A number system uses a specific radix (base). Radices that are power of 2 are widely
used in digital systems. These radices include binary (base 2), quaternary (base 4),
octagonal (base 8), and hexagonal (base 16). The base 2 binary system is dominant in
computer systems.
An unsigned integer number A can be represented using n digits in base b:
A ¼
(a n 1 a n 2 ... a 2 a 1 a 0 ) b . In this representation (called positional representation)
each digit a i is given by 0
a i
(b
1). Using positional representation, the dec-
imal value of the unsigned integer number A is given by A ¼ P n 1
i ¼ 0 a i b i . Con-
sider, for example, the positional representation of the decimal number A ¼
106.
Using 8 digits in base 2, A is represented as A ¼ 0 2 7
þ 1 2 6
þ 1 2 5
þ
2 4
2 3
2 2
2 1
2 0 .
0
þ
1
þ
0
þ
1
þ
0
Using
n
digits,
the largest value for an unsigned number A is given by
A max ¼ b n
1. For example, the largest unsigned number that can be obtained
using 4 digits in base 2 is 2 4
15. In this case, decimal numbers ranging
from 0 to 15 (corresponding to binary 0000 to 1111) can be represented. Similarly,
the largest unsigned number that can be obtained using 4 digits in base 4 is
1
¼
Search WWH ::




Custom Search