176k views
2 votes
Consider a computer with identical interpreters at levels 1, 2, and 3. It takes interpreter n instructions to fetch, examine, and execute one instruction. A level-1 instruction takes k nanoseconds to execute. How long does it take for instruction at levels 2, 3, and 4?

User EGr
by
6.2k points

1 Answer

3 votes

Answer:

Now referring back to the question, since a level 1 instruction takes a k nano second which is equivalent to 1 billion of a second, then we will tend to loose a factor of n at each level such that the instruction execution time at level 2 (two), 3 (three), and 4 (four) are kn, kn^2, and kn^3 respectively.

Explanation:

To properly answer this question, we need to first understand what a computer with identical interpreter is and what it does.

It should be understood that an interpreter is a program or tool as the case may be embedded or integrated into a computer, thus giving it the name computer with interpreter. Now going back to defining waht an interpreter is, this is a computer program that directly executes scripted commands written in a programming language language without requiring them previously to have been compiled into a machine language program.

Now referring back to the question, since a level 1 instruction takes a k nano second which is equivalent to 1 billion of a second, then we will tend to loose a factor of n at each level such that the instruction execution time at level 2 (two), 3 (three), and 4 (four) are kn, kn^2, and kn^3 respectively.

User SpaceX
by
6.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.