Alex. Gerbessiotis CS 332-005 Fall 2019 October 31, 2019 --------------------------------------------------------------------------------------- 24-bit addressing scheme 16MiB of main memory (aka RAM) ... three periods mean zero, one or more piece of information is missing consider it zeo ... 0000 21 PAGETABLE (Some entries are shown) 0001 2 three periods mean: fill with as many zeroes as needed 0010 24 page table address in binary 0011 25 page table contentrs in denary 0100 23 0101 30 0110 31 0111 32 ... 1000 3 1001 1 1010 4 1011 5 1100 16 1101 7 1110 33 1111 34 --------------------------------------------------------------------------------------- Fill the unfilled entries below from 01 through 24 --------------------------------------------------------------------------------------- 01-Logical address (in binary) 0000000001000 00000001110 02-Logical address (in denary) 03-Logical address (in hex ) 04-Page Number (in binary) 05-Page Number (in denary) 06-Page Offset (in binary) 07-Page Offset (in denary) 08-Page Number # bit 09-Page Offset # bit 11-Physical address (in binary) 12-Physical address (in denary) 13-Physical address (in hex ) 14-Frame Number (in binary) 15-Frame Number (in denary) 16-Frame Offset (in binary) 17-Frame Offset (in denary) 18-Frame Number # bit 19-Frame Offset # bit 10-Page Size in B 20-Frame Size in B 21-Page Table size (suggested) : 22-Page Table Entry (PTE) # bit : For 22: assume you have a P (Present) bit, also a D (Dirty) bit 23-Page Table Entry (PTE) # B/PTE: 24-# entries in Page Table : ---------------------------------------------------------------------------------------- ANSWER FOLLOWS ---------------------------------------------------------------------------------------- 01-Logical address (in binary) 0000000001000 00000001110 02-Logical address (in denary) 8 x 2048 + 14 = 16398 03-Logical address (in hex ) 0x00400E 04-Page Number (in binary) 0000000001000 or without leading zeroes 1000 05-Page Number (in denary) 8 06-Page Offset (in binary) 00000001110 07-Page Offset (in denary) 14 08-Page Number # bit 13 09-Page Offset # bit 11 11-Physical address (in binary) 0000000000011 00000001110 12-Physical address (in denary) 3 x 2048 + 14 = 6158 13-Physical address (in hex ) 0x00180E 14-Frame Number (in binary) 011 or in 13-bit 0000000000011 15-Frame Number (in denary) 3 16-Frame Offset (in binary) 00000001110 17-Frame Offset (in denary) 14 18-Frame Number # bit 13 19-Frame Offset # bit 11 10-Page Size in B 2KiB or 2048B 20-Frame Size in B 2KiB or 2048B 21-Page Table size (suggested) : 2KiB or 2048B 22-Page Table Entry (PTE) # bit : 15bit or 16 bit rounded For 22: assume you have a P (Present) bit, also a D (Dirty) bit 23-Page Table Entry (PTE) # B/PTE: 2B/PTE 24-# entries in Page Table : 1024 Computation/Work Flow 01 : Given as 0000000001000 00000001110 08 : Given as 13 09 : Given as 11 10 : (From 08) 2**11 = 2KiB is page size 20 : (From 10) and the fact that 24-bit addressing and 2**24 = 16MiB the size of available memory implies 2KiB of frame size as well 03 : (From 01) 0x00400E 04 : (From 08) 0000000001000 05 : (From 04) 8 06 : (From 09) 00000001110 07 : (From 06) 14 02 : (From 01 or 05, 07, 10) From 05 and 07 : (8,14) : 8 x 2048 + 14 = 16398 16,17,18,19 : cut-and-paste from Logical since page and frame size the same frame offset # bit is 13 address # bit is 24 diff is page/frame number # bit 24-11 = 13 bit 15 : PageNumber in binary is from 04: 1000 (without leading zeroes) Go to page table at offset 1000 and retrieve frame number in denary 3 14 : Express it in 13-bit since 18-Frame Number # bit is 13 11 : Concatenate 14 and 16 13 : From 11: 12 : From 15 and 17 and 20 SOME MORE 21 : Page Table size is Page size i.e. 2KiB = 2048B 22 : Page Table entry should accommodate a frame number (by 18 it is 13bit) Add a D bit , Add a P bit we get 15 bit round up 16bit or 2B 23 : From 22 : 2B 24 : Divide Page Table Size with Page Table Entry in B i.e. 21-Value / 23-Value = 2048 / 2 = 1024 entries