Ww2.justanswer.com



1) explain and show the overflow of 2's complement

When adding two n-bit numbers in 2’s complement representation, it is possible that the resulting number will be larger than the capacity of n bits, requiring n+1 bits. When this happens, we say the result has overflowed. We know an overflow has occurred only when a) summing two positive numbers yields a negative result, or b) summing two negative numbers yields a positive result.

2) explain and show the size of 2's complement for 8 bit and 16 bit IEEE

In 2’s compliment, the nth bit is the sign bit. A 0 indicates a positive number, and 1 indicates a negative number. The largest positive number is thus 0111…1, representing [pic]. With 8-bits, the largest positive number is 255, and with 16 bits it is 65,535. The largest negative number is 1000…0, representing [pic]. For an 8-bit number this is –256, and for 16-bit number, it is –65,535. The table summarizes this:

|number of bits |range |

|8 |–256 to 255 |

|16 |–65,536 to 65,535 |

|n |[pic] |

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download