hewlett-packard HP 9835A — 083

~~--------------------------------------------------------------------------------~~ 83 Chapter 5 Arithmetic Summary: Arithmetic operations are reviewed and the arithmetic utilities are discussed. Floating point and BCD arithmetic are explained. Numerical calculations are a large part of any computer's operations. Implemented within the 9835A/ B's processor are both integer and primitive Binary Coded Decimal (BCD) floating- point arithmetic operations. This chapter deals with those operations and is intended for those readers who may have no acquaintance with this topic, or perhaps only a passing one. The particular machine instructions involved with such arithmetic are reviewed.

Because the processor provides only rudimentary floating-point operations and because com- plete floating-point operations (e.g., subtract, divide) are not easy to write, utilities have been provided to perform these calculations. These utilities are discussed later in this chapter. If you to "Arithmetic Utilities". are not interested in doing your own BCD arithmetic, it is recommended you skip immediately Binary Coded Decimal (BCD) uses four-bit binary codes to represent decimal digits. Thus, the 12-digit mantissa of a full-precision number is represented by 48 bits. The BCD digits are as follows - DECIMAL BCD 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 ~ ~