Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started