162k views
4 votes
Scenario: You are helping a colleague who is a junior programmer in your firm. He just started programming in the real-world and has difficulty understanding how memory is managed in his computer system in regard to stacks and heaps. Draw out a diagram, using the Draw tab in MS Word (or any other drawing software of your choice), showing the memory process explaining how memory and virtual memory addressing work.

Submit the assignment in MS Word or PDF file.
You will be assessed on:
• Your neatly labeled diagram showing the memory process.
• Your explanation of how memory and virtual memory addressing work with reference to the diagram.
• Organization and style of the essay (including APA formatting).
Submit a paper that is at least 2 pages in length exclusive of the reference page, double-spaced using 12-point Times New Roman font. The paper must cite a minimum of two sources in APA format and be well-written. Check all content for grammar, spelling and be sure that you have properly cited all resources (in APA format) used.

User Oxyum
by
4.0k points

1 Answer

2 votes

Answer:

Step-by-step explanation:

Virtual memory is a key component that plays an important role in the working of a computer. It is a technique that is used in an operating system to optimize the efficiency and speed of the system and also helps in providing space to store the data in the system. With the help of virtual memory, the computer system transfers data to other storage such as the RAM, hard drive, or solid-state disk.

Addressing is the technique that is used to assign the memory space or part to a file, program, or process. In the memory, each block has a unique address that is used to store data in the block. This address is used by the computer to store data in a block of memory. Whenever a variable is declared in a program, the computer assigns the block of memory to the variable using the stack or heap according to the user's request.

A stack is a type of Last in First out memory and it is used to store data that is required for function executions such as the return addresses, local variables, and formal parameters. The stack is used when allocating a fixed size of data but in case the size of the data is not fixed then in such cases the heap can be used for allocating dynamic-sized data. The stack and heap both are contiguous memory regions and they are placed side by side in the memory.

Virtual memory utilizes the computer hardware and software to assign the address to the files, programs, or processes that have access to the virtual memory. It copies the address of the files from the main memory and transfers these addresses to the RAM and hard disk to increase the speed of memory addressing. It helps in removing the free addresses of the unused files from the memory and thus increases the efficiency and speed of the system for memory addressing. It helps the system to swap files from the other storage to make optimal use of the RAM.

The main memory address which is also known as physical address is provided below-

The main memory consists of words which are further a collection of some n bits which is defined by the memory architecture.

In general,the whole memory consists of blocks which further consists of TAGs and SETs and then further word address identifies each word.

Hence the structure of memory is provided below-

Block Address Word Address

TAG SET

The virtual memory address is allocated in the below defined manner-

Directory Page Table Offset

Note:

We currently do not have a feature to support diagrams/graphs and will be updating soon. We tried to answer the question as best as possible by explaining the concepts behind the question."

User Alexpfx
by
4.3k points