Re: A83: Signed Division


[Prev][Next][Index][Thread]

Re: A83: Signed Division




> Call me stupid but what is "signed division", perhaps anyody knows the
dutch
> word for "signed divsion" or "signed" and "unsigned" numbers

<DUTCH>
Signed (ook bekend als 2-complement) betekent dat het 16e bit (=bit 15)
bepaalt of het getal positief of negatief is. Dus als bit 15 nul is, dan
moet je gewoon het getal dat in bits 0-14 staat nemen. Als bit 15 één is,
dan is het getal -32768+de waarde van bits 0-14. Dus #FFFF in 1-complement
is 65535 decimaal, en #FFFF in 2-complement is -1.

En je kan bij optellen en aftrekken gewoon de 'normale' rekeninstructies
gebruiken, want als je #0002 + #FFFF doet resulteert dat (via een overflow)
in #0001.
</DUTCH>

<ENGLISH>
Signed (also known as 2-complement) means that the 16th bit (=bit 15)
decides if the number is positive or negative. So if bit 15 is zero, then
you should simply take the value of the (in this case) word. If bit 15 is
one, then the value equals -32768+the value of bits 0-14 in decimal
notation. So #FFFF in 1-complement is 65535 decimal, and #FFFF in
2-complement is -1.

When adding and substracting, you can still use the 'normal' instructions
for that, for example #0002 + #FFFF results (via an overflow) in #0001.
</ENGLISH>


~Grauw


--
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<
 email me: laurensh1@yahoo.com or ICQ: 10196372
   visit the Datax homepage at http://datax.cjb.net/
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<



References: