Binary Subtraction - IBM 5410 Maintenance Manual

Processing unit
Hide thumbs Also See for 5410:
Table of Contents

Advertisement

Binary Subtraction
Figure 2-26 shows a decimal comparison between the con-
ventional method of subtraction and the type of sub-
traction used by the System/3. Under the conventional
method, whenever it is necessary to borrow from the next
position, the minuend is effectively increased by 10 in the
position where the subtraction is taking place and de-
creased by 1 in the position that is borrowed from. For
instance, when subtracting the 6 from the 4 in the units
positions, after borrowing from the tens position, the units
position of the minuend effectively becomes 14. Because
of the borrow, the tens position is reduced to 1. In this
example, another borrow is necessary, so after the borrow
the tens position of the minuend is effectively 11 and this
method continues to the end of the problem.
The same result is reached if, instead of reducing the min-
uend by 1 after borrowing, the subtrahend is increased by
1 with a carry (Figure 2-26). Thus, in the tens position
of the example shown, the carry method effectively sub-
tracts 5 from 12 instead of 4 from 11 as in the conventional
method.
Binary subtracting is done in the same way except for the
value of the borrows. Because decimal numbers have as-
cending powers of 10, a borrow has an effective value of
10. Similarly, since binary numbers have
as~ending
powers
of 2, a borrow has an effective value of 2. Figure 2-27
illustrates this by subtracting the hexadecimal value B/F
from E/B. After subtracting the first two positions, it be-
comes necessary to borrow in order to subtract the third
position. This borrow has an effective value of 2 and the
Minuend and
A
borrow
value~
2
11 14
12 14
23
24
23
24
B Reg
A Reg
Carry
ALU Total
Minuend and
A.
3 2
3 2
1 0
1 0 1 1
Minuend
~f
1 :
f
2 : f 2
1f 2 1 1 1
Subtrahend
_ _ _ _ _ __;_1 __________ Subtrahend
0 0 1 0
1 1 O
o
and carry
value
E/B minus B/F
Figure
2-27.
Binary Subtract
result of the subtraction is 1. Using the carry method of
subtraction, a carry to the fourth position gives the subtra-
hend an effective value of 2. This forces a borrow from
the next position which, when added to the minuend
gives it an effective value of 3. This method
continu~s
to the end of the problem.
The minuend enters the ALU from the B register and the
subtrahend enters from the A register
(Figur~
2-28). The
character is subtracted bit-by-bit, starting with bit 7 and
continuing through bit 0. Carries from bit to bit are in-
ternal but if there is a carry from bit 0 it is held in the carry
triggers until it is needed in bit 7 (Figure 2-28). Figure
2-29 illustrates the subtract function for a single bit position.
Minuend
Subtrahend
Total
2
4 6
2
1
t3
4ts~
Subtrahend
0
7 8
Carry
~ 1)
.
and carry
Conventional
(reduce minuend
by 1 with borrow)
Total
1
o
7
a
value
System 3
(increase subtrahend
by 1 with carry)
Figure 2-26. Subtraction-Borrow Compared to Carry
2-26

Advertisement

Table of Contents
loading

Table of Contents