關于字節,半字,字到底有多多少位
轉載:https://blog.csdn.net/hammer_xie/article/details/52301243
以前總是沒搞清楚半字,字到底有多少個字節,有說字是4字節的,又說字是8字節的,但沒有個固定的說法
下面這段話摘抄自Computer system: a programmer's perspective
Buses are typically designed to transfer fixed-sized chunks of bytes known as words. The
number of bytes in a word (the word size) is a fundamental system parameter that
varies across systems. Most machines today have word sizes of either 4 bytes (32
bits)or8bytes(64bits).
翻譯過來就是說:總線一般被設計來傳輸固定大小的一塊數據,這塊數據被稱為字(word),一個字包含的字節數(即字的大小)是各種計算機系統里面的基本參數,而且這個參數在不同的系統里通常是不同的。大多數的現代計算機系統里面,一個字要么是4個字節,要么是8個字節.
由此我們可以看出,單純問一個字占多少字節是沒有意義的,因為字的大小取決去具體系統的總線寬度,如果是32位的系統,則一個字是4個字節,如果是64位,則是8個字節。
浙公網安備 33010602011771號