作者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)