计算机组成原理 笔记整理
•Hierarchy(层次化)
•Modularity(模块化)
•Regularity(规整化)
‒Base(基数)
‒weighted(权)
binary numbers:
base:2
weighted:2^i
•2^10=1 Kilo≈1000(1024≈10^3)
•2^20=1 Mega≈1 million(1,048,576≈10^6)
•2^30=1 Giga≈1 billion(1,073,741,824≈10^9)
•Unsigned number:are created directly as ordinary binary codes
–Operation codes in the OP code field
–Register numbers in address field
–Memory address
–counter
–Time,clock frequency
•Fix-Point Number(小数点不占位)
•Floating-Point Number(小数点占位)
MSB: the Most Significant (left-most) Bit
•1 sign bit,N-1 magnitude bits
•Sign bit is the Most Significant (left-most) Bit
–Positive number: sign bit=0
–Negative number: sign bit=1
•Example,4-bit sign/mag representations of ±6:
+6=0110;
-6=1110;
[+0]=0.0000000;
[-0]=1.0000000;
•Range of an N-bit sign/magnitude number:
[-(2(N-1)-1),2(N-1)-1]
–Addition works(易于加法操作)
–Single representation for 0(0的表示是唯一的)
•正数补码:和原码一样,符号用0表示,数值用二进制表示;
•负数补码:符号用1表示,原码数值部分按位取反,末位加1;
•The Most Significant Bit still indicates the sign
•1=negative,0=positive;
•Range of an N-bit two’s comp number:
[-(2N-1),2N-1-1]
•Positive the sign ‘0’ at msb is attached to the magnitude in the remaining n-1 bits.
•Negative the sign ‘1’at msb is attached to the 1’s compl of the magnitude in the remaining n-1bits.
•Decimal:
–X1=+0.1011011,[X1]1’s compl=0.1011011
–X2=-0.1011011,[X2]1’s compl=1.0100100
•Integer:
–X3=+1011011,[X3]1’s compl=01011011
–X4=-1011011,[X4]1’s compl=10100100
•[+0]1’s compl=00000000;
[-0]1’s compl=11111111
Number System Range
Unsigned [0,2^N-1]
Sign/Magnitude [-(2(N-1)-1),2(N-1)-1]
One’s Complement [-(2(N-1)-1),2(N-1)-1]
Two’s Complement [-2(N-1),2(N-1)-1]
•Digital systems operate on a fixed number of bits
•Overflow: when result is too big to fit in the available number of bits
•See previous example of 11+6
Extend number from N to M bits(M>N)
•Zeros copied to msb’s
•Value changes for negative number
•Sign bit copied to msb’s
•Number value is same