Question: Implement the translateAddress ( ) function and get the unit tests to work for this test case. The translateAddress ( ) function takes a virtual
Implement the translateAddress function and get the unit tests to work for this test case. The translateAddress function takes a virtual address in the simulation memory address space and translates it to a real address. So for example, if the address space defined for the simulation has a base address of and a bounding last address of then if you ask to translate address this should be translated to the real address The address index of can then be used to index into the memory array to read or write values to the simulated memory. There is one additional thing that should be done in this function. If the requested address is beyond the bounds of our simulation address space, you should throw an exception. For example, if the base address of memory is and the bounds address is then any address of or lower should be rejected and an exception thrown. Also for our simulation, any address exactly equal to the upper bound of or bigger is an illegal reference, and should also generate an exception.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
