14.06.2020

Suppose a program contains 500 million instructions to execute on a processor running on 2.2 GHz. Half of the instructions takes 3 clock cycles to execute, where rest of the instructions take 10 clock cycle. What is the execution time of the program

. 0

Step-by-step answer

24.06.2023, solved by verified expert
Unlock the full answer

1.48 s

Explanation:

Number of instructions = 500 million = 500 * 10⁶

clock rate = 1 / 2.2 GHz = 1 / (2.2 * 10⁹ Hz) = 0.4545 * 10⁻⁹ s

We need to compute the clocks per instruction (CPI)

The CPI = summation of (value * frequency)

CPI = (50% * 3 clock cycles) + (50% * 10 clock cycles)

CPI = (0.5 * 3) + (0.5 * 10) = 1.5 + 5 = 6.5

Execution time = number of instructions * CPI * clock rate

Execution time = 500 * 10⁶ * 6.5 * 0.4545 * 10⁻⁹ =1.48 s

It is was helpful?

Faq

Computers and Technology
Step-by-step answer
P Answered by PhD

1.48 s

Explanation:

Number of instructions = 500 million = 500 * 10⁶

clock rate = 1 / 2.2 GHz = 1 / (2.2 * 10⁹ Hz) = 0.4545 * 10⁻⁹ s

We need to compute the clocks per instruction (CPI)

The CPI = summation of (value * frequency)

CPI = (50% * 3 clock cycles) + (50% * 10 clock cycles)

CPI = (0.5 * 3) + (0.5 * 10) = 1.5 + 5 = 6.5

Execution time = number of instructions * CPI * clock rate

Execution time = 500 * 10⁶ * 6.5 * 0.4545 * 10⁻⁹ =1.48 s

Computers and Technology
Step-by-step answer
P Answered by PhD
Answer: c. internet of things.

Explanation:
The technology that combines with the 5G capabilities which was used in the monitoring of the shopping trends is the Internet of Things.
- Internet of Things (IoT) simply means when there are interrelated, and internet-connected objects which collects and transfers data without human intervention through a wireless network or makes use of sensors.
- This is being used by the retailer in the example given to monitor the shopping trends. In conclusion, the correct option is Internet of Things.
Computers and Technology
Step-by-step answer
P Answered by Master
When one encounters another vessel and assess the situation and believes that you are the stand-on vessel, You should still maintain your course unless the give-away vessel or vessel you have encountered is not taking appropriate actions, what you should do is, you should take action and move away from the vessel, do not go toward the vessel nor pass in front of it.
Computers and Technology
Step-by-step answer
P Answered by PhD

boolean rsvp;

int selection;

String option1;

String option2;

(a) if(rsvp){

System.out.println("Attending");

} else {

System.out.println("Not attending");

}

(b) if (selection == 1){

System.out.println("Beef");

} else if (selection == 2){

System.out.println("Chicken");

} else if (selection == 3) {

System.out.println("Pasta");

} else {

System.out.println("Fish");

}

(c) switch(selection){

case 1:

if(rsvp){

option1 = "Thanks for attending. You will be served beef.";

} else{

option1 = "Sorry you can't make it";

}

break;

case 2:

if(rsvp){

option1 = "Thanks for attending. You will be served chicken.";

} else{

option1 = "Sorry you can't make it";

}

break;

case 3:

if(rsvp){

option1 = "Thanks for attending. You will be served pasta.";

} else{

option1 = "Sorry you can't make it";

}

break;

default:

if(rsvp){

option1 = "Thanks for attending. You will be served fish.";

} else{

option1 = "Sorry you can't make it";

}

break;

}

(d) if (option1 == option2){

System.out.println("True");

} else {

System.out.println("False");

}

Explanation:

This code snippet is written in Java.

a) Uses if statement to print "attending" if rsvp is true and "not attending" if rsvp is false.

b) Uses if-else statement to print the variety of food based on user selection. If selection is 1, it print beef. If selection is 2, it print chicken. If selection is 3, it prints pasta else it print fish for any other value of selection.

