Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that allows the user to enter the main memory size, cache size, block size, and offset, and prints the number of

Write a C++ program that allows the user to enter the main memory size, cache size, block size, and offset, and prints the number of bits, number of blocks, number of cache lines, and tag according to the following formulas:

image text in transcribed

Given: Main memory size-4GB Cache size-64MB Block size 16 Bytes Offset- logz(BS)- 24-4 bits. Calculate: Addressing Bits-log2(MMS)-(22x20)-232-32 bits The number of blocks(p)-log2(MMS/BS) (22x230)/24 228-28. The number of cache lines (q)- log2(CS/BS)- (26x220/24-222-22. Calculate Tag as log2(p/q)- 228/22226 Tag Line Offset 4 Hence: 6+22+4-32Bits. Please note: 1. That you can be given the Addressing bits as 32 and then required to calculate the Main Memory Size. How???? 2. See conversion from above example Bits, Bytes, KB, MB, GB.... 3. Assume that MMS>CS>BS Write a C++ program to allow the user to enter the given and do the calculation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

Identify the universal properties of all languages.

Answered: 1 week ago