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 page size 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."   f.Run the program with at least 10 different virtual memory addresses to validate all functionality of your program, including addresses that can be mapped to physical memory and some that are on disk. Make sure you write your program in a modular fashion to eliminate redundant code.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question
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 page size 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."
 
f.Run the program with at least 10 different virtual memory addresses to validate all functionality of your program, including addresses that can be mapped to physical memory and some that are on disk. Make sure you write your program in a modular fashion to eliminate redundant code.
 
I have been working on this for the past few days and haven't had any luck figuring it out. Please help!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education