Jump to content

need help in this question of computer architecture


Recommended Posts

Forgive me. I doubt that I can help you. I might solve the problem for you, but do not know how to teach you how to solve word problems.


The reason I am responding is that I read your post, but the forum did not increment the number of views. Thus, you may think no one is reading it. I am confused about what the number of views means, and hope a moderator will explain. NVM moderator, view finally updated.

Edited by EdEarl
Link to comment
Share on other sites

This is probably easiest done in a spreadsheet of some kind, so you can change the numbers to fit the questions. There are probably a few ways to go about this.


What you need to do is map out how long every operation (fetch, decode etc.) takes, when it comes to hits and misses and all that. I think we can assume the 95% hit for instruction cache and 90% hit for the data cache can be used on all instructions? Then calculate each instruction.


For example, instruction type 4 has fetch, decode, execute. Let's start with fetch. Calculate the total number of fetches in done by this operation in the course of the program's run time. If there have been 10 million instructions, where 20% were type 4, then I'd say this instruction's fetch has executed around 2 million times.


We're working with averages. And since we access the instructions cache, the hit rate is 95%. So 95% of the time, the operation takes 200 ps, the rest of the time takes 8 ns. 95% of 2 million is 1,900,000. So multiply 1,900,000 by 200 ps = 380,000,000 ps = 380,000 ns. Now, we still have 100,000 fetch operations that missed. So 100,000 times 8 = 800,000 nanoseconds. Add them together for 1,180,000 ns.


That's done with fetch in the type 4 instruction. Now you'll have to go through each and every one of the operations in each instruction and do about the same thing. Calculate the total number of executions, work out how many are hits and how many are misses, then add them together. I'm sure there's an easier way, but I think this is the most basic way of solving it.


MIPS rating is simple to calculate once you have the number of instructions and the total time of the program. All you do is


MIPS = n / (t x 1,000,000) where n is the number of instructions executed and t is the time it took to execute those instructions in seconds.


From here: http://www.ehow.com/how_6507318_calculate-mips-rating.html


And the third question is why you put everything in a neat spreadsheet to begin with, because then all you do is change each variable and see how the program's run time changes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.