計組筆記第一章個人整理未完善

creamlands發表於2021-01-04

計算機組成原理 筆記整理

第一章

1.1

The Three–Y’s(三個原則)

•Hierarchy(層次化)

•Modularity(模組化)

•Regularity(規整化)

Weighted positional number system(帶權的位置數制)

‒Base(基數)

‒weighted(權)

binary numbers:

​ base:2

​ weighted:2^i

bits(1),bytes(8),nibbles(4)

•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)

1.2

Data types representing information in a computer

Unsigned numbers(無符號數)

•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

Signed numbers(有符號數)

•Fix-Point Number(小數點不佔位)

•Floating-Point Number(小數點佔位)

MSB: the Most Significant (left-most) Bit

Sign-Magnitude Numbers(原碼)

•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]

Two’s Complement Numbers(補碼)

–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]

One’s Complement Numbers(反碼)

•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]

Overflow(溢位)

•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

Overflow Examples
Increasing Bit Width(擴充套件位數)

Extend number from N to M bits(M>N)

Zero-extension(零擴充套件)

​ •Zeros copied to msb’s

​ •Value changes for negative number

Sign-extension(符號擴充套件)

​ •Sign bit copied to msb’s

​ •Number value is same

相關文章