3

Assume that there are 7-bits that are available to store a binary number. Specify the range of numbers that can be represented by 1's Complement. I found that the range for 2's Complement is -64 ≤ 0 ≤ 63. How do I do this for 1's Complement?

4

1 回答 1

1

在二进制数表示的 2s 补码方法中,对于有符号数,对于 N 位数,可表示的数范围为 -2^(N-1) - (2^(N-1)-1)。这就是为什么您获得 7 位二进制数的范围 -64 - 63 的原因。

现在在 1s Complement 表示方法的情况下,可以表示的数字范围是 -(2^(N-1)-1) - (2^(N-1)-1)。这将导致 1s 补码表示中的 7 位数字的范围为 -63 - 63。

于 2018-07-28T05:29:45.823 回答