1
votes

I'm reading about MMU translation and how a CPU can execute a load instruction that reads a byte at an address, leading to it concatenating the PPN from the PTE with the VPO from a virtual address, making a physical address. But I'm not sure how this concatenation is done. This is the paragraph I'm referring to:

enter image description here

To begin, the MMU extracts the VPN ( OxOF) from the virtual address and checks with the TLB to see if it has cached a copy of PTE OxOF from some previous memory reference. The TLB extracts the TLB index (Ox03) and the TLB tag (Ox03) from the VPN, hits on a valid match in the second entry of set Ox3, and returns the cached PPN (OxOD) to the MMU. If the TLB had missed, then the MMU would need to fetch the PTE from main memory. However, in this case, we got lucky and had a TLB hit. The MMU now has everything it needs to form the physical address. It does this by concatenating the PPN (OxOD) from the PTE with the VPO (Ox14) from the virtual address, which forms the physical address (Ox354).

But my question is, how are (0x14) and (0x0d) concatenated? Could someone possibly show me the steps to how this is done?

1
How is C involved in this?harold
The VPO seems to be only 6 bits, so by 0x14 they really mean b010100. So when you combine a PPN of 0x0D (b00001101) with it, you get b00001101010100, which is 0x354.Lee Daniel Crocker
Do realize that the MMU is only hardware. It can do whatever it wants with the addresses (such as: split the address line in two parts, and treat these parts differently)wildplasser
I suggest finding another source to learn from.user3344003

1 Answers

1
votes

It's basically

(0xf << 6) | 0x14 // 0x3d4

So you take 6 bits from VPO and prepend it with bits from VPN.