Skip to main content

Posts

Showing posts with the label 32 bit registers

What is Virtual Memory and How it works?

What is Virtual Memory and How it works? Virtual Memory allows multi-user as well as multi-programming computing environment that too for very less RAM. RAM use to be very costly earlier compare to present day. CPU has PC register from where next instruction can be fetched or data can be load/store. Assuming PC being 32 bit register, it can address 4G locations. But practically we put very less RAM, say 128MB only. Assuming Virtual Memory exists, compiler generates code for an application, where compiler is also aware of OS+Architecture. Now code generated by compiler assumes entire 4G location (so large extent) is available for it and it is the only application running on the CPU. So PC register shall always issue address which is one among 4G locations. So this 4G which is in fact physical capacity of PC register of CPU, is used as Virtual Address, as actual RAM is much less (0-128MB only) Now OS uses a table call Page Table along with MMU unit of CPU. Using this it loa