Code Monkey home page Code Monkey logo

virtual-memory-manager's Introduction

Virtual Memory Manager

This repository contains a virtual memory manager program implemented in C++. The program simulates a virtual memory system with a translation lookaside buffer (TLB) and a page table. It takes input addresses from a file and translates them to physical addresses using the TLB and page table.

Features

  • Translation Lookaside Buffer (TLB) with a size of 16 entries.
  • Page table with a size of 256 entries.
  • Physical memory with a size of 65536 bytes.
  • Supports reading addresses from a .txt file.
  • Simulates values stored at physical addresses using a .bin file
  • Calculates TLB hit rate and page table hit rate.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/Virtual-Memory-Manager.git
  2. Compile the virtualmemorymanager.cpp file using a C++ compiler:

    g++ virtualmemorymanager.cpp -o virtualmemorymanager
  3. Generate the physical memory file using the datagen.cpp file:

    g++ datagen.cpp -o datagen
    ./datagen

Usage

  1. Create a file named inputs.txt and populate it with the virtual addresses you want to translate. Each address should be on a new line.

  2. Run the virtualmemorymanager executable:

    ./virtualmemorymanager
  3. The program will read the virtual addresses from the inputs.txt file, translate them to physical addresses using the TLB and page table, and display the results on the console.

  4. The TLB hit rate and page table hit rate will be calculated and printed at the end of the execution.

File Descriptions

  • virtualmemorymanager.cpp: Contains the main implementation of the virtual memory manager program. It reads virtual addresses from a file, performs address translation, and displays the results.
  • datagen.cpp: Generates the physical memory file (physical_memory.bin) filled with random data. This file is required for the virtual memory manager program to function properly.

Contributing

Contributions to this virtual memory manager project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

virtual-memory-manager's People

Contributors

adivishnu-a avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.