MMU implementation-a translation table. Then, how large is the lookup table?232How large is an address?How many addresses are there?4bytesOnlythiscolumn is stored.Size of the lookup table =Numberof addressesVirtualaddressPhysicalAddressxXSize of an address0x000000000x012345670x452796AB232 x4bytes=16Gbytes......0X6714EFD8Lookup Tableinternals21
MMU implementation – a translation table • Then, how large is the lookup table? 21 Virtual address Physical Address 0x00000000 0x01234567 0x00000001 0x452796AB . . 0xFFFFFFFF 0x6714EFD8 Lookup Table internals How many addresses are there? 2 32 Size of the lookup table = Number of addresses x Size of an address How large is an address? 4 bytes Only this column is stored. 2 32 x 4 bytes = 16 Gbytes
MMU implementation-a translation table Then, how large is the lookup table?232How large is an address?How many addresses are there?4bytesSize of the lookup table =Can we reducethe table size?Number of addressesxXSize of an addressNote.EveryaddressinaCPUisalwaysof4bytes232 x4bytes=16GbytesThe only choice is to reducethenumberof addresses22
MMU implementation – a translation table • Then, how large is the lookup table? 22 How many addresses are there? 2 32 Size of the lookup table = Number of addresses x Size of an address How large is an address? 4 bytes 2 32 x 4 bytes = 16 Gbytes Note. Every address in a CPU is always of 4 bytes. Can we reduce the table size? The only choice is to reduce the number of addresses
MMU implementation-apartial lookuptableSize of the lookup table =Virtual20 bits12 bitsNumber of addressesaddressXsize of an address220 x4bytes=4MbytesLookupunchangedtableNote.EveryaddressinaCPUisPhysical20bits12 bitsalwaysof4bytesalthoughyouaddressonlyuse20bitsMMUinternals23
23 MMU implementation – a partial lookup table MMU internals 12 bits Lookup table 20 bits 12 bits unchanged Size of the lookup table = Number of addresses x Size of an address 2 20 x 4 bytes = 4 Mbytes Physical address Note. Every address in a CPU is always of 4 bytes although you only use 20 bits. 20 bits Virtual address
MMU implementation-paging? This technique is calledVirtual PagePagepagingoffsetAddress12 bits20bits This partitions the memoryinto fixed blocks called pages.1Pageunchangedtable-The lookup table inside the?VMMU is now called the page20 bits12 bitstable.Physical PageAddress24
MMU implementation – paging • This technique is called paging. – This partitions the memory into fixed blocks called pages. – The lookup table inside the MMU is now called the page table. 24 20 bits 12 bits Page table 20 bits 12 bits unchanged Virtual Page Address Page offset Physical Page Address
Paging-propertiesVirtual PagePageoffsetaddress20 bits12 bitsSize=4096bytes(or4KB)25
Paging - properties 25 20 bits 12 bits Virtual Page address Page offset Size = 4096 bytes (or 4KB)