Operating instructions
More Examples:
45 101101 354 101100010
-25
-
11001 -170
-
10101010
Difference:
20 10100 184 10111000
44 101100
-
34 -100010
Difference:
10 001010
A
second method of subtracting, called the
2's
cornplenlent method, is particularly good
to understand, for it
is
the way the computer
handles subtraction in its internal operation.
Subtraction
is
actually accomplished by form-
ing the complement of the subtrahend and
adding the complement to the minuend. In
binary, the
2's
complement of the subtrahend
is obtained by nlerely changing all zeros to
ones and ones to zeros, and then adding a one.
For
example, in a conlputer having a storage
capacity of six bit positions, subtraction would
be:
There
is
a
1
bit carried out of the high-
order end of the sum. This carry is lost in
computers not using a sign bit, because it
exceeds the storage capacity of the six bit
positions of the register, and would therefore
not affect the answer. Computers incorporat-
ing the sign bit position will use the carry
to form the correct sign of the result.
3.
Multiplication:
Multiplication
is
the same as it is in the
decimal
system except that the addition
portion of a problem must follow the binary
addition rules.
,
In the conlputer, multi-
plication
is
in binary and
is
merely repeated
adhtions.
Problem: Multiply
35
by
13.
Decimal Binary
Division:
Division by the computer is in binary, and
is
a series of repeated subtractions.
Problem: Divide
144
by
12
Decimal Binary
12 1100
121144 1100/ 10010000
12 1100
24
1100
24 1100
0
0000
B. Octal Arithmetic
There is really little need to perform
calculations in octal, and the computer does
not calculate in octal. Since it is difficult
to accustom oneself to handle octal
addition,
subtraction, multiplication, and division, it
is
recommended that for all but the simplest
problems, conversion be
made first to
decimal.
1.
Addition:
The following are examples of octal addition:
To add single-digit octal numbers having a
sum greater than
7
but not exceeding
17
8
8
'
the following rule applies: Add the digits as
decimal
&gits, then add
2
to get the digits of
the octal sum. For example:
Decimal Octal
11
(carry)
66
27
115
2.
Subtraction:
The following are examples of octal sub-
traction:










