Question: Written in C programming Objective In this assignment, you will write a program that will calculate the page index and offset given a hexadecimal logical

Written in C programming

Objective

In this assignment, you will write a program that will calculate the page index and offset given a hexadecimal logical address. The page size for this assignment is 4KB.

Output

The output of your program should look like this:

$ ./p6 3f7792

Logical Addr:0x003F7792 - Page Index:0x000003F7 - Offset:0x00000792

$ ./p6 2a

Logical Addr:0x0000002A - Page Index:0x00000000 - Offset:0x0000002A

Notes

You need to convert the hexadecimal input to an integer. A handy library function for that is strtol.

How many bits are necessary to address a memory page that is 4KB size? That will tell you how many bits you need for the offset.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!