Skip to content

A single level cache that implements Direct, Fully Associative, and N-way Set Associative mapping in a 16-bit system.

Notifications You must be signed in to change notification settings

ananyalohani/caches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Cache

Overview

  • Programming Language: Python 3.7
  • Word Size: 16-bit
  • Implemented a single level cache and a main memory containing 2^16 memory locations/addresses.
  • All replacement schemes used are random replacement schemes.

User Input

  • Size of Cache in bytes(S)
  • Number of Cache Lines(CL)
  • Size of a Block in bytes(B)
  • Number of ways(N) for N-way Set Associative Mapping
  • Choice of mapping of cache

Types of Mapping of Cache

  1. Direct Mapping
  2. Fully Associative Mapping
  3. N-way Set Associative Mapping

Operations

After taking the above inputs, the user will be prompted repeatedly to perform any of the following operations:

  1. Read: To read data from the address input by the user.
  2. Write: Address and data are input by the user. The data is stored at the specified location.
  3. View Cache: To display the state of the Cache, i.e. the block number occupying each cache line, and the data present in the blocks.
  4. View Sets: (Only applicable for N-way Set Associative Cache) To display the state of the Sets, i.e. the cache line(s) occupying each set.

About

A single level cache that implements Direct, Fully Associative, and N-way Set Associative mapping in a 16-bit system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages