作者nana0130 (小那)
看板Grad-ProbAsk
標題[問題] OS-memory計算
時間Fri Mar 20 03:53:22 2009
Consider a system with following properties:
●A 64K byte logical address space.
●A physical memory of 16K bytes
●A simple (one-level)page table address translation implementation using
page size of 4096 byte
●The page tables are stored in physical memory.
●The access time of physical memory is 100μs.
(a) How many bits wide is a logical address ?
我算是 14bits
2^16 byte / 2^12 byte = 4=2^2
so p+d = 2+12 = 14
這樣對嗎 ?
(b)What is the min number of bits a pointer in a C program compiled for
this machine would need to occupy?
這題怎麼算啊 ??
(c)Assuming it also needs to hold a vaild bit, a reference bit
and a modified bit , what is the min number of bits wide a
page table entry need to be?
我算出來是 5bit耶,好奇怪喔!很懷疑我有沒有算錯?!
physical page number 我算是2^14 / 2^12 = 2^2
所以 3+2 = 5 !!
如果我有算錯,請您指正!謝謝你。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.139.157.70
1F:推 s987692:a.16 b.14 c.17 03/20 04:06
2F:推 joe1986112:A.16 B.16 C.9(含Page Number) 03/20 10:00
3F:推 joe1986112:a.64K=2^16=>16bit 03/20 10:05
4F:→ nana0130:喔,對,我真是熬夜熬昏了>"< 03/20 10:21
5F:推 ieaan:c也是算5 03/20 15:21
6F:推 s987692:C是五沒錯,我也昏頭了... 03/20 16:15
7F:推 decimal:那B呢?(我的C也是5) 03/20 16:17
8F:→ nana0130:thank you all! 03/20 16:24