VirtualAddress

VirtualAddress - FAQ Given a memory reference (a virtual...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
FAQ Given a memory reference (a virtual address), how can we know which virtual page this virtual address is in? Let’s take a look at an example. You have 1024 marbles and they are labeled from 0 to 1023. We would like to organize (in order) them in boxes of marbles. Assume each box can store 16 marbles and marbles are organized in a form of 4 Χ 4 checkerboard. So we can order those marbles in a box according to their label. Now the question is: Given the marble with the label 234, which box should we place this marble in and at which slot should we place it? Using traditional arithmetic, we simply have 234 16 = 14, we get the box number (the 15 th box). To find the slot in that box, we simply have 234 % 16 = 10 (that is the 11 th slot). The computer manipulates bit strings, not the decimal number. How does the computer do this? The bit string of 234 is 11101010. The bit string of 14 is 1110, which is just happened to be the first 4 bits (from the left) 1110 1010. The bit string of 10 is
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/01/2010 for the course CS 2342 taught by Professor Dr during the Spring '10 term at HKU.

Page1 / 2

VirtualAddress - FAQ Given a memory reference (a virtual...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online