操作系统 物理地址空间与逻辑地址空间
物理地址空间
系统中的物理地址空间可以定义为主内存的大小。比较进程大小与物理地址空间非常重要。进程大小必须小于物理地址空间。
Physical Address Space = Size of the Main Memory
If, physical address space = 64 KB = 2 ^ 6 KB = 2 ^ 6 X 2 ^ 10 Bytes = 2 ^ 16 bytes
Let us consider, word size = 8 Bytes = 2 ^ 3 Bytes
Hence, Physical address space (in words) = (2 ^ 16) / (2 ^ 3) = 2 ^ 13 Words
Therefore, Physical Address = 13 bits
In General,
If, Physical Address Space = N Words
then, Physical Address = log2 N
逻辑地址空间
逻辑地址空间可以定义为进程的大小。进程的大小应该足够小,以便可以在主内存中存放。
假设,
Logical Address Space = 128 MB = (2 ^ 7 X 2 ^ 20) Bytes = 2 ^ 27 Bytes
Word size = 4 Bytes = 2 ^ 2 Bytes
Logical Address Space (in words) = (2 ^ 27) / (2 ^ 2) = 2 ^ 25 Words
Logical Address = 25 Bits
In general,
If, logical address space = L words
Then, Logical Address = Log2L bits
什么是byte
byte是内存的最小单位。它是字节的集合。每个操作系统都根据输入到译码器的n位地址和由译码器产生的2 ^ n个内存位置来定义不同的字大小。