(2N-1)or-天津大学计算机学院.ppt

(2N-1)or-天津大学计算机学院

Store –40 in a 16-bit memory location using two’s complement representation. First change the number to binary 101000. Add ten 0s to make a total of N (16) bits, 0000000000101000. The sign is negative, so leave the rightmost 0s up to the first 1 (including the 1) unchanged and complement the rest. The result is: 1111111111011000 Solution Example 13 Example of storing two’s complement integers in two different computers Decimal ------------ +7 -7 +124 -124 +24,760 -24,760 8-bit allocation ------------1111100110000100 overflow overflow 16-bit allocation -

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档