Question
THE BOLD ITEMS ARE WHAT I NEED Write a C program that emulates the logic of the memory management unit (MMU). The following are the
THE BOLD ITEMS ARE WHAT I NEED
Write a C program that emulates the logic of the memory management unit (MMU). The following are the requirements for the program:
a.Prompt the user for a decimal number that will be used as the page size. Valid page sizes can either be 4095 (4K bytes) or 8191 (8K bytes).
b.Display the page size to the console as a 16-bit binary number that displays each binary digit as a 1 or 0 with the least significant bit on the right side of the output. Also display the page size to the console as a hexadecimal number.
c.Emulate a page table using a C array that supports the user specified page table size (you may create C arrays to handle a page table for both page sizes). The page table should represent a virtual memory address space of 1M bytes (0x000FFFFF) with a system that has a physical memory address size of 512K bytes (0x7FFFF), which is located at 0x00000000 and 0x0007FFFF. Populate the page table with the appropriate page table entries to support the specified pagesize and the physical memory address space. Page table entries do not need to support page faults, caching, or other attributes of a typical page able entry. The solution also does not need to support a TLB.
d.Prompt the user for a hexadecimal virtual memory address (between 0x00000000 and 0x000FFFFF), which will be converted to a physical memory address. Display to the console the input virtual memory address as a hexadecimal number.
e.Convert the virtual memory address to a physical memory address using the user specified page size and a populated page table. Display to the console the resultant physical memory address as a hexadecimal number. If the virtual memory address does not fit into the physical memory address simply display that the result is "Currently On Disk."
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