Computer Science - Operating Systems Concepts - Discussion
Discussion Forum : Operating Systems Concepts - Section 2 (Q.No. 29)
29.
If the number of bits in a virtual address of a program is 16 and the page size is 0.5 K bytes, the number of pages in the virtual address space is
Discussion:
5 comments Page 1 of 1.
Deven said:
6 years ago
Total no.of address is 65536 address.
Page size is 0.5KB means each page store 512 address.
To store 2^16 address in memory we need 65536/512 = 128 pages.
Page size is 0.5KB means each page store 512 address.
To store 2^16 address in memory we need 65536/512 = 128 pages.
(2)
Bharathiraja said:
6 years ago
16-bit address means total memory = 2^16 bits.
Given page size is 0.5 KB = 512 Bytes (Ref: 1 KB = 1024 Bytes). i.e 2^9.
Page size = 2^16/2^9 = 2^16-9 ; 2^7 = 128 pages.
Given page size is 0.5 KB = 512 Bytes (Ref: 1 KB = 1024 Bytes). i.e 2^9.
Page size = 2^16/2^9 = 2^16-9 ; 2^7 = 128 pages.
(2)
Rohit Singh said:
9 years ago
16-bit address means total memory = 2^16 bits.
Size of a page is 0.5 K bytes which means (2^-1) * (2^10) * (2^3) = 2^12 bits
Hence, number of pages = 2^4 = 16 (AND NOT 128).
@Aniruddha & @Sundar.
You have taken WRONGLY, the virtual address space to be 2^16 BYTES RATHER THAN BITS.
Size of a page is 0.5 K bytes which means (2^-1) * (2^10) * (2^3) = 2^12 bits
Hence, number of pages = 2^4 = 16 (AND NOT 128).
@Aniruddha & @Sundar.
You have taken WRONGLY, the virtual address space to be 2^16 BYTES RATHER THAN BITS.
Sundar said:
1 decade ago
A 16 bit address can locate up to 2^16 = 65536 locations (bytes).
Given page size is 0.5 KB = 512 Bytes (Ref: 1 KB = 1024 Bytes).
Therefore, total pages = 65536/512 = 128 pages.
Hope this help you. Have a nice day!
Given page size is 0.5 KB = 512 Bytes (Ref: 1 KB = 1024 Bytes).
Therefore, total pages = 65536/512 = 128 pages.
Hope this help you. Have a nice day!
Aniruddha Ghosh said:
1 decade ago
The answer is 128 pages.
Virtual address space = 2^16 bytes.
Page Size = 0.5 K bytes = 0.5 * 2^10 = 2^9 bytes
Number of pages = Virtual address space / Page Size = 2^16/2^9 = 2^7 = 128.
Note:
16 bits in Virtual Address should not be confused to be 3 bits of flip-flops in registers and 13 bits of page address. We never count the 2^3 flip-flops in the register, as they can be read parallel in one go by the 8 data bus lines.
Refer Operating System by Galvin 7th edition: Chapter 8 - Main Memory.
"If the size of logical address space is 2^m and a page size is 2^n addressing units (bytes or words), then the high-order m-n bits of a logical address designate the page number, and the n low-order bits designate the page offset."
Virtual address space = 2^16 bytes.
Page Size = 0.5 K bytes = 0.5 * 2^10 = 2^9 bytes
Number of pages = Virtual address space / Page Size = 2^16/2^9 = 2^7 = 128.
Note:
16 bits in Virtual Address should not be confused to be 3 bits of flip-flops in registers and 13 bits of page address. We never count the 2^3 flip-flops in the register, as they can be read parallel in one go by the 8 data bus lines.
Refer Operating System by Galvin 7th edition: Chapter 8 - Main Memory.
"If the size of logical address space is 2^m and a page size is 2^n addressing units (bytes or words), then the high-order m-n bits of a logical address designate the page number, and the n low-order bits designate the page offset."
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers