2014-04-30 134 views
-1

我在理解這裏發生的事情方面有點問題,而且似乎無法將我的頭腦包圍起來。內存地址的二進制格式。計算機組織

注: Course notes about topic

例子:

Memory location 0x1f6 
What is the binary format of this address? 1 1111 0110 
What are tag, block index, and block offset? 3, 7, 6 

我自己的工作:

Memory location 0x033 
What is the binary format of this address? 0 0011 0011 
What are tag, block index, and block offset? 0 6, 3 

Memory location 0x009 
What is the binary format of this address? 0 0000 1001 
What are tag, block index, and block offset? 0, 1, 1 

Memory location 0x652 
What is the binary format of this address? 0110 0101 0010 
What are tag, block index, and block offset? 12, 10, 2 

這是我的嘗試,但我還沒有線索,如果我這樣做是正確的,我有一種感覺,我不是,至少對於最後一個,我認爲這是錯誤的。任何人都可以將我指向正確的方向嗎?

+0

答案是非常依賴於位的解釋,這是你的家庭作業或課堂作業定義的東西。沒有解碼存儲器地址的一般定義。 – nneonneo

+0

@nneonneo我附上了我們就該主題提供的筆記的唯一部分。 – Nate

回答

0

我最終搞清楚了。塊偏移取決於塊大小,在這種情況下是16字節,所以它需要4個二進制數字來表示它。接下來,塊索引取決於塊的數量,在這種情況下爲8(0-7),這需要3個二進制數字。最後,在將十六進制內存位置轉換爲二進制文件後,該標籤由剩餘的二進制數字組成。

Memory location 0x652 
What is the binary format of this address? 0110 0101 0010 
What is the binary representation of tag, block index, and block offset? 1100 101 0010 
What are tag, block index, and block offset? 12, 7, 2