Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controllers Devices in Detail 4
4-43
The reason this is not -7797 is because a ne
g
ative value is calculated usin
g
two’s
compliment (described later) but can quickl
y
be calculated in the followin
g
manner:
Because this is a ne
g
ative number, a base is set as -32768. This is the smallest number
available with 16bit data. To this the positive sum of the active bits is added, i.e. -32768 +
7797.
The correct answer is therefore -24971.
Remember this is now a decimal representation of the ori
g
inal 16 bit - bit pattern. If the
ori
g
inal pattern was re-assessed as a hexadecimal number the answer would be
different.
b) A hexadecimal view
Takin
g
the same ori
g
inal bit pattern used in point a) and now addin
g
a hexadecimal
notation instead of the binar
y
(base 2) notation the bit patterns new meanin
g
becomes:
Hexadecimal value = ((1 x 8) + (1 x 1)), ((1 x 8) + (1 x 4) + (1 x 2)),
((1 x 4) + (1 x 2) + (1 x 1)), ((1 x 4) + (1 x 1))
Hexadecimal value = 9E75
Two thin
g
s become immediatel
y
obvious after a hexadecimal conversion. The first is that
there is si
g
n bit as hexadecimal numbers are alwa
y
s positive.
The second is there is an "E" appearin
g
in the calculated data. This is actuall
y
acceptable as hexadecimal counts from 0 to 15. But as there are onl
y
ten di
g
its (0 to 9),
substitutes need to be found for the remainin
g
base 16 numbers, i.e. 10, 11, 12, 13, 14
and 15. The first six characters from the alphabet are used as the replacement indices,
e.
g
. A to F respectivel
y
.
As a result of base 16 countin
g
, 4 binar
y
bits are required to represent one base 16 or
hexadecimal number. Hence, a 16 bit data word will have a 4 di
g
it hexadecimal code.
There is actuall
y
a forth interpretation for this bit sequence. This is a BCD or Binar
y
Coded Decimal readin
g
. The followin
g
section converts the ori
g
inal bit pattern into a
BCD format.