- 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.
- 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
- Direct Mapping
- Fully Associative Mapping
- N-way Set Associative Mapping
After taking the above inputs, the user will be prompted repeatedly to perform any of the following operations:
- Read: To read data from the address input by the user.
- Write: Address and data are input by the user. The data is stored at the specified location.
- 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.
- 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.