Format of real values, 5format of real values – INFICON PEG100-D Medium to Ultra-High Vacuum Gauge User Manual

Page 9

Advertising
background image

5

Format of real values

According to the IEEE-754 standard real values are stored in floating point format. The floating point values are trans-
mitted according to the following format:

Byte

2

3

4

5

–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Content

SEEE EEEE

EMMM MMMM

MMMM MMMM

MMMM MMMM

S means:

Sign Bit, which means 1 = negative, 0 = positive

E means:

Two-complement exponents with offset 127

M means: 23 bit mantissa. The most significant bit is always 1 and is, therefore, not stored.

Example:
The value -12.5

Byte number of

Byte 3:

Byte 2:

Byte 1:

Byte 0:

the floating

C1 hex

48 hex

00 hex

00 hex

point value

–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Content

SEEE EEEE

EMMM MMMM

MMMM MMMM

MMMM MMMM

Content in this
example

1100 0001

0100 1000

0000 0000

0000 0000

binary

binary

binary

binary

Sign bit:
The bit S in this example is 1. That means the sign bit of the whole value (or of the mantissa) is „minus“.

Exponent:
The EEEE EEEE have the value: 1000 0010 binary. This value converted in decimal it is: 130 decimal. This value has
the offset 127. So the exponent is: 130 - 127 = 3

Mantissa:
Because the mantissa is normalized the most significant bit has the value 1, the next bit has the value 0.5, the next bit
has the value 0.25.

Bit number

Value of the bit, if the bit is set to 1

bit 24 (MSB)

1

bit 23

0.5

bit 22

0.25

bit 21

0.125

bit 20

0.0625

bit 19

0.03125

bit 18

0.015625

bit 17

0.0078125

and so on

The MMM MMMM MMMM MMMM MMMM MMMM (23bit) have the value 100 1000 0000 0000 0000 0000. The
most significant bit (MSB) is always 1 (and not stored). You have to implement this most significant bit.

So the value of the mantisse is: 1100 1000 0000 0000 0000 0000 (binary).

Bit number

Value

Bit 24 is set to 1

1

Bit 23 is set to 1

+ 0.5

Bit 20 is set to 1

+ 0.0625

So the mantissa has the value 1.5625

Whole Value:
The whole value is: -1.5625·2

3

= -12.5

9

tina12e1 (0106) PEG100-D.ga

Advertising