作者executor1107 (口责.我受够了)
看板NSYSU-CSE97
标题[分享] 计概chapter 3随手整理
时间Sun Dec 12 11:17:29 2004
One's complement representation in decimal.
1. If the leftmost bit is 0(positive number),
a. Change the entire number from binary to decimal.
b. Put a plus sign (+) in front of the number.
2. If the leftmost bit is 1(negative number),
a. Complement the entire number (changing all 0s to 1s, and vice versa).
b. Change the entire number from binary to decimal.
c. Put a negative sign (-) in front of the number.
Two's complement representation in decimal.
1. If the leftmost bit is 0(positive number),
a. Change the whole number from binary to decimal.
b. Put a plus sign (+) in front of the number.
2. If the leftmost bit is 1(negative number),
a. Leave the rightmost bits up to the first 1(inclusive) unchanged.
Complement the rest of the bits.
rightmost bits up to the first 1 means从右边算来一直到第一个1的部份
b. Change the whole number from binary to decimal.
c. Put a negative sign (-) in front of the number.
p.s.LSB means?
Questions:
(a) The two’s complement of (0101001)2 is
26 – (0101001) = 1000000 – 0101001 = 10111
Here n = 6 and r = 2.
I thought it should be 1010111?
--
......ID......
......I am a learning Dancer......
Shake my body through the music...
Dance with the Feel...
This is my ID......
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.186.180
※ 编辑: executor1107 来自: 140.117.186.180 (12/12 11:29)