Download Print this page

IBM 2030 Manual Of Instruction page 27

Processing unit, field engineering

Advertisement

PACKED DECIMAL
The packed decimal coding system allows
two decimal digits to be stored in one
byte-location:
Example:
Binary
Position
8421
8421
Binary
Value
1001
0011
Decimal
Equivalent
9
3
HEXADECIMAL
The hexadecimal system uses the decimal
value of sixteen as its base.
16
3
4096
16
1
16
16
0
1
In the hexadecimal system you can
count to fifteen before a carry occurs.
14
+ 1
15
a
+0
1
15
+ 1
o
To express the values ten to fifteen,
the symbols A-F are used.
Thus, the
sixteen hexadecimal symbols are:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
The following charts lists some sample
decimal to binary to hexadecimal conver-
sion.
Decimal
Binary
Hexadecimal
1
0001
1
5
0101
5
9
1001
9
10
1010
A
11
1011
B
12
1100
C
13
1101
D
14
1110
E
15
1111
F
16
0001
0000
10
17
0001
0001
11
18
0001
0010
12
19
0001
0011
13
20
0001
0100
14
30
0001
1110
lE
40
0010
1000
28
50
0011
0010
32
60
0011
1100
3C
Examples:
Express the hexadecimal (hex) numbers as
a sum of terms in decimal.
hex:
482=4x16
2
+8x16
1
+2x16°
=4x256+8x16+2x1
=
1024+128+2
=
1154 decimal
hex:
8C6=8x16
2
+12x16
1
+6x16°
=8x256+12x16+6xl
=2048 +192
+6
=
2246 decimal
Rules for Converting from Decimal to
Hexadecimal
1.
Divide decimal numl:er by the new
base (16).
2.
Remainder becomes low order of new
number.
3.
Divide quotient by the new base
(16) •
4.
Remainder becomes next digit of new
number.
5.
Repeat steps 3 and 4 until a quo-
tient of zero is obtained.
Example: Decimal 456 to
hexadecimal
lC8
lC8
t t t
III
I ) I
a
III
r--
II
J
1611
Remainder of 1------------JI
I
II
r---
II
16)28
Remainder of 12 or C-------J
I
I
r----
I
161456
Remainder of 8--------------J
Binary - Hexadecimal Conversion
The base of the binary system is
21
while the hexadecimal system uses a base
of
2~
(16).
There is a direct 4 to 1
relationship
(2~
to
21)
between the
exponents of the two bases.
EVery hexa-
decimal digit becomes four binary
digits.
Every four binary digits in
turn can be converted to a single hexa-
decimal digit.
1-23

Advertisement

loading

This manual is also suitable for:

System/360 30