c) Uses switch statement to determine the value of selection and then uses inner if statement to assign "Thanks for attending. You will be served beef." if rsvp is true to option1. The value of beef changes depending on the value of selection. If rsvp is false, then "Sorry you can't make it." is assigned to option1.

d) Uses if statement to print true if option1 and option2 are equal else it print false.

Computers and Technology
Step-by-step answer
P Answered by Master
Answer options:
a. Cleaning a data visualization to remove unwanted patterns.
b. Iteratively creating visualizations to ask and answer new questions.
c. Cleaning data to remove inconsistencies.
d. Filtering the data to look at the responses from only certain groups.

Answer: is correct d. Filtering the data to look at the responses from only certain groups.
Computers and Technology
Step-by-step answer
P Answered by Master

Question:

When multiple team members are working on a related feature, how often should they integrate their work

Select only one answer.

A) Do the integration midway through the iteration.

B) After they reach a logical end of creating the functionality.

C) In a scheduled daily (or multiple times in a day) frequency.

D) In a scheduled weekly (or multiple times in a week) frequency.

The best option is D.

Explanation:

Multiple integrations per day may become too cumbersome. Leaving the various parts of the project until a logical end for a functionality has been reached may create room for a lot of errors thus resulting in time wasted.

To ensure regular course correction (if required), twice a week would suffice.

Cheers!

Computers and Technology
Step-by-step answer
P Answered by Master

Yes, Bob is correct that only 8 months is required to pay off the amount of $200 for the ticket.

Given that,

The charge for the plane ticket for the last month is $200.The minimum balance required is $25.And, the number of months given is 8.

Based on the above information, the calculation is as follows:

= $25 × 8 months

= $200

Therefore we can conclude that yes, Bob is correct that only 8 months is required to pay off the amount of $200 for the ticket.

Learn more: link

Computers and Technology
Step-by-step answer
P Answered by Master

(1)

public int getPlayer2Move(int round)

{

  int result = 0;

 

  //If round is divided by 3

  if(round%3 == 0) {

      result= 3;

  }

  //if round is not divided by 3 and is divided by 2

  else if(round%3 != 0 && round%2 == 0) {

      result = 2;

  }

  //if round is not divided by 3 or 2

  else {

      result = 1;

  }

 

  return result;

}

(2)

public void playGame()

{

 

  //Initializing player 1 coins

  int player1Coins = startingCoins;

 

  //Initializing player 2 coins

  int player2Coins = startingCoins;

 

 

  for ( int round = 1 ; round <= maxRounds ; round++) {

     

      //if the player 1 or player 2 coins are less than 3

      if(player1Coins < 3 || player2Coins < 3) {

          break;

      }

     

      //The number of coins player 1 spends

      int player1Spends = getPlayer1Move();

     

      //The number of coins player 2 spends

      int player2Spends = getPlayer2Move(round);

     

      //Remaining coins of player 1

      player1Coins -= player1Spends;

     

      //Remaining coins of player 2

      player2Coins -= player2Spends;

     

      //If player 2 spends the same number of coins as player 2 spends

      if ( player1Spends == player2Spends) {

          player2Coins += 1;

          continue;

      }

     

      //positive difference between the number of coins spent by the two players

      int difference = Math.abs(player1Spends - player2Spends) ;

     

      //if difference is 1

      if( difference == 1) {

          player2Coins += 1;

          continue;

      }

     

      //If difference is 2

      if(difference == 2) {

          player1Coins += 2;

          continue;

      }

     

     

  }

 

  // At the end of the game

  //If player 1 coins is equal to player two coins

  if(player1Coins == player2Coins) {

      System.out.println("tie game");

  }

  //If player 1 coins are greater than player 2 coins

  else if(player1Coins > player2Coins) {

      System.out.println("player 1 wins");

  }

  //If player 2 coins is grater than player 2 coins

  else if(player1Coins < player2Coins) {

      System.out.println("player 2 wins");

  }

}

Try asking the Studen AI a question.

It will provide an instant answer!

FREE