The instructions of a program can be categorized into three

The instructions of a program can be categorized into three types, A, B, and C. Type A consists of 10 instructions. Type B consists of 15 instructions, and Type C consists of 75 instructions. In the Instruction set, each instruction takes the same amount of time to execute. The entire program takes 100 seconds to run. a) What is the improved execution time if the Type C instructions are improved by a factor of 3? b) What is the improved execution time if both Type A and Type B instructions are improved by a factor of 5?

Solution

From the question, there are 3 types of instructions (A-10, B-15 and C-75). Total time taken by the program (which is equal to sum of all the instructions time) is 100 sec.

Since, each instruction set takes equal amount of time to execute (as per question), each of the instructions of type A, B and C take 1 second for execution.

a) If type C insturctions are improved by a factor of 3,

Time taken by the C instructions come down by 3. It means the time taken would reduce from 75 to (75/3) = 25.

Total time of the program = 10 (A)+ 15 (B) + 25 (C-updated) = 50

b) If type A and type B are factored by 5,

Time taken by the A and B instructions will come down by 5. It means the time taken would reduce from 10 and 15 to (10/5) and (15/5) for A and B respectively.

Time taken by the program = 2 (A-updated) + 3 (B-updated) + 75 = 80

 The instructions of a program can be categorized into three types, A, B, and C. Type A consists of 10 instructions. Type B consists of 15 instructions, and Typ

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site