Arithmetic Operations on Binary Numbers Because of its widespread use, we will concentrate on addition and subtraction for Two's Complement representation. The nice feature with Two's Complement is that addition and subtraction of Two's complement numbers works without having to separate the sign bits (the sign of the operands and results is effectively built-into the addition/subtraction calculation). Remember: −2n−1 ≤ Two's Complement ≤ 2n−1 − 1 −8 ≤ x[4] ≤ +7 −128 ≤ x[8] ≤ +127 −32768 ≤ x[16] ≤ +32767 −2147483648 ≤ x[32] ≤ +2147483647 What if the result overflows the representation?
Read full article from Arithmetic Operations on Binary Numbers
No comments:
Post a Comment