Question

In: Computer Science

Two different compilers are being tested for a 4 GHz. machine with three different classes of...

Two different compilers are being tested for a 4 GHz. machine with three different classes of instructions: Class A, Class B, and Class C, which require one, two, and three cycles per instruction (respectively). Both compilers are used to produce code for a large piece of software. The first compiler's code uses 5 million Class A instructions, 1 million Class B instructions, and 1 million Class C instructions. The second compiler's code uses 10 million Class A instructions, 1 million Class B instructions, and 1 million Class C instructions. Which sequence will be faster according to MIPS? Which sequence will be faster according to execution time?

Solutions

Expert Solution

Frequency of the machine is 4 GHz.

So, 4*109 clock cycles require 1 second to execute.

Therefore, 1 clock cycle time will be = 0.25*10-9 seconds.

1st Compiler:

Total number of clock cycles to require to execute all instructions = 5*1 + 1*2 + 1*3 = 5 + 2 + 3 = 10 million clock cycles.

Therefore, the execution time of these instructions = 10*106*0.25*10-9 = 2.5*10-3 seconds or 2.5 ms.

Now, 2.5*10-3 seconds is required to execute a total of 7*106 instructions.

Therefore, in 1-second number of instructions executed = 7*106 / 2.5*10-3 = 2.8*109 instructions or 2800 MIPS

2nd Compiler:

Total number of clock cycles to require to execute all instructions = 10*1 + 1*2 + 1*3 = 10 + 2 + 3 = 15 million clock cycles.

Therefore, the execution time of these instructions = 15*106*0.25*10-9 = 3.75*10-3 seconds or 3.75 ms.

Now, 3.75*10-3 seconds is required to execute a total of 12*106 instructions.

Therefore, in 1-second number of instructions executed = 12*106 / 3.75*10-3 = 3.2*109 instructions or 3200 MIPS

According to MIPS, 2nd compiler is faster.

According to execution time, 1st compiler is faster.


Related Solutions

Two different formulations of an oxygenated motor fuel are being tested to study their road octane...
Two different formulations of an oxygenated motor fuel are being tested to study their road octane numbers. The population variance of road octane number for formulation 1 is =1.5, and for formulation 2, it is =1.2. Two random samples of size =15 and =20 are tested, and the mean road octane numbers observed are =89.6 and =92.5. Assume normality. a.) Construct a 95% two-sided confidence interval on the difference in mean road octane number. b.) If formulation 2 produces a...
Two different formulations of an oxygenated motor fuel are being tested to study their road octane...
Two different formulations of an oxygenated motor fuel are being tested to study their road octane numbers. The population variance of road octane number for formulation 1 is =1.5, and for formulation 2, it is =1.2. Two random samples of size =15 and =20 are tested, and the mean road octane numbers observed are =89.6 and =92.5. Assume normality. a.) Construct a 95% two-sided confidence interval on the difference in mean road octane number. b.) If formulation 2 produces a...
Two different formulations of an oxygenated motor fuel: formulation 01 and formulation 02, are being tested...
Two different formulations of an oxygenated motor fuel: formulation 01 and formulation 02, are being tested to study their road octane numbers. Two random samples of size n1=15 and n2=20 are tested, and the sample mean road octane numbers observed are 89.6 and 92.5. The sample standard deviations are 1.2 and 1.1. The two formulations are independent. The objective of the study is to test if there is a significant difference between the two formulations. What is the type of...
3. Three different treatments for hypertension (high blood pressure) are being tested. A medical researcher takes...
3. Three different treatments for hypertension (high blood pressure) are being tested. A medical researcher takes volunteers and randomly assigns them into groups taking treatment A, B, and C. The reduction in blood pressure is measured for each patient with the following results: > d patient treatment reduction 1 1 A 7.0 2 2 A 7.9 3 3 A 5.0 4 4 A 8.3 5 5 A 3.3 6 6 A 2.8 4 7 7 A 3.9 8 8 A...
A machine that is programmed to package 4.35 pounds of cereal is being tested for its...
A machine that is programmed to package 4.35 pounds of cereal is being tested for its accuracy. In a sample of 81 cereal boxes, the sample mean filling weight is calculated as 4.35 pounds. The population standard deviation is known to be 0.09 pound. Use Table 1.    a-1. Identify the relevant parameter of interest for these quantitative data. The parameter of interest is the average filling weight of all cereal packages. The parameter of interest is the proportion filling...
A machine that is programmed to package 4.10 pounds of cereal is being tested for its...
A machine that is programmed to package 4.10 pounds of cereal is being tested for its accuracy. In a sample of 49 cereal boxes, the sample mean filling weight is calculated as 4.15 pounds. The population standard deviation is known to be 0.15 pound. [You may find it useful to reference the z table.] a-1. Identify the relevant parameter of interest for these quantitative data. (multiple choice) a) The parameter of interest is the proportion filling weight of all cereal...
A machine that is programmed to package 6.20 pounds of cereal is being tested for its...
A machine that is programmed to package 6.20 pounds of cereal is being tested for its accuracy. In a sample of 36 cereal boxes, the sample mean filling weight is calculated as 6.29 pounds. The population standard deviation is known to be 0.13 pound. [You may find it useful to reference the z table.] a-1. Identify the relevant parameter of interest for these quantitative data. The parameter of interest is the average filling weight of all cereal packages. The parameter...
A machine that is programmed to package 1.70 pounds of cereal is being tested for its...
A machine that is programmed to package 1.70 pounds of cereal is being tested for its accuracy. In a sample of 25 cereal boxes, the sample mean filling weight is calculated as 1.78 pounds. The population standard deviation is known to be 0.04 pound. [You may find it useful to reference the z table.] a-1. Identify the relevant parameter of interest for these quantitative data. The parameter of interest is the average filling weight of all cereal packages. The parameter...
A machine that is programmed to package 1.90 pounds of cereal is being tested for its...
A machine that is programmed to package 1.90 pounds of cereal is being tested for its accuracy in a sample of 53 cereal boxes, the sample mean filling weight is calculated as 1.92 pounds. The population standard deviation is known to be 0.06 pounds. Find the 95% confidence interval for the population mean filling weight. [1.9038, 1.9362] [1.8219, 1.9567] [1.8646, 1.9800] [1.8449, 1.9969]
A machine that is programmed to package 3.60 pounds of cereal is being tested for its...
A machine that is programmed to package 3.60 pounds of cereal is being tested for its accuracy. In a sample of 81 cereal boxes, the sample mean filling weight is calculated as 3.68 pounds. The population standard deviation is known to be 0.08 pound. [You may find it useful to reference the z table.] a-1. Identify the relevant parameter of interest for these quantitative data. Which one? The parameter of interest is the proportion filling weight of all cereal packages....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT