4
Computer Arithmetic
This chapter introduces various algorithms and techniques to perform some basic arith-
metic operations related to a computer. After completion of this chapter, the reader would
know about
R Techniques of unsigned and signed integer representation.
R Methods used for addition and subtraction using signed integers.
R Procedure for signed multiplication and division.
R Floating-point arithmetic operation.
C HAPTER OBJECTIVES
4.1 INTRODUCTION
Most of the programs, in one form or other, carry out some arithmetic operations. In cases like addition
of two unsigned integers, these operations may be performed by the hardware circuit, as shown in the
case of full-adders in Chapter 3 (Section 3.5). However, apart from addition, computers perform sub-
traction, multiplication and division, which offer the basic and minimum arithmetic operations. Some-
times these operations are implemented by hardware circuits and in other cases through software, using
different algorithms.
As in most of the cases these operations are performed at the processor-level binary representation
is used for data handling. On the other hand, high level languages use decimal number system for data
representation and their processing. In Appendix A, we have described how any one number system
may be converted to another, considering four types of number systems, namely: binary, decimal, octal-
and hexa-decimal. Octal systems are rarely used and hexa-decimal system is mostly used in assembly
language programming. Therefore, the two number systems that we need to be familiar with are decimal
and binary to understand how these arithmetic operations are carried out at the processor-level. In this
chapter, we shall investigate how these basic arithmetic operations are implemented by a processor. We
shall also see how the common decimal numbers are represented within a computer.
M04_GHOS1557_01_SE_C04.indd 58M04_GHOS1557_01_SE_C04.indd 58 4/29/11 5:03 PM4/29/11 5:03 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.129.253