Intel 8XC196NP, 80C196NU, Microcontroller manual Fractional Mode

Models: Microcontroller 80C196NU 8XC196NP

1 471
Download 471 pages 22.3 Kb
Page 52
Image 52

ADVANCED MATH FEATURES

3.2.2Fractional Mode

A signed fractional contains an imaginary decimal point between the sign bit (the MSB) and the adjacent bit. These examples illustrate the representation of 32-bit signed fractional numbers:

0.111

1111 1111 1111 1111 1111 1111 1111 = 2147483647--------------------------------= 1

 

 

2147483648

 

0.000

0000 0000 0000 0000 0000 0000 0000

= 0

 

1.111

1111 1111 1111 1111 1111 1111 1111 = ----

1

0

-------------------------- = –

 

2147483648

 

1.000

0000 0000 0000 0000 0000 0000 0000

= –1

 

Fractional mode shifts the result of a multiplication instruction left by one bit before writing the result to the accumulator. This left shift eliminates the extra sign bit when both operands are signed, leaving a correctly signed result and the correct decimal placement.

3-3

Page 52
Image 52
Intel 8XC196NP, 80C196NU, Microcontroller manual Fractional Mode