What is the speedup of going from a 1-issue processor to a 2-issue processor? use your code from part a for both 1-issue and 2-issue, and assume that 1,000,000 iterations of the loop are executed. as in part b, assume that the processor has perfect branch predictions, and that a 2-issue processor can fetch any two instructions in the same cycle?

Answers

Answer 1
Answer: I think it is sped up by around 0.6 GHz

Related Questions

Assume you're running a query on your orders in the past year. You want to see how many orders were placed after May. What type of query would you use to find this data? A. SelectB. RangeC. ComplexD. Parameter
Write a program that accepts a four digit number, such as 1998, and displays it on number on a line, like: 1 9 9 8 The program should prompt for a four digit number. The program assumes that the user enters the correct information. Provide the java code, including a comment with your name, course code and date.
How does abstraction help us write programs
How many times will the following loop display "Looping again!"? for(int i=0; i<=20; i++) cout << "Looping again!" << endl;
An objective function in linearprogramming is a(n):decisionvariable.environmentvariable.resultvariable.independentvariable.constant.

g Write a line of code to invoke a function named RandNum, which accepts no parameters, and storing the return value in a variable called num (which has already been defined). Separate each item with 1 space (except around the parentheses), and end the line with a semi-colon.

Answers

Answer:

public int RandNum();

* Assuming it returns an integer

Explanation:

I believe you mean to write the function header of randNum.

To write the header of the function, we need to specify its return type, name, parenthesis and parameters inside the parenthesis - if exist.

If it returns an integer it should have int, if it returns a double it should have double in the header. In the answer, I assumed it returns an integer.

The name is already given, RandNum

Since, the function does not take any parameter, inside of the parenthesis will be empty.

On React1) Create counter and an increment button, default value of the counter would be 1, clicking on increment button adds 5 to the counter. The max value of the counter would be 20, after reaching this value , counter would not increment. Add a reset button which would set the counter value to 1.
[8:53 PM]
2) Create a button with label “true” , clicking on the button toggle the value from “true” => “false” and “false” => “true”.(edited)

techsith (patel) — 03/03/2021
3) Create a counter and a button. clicking on the button increments the counter by one. double clicking on the button resets the counter to 0

Answers

Answer:too many words ahhh

Explanation:

(assuming jsx)

function Buttons (props) {

return(

{props.counterValue}

counter

increment

reset

);

}

var counterValue = 1;

function addup(a){

if(counterValue + a <= 20){

counterValue += a;

} else if (counterValue + a > 20){

//do nothing

}

ReactDOM.render(

 ,

 document.getElementById('root')

);

}

function reset() {

counterValue = 1;

ReactDOM.render(

 ,

 document.getElementById('root')

);

}

A vowel word is a word that contains every vowel. Some examples of vowel words are sequoia, facetious, and dialogue. Determine if a word input by the user is a vowel word.

Answers

Answer:

vowels = ("a", "e", "i", "o", "u")

word = input("Enter a word: ")

is_all = True

for c in vowels:

   if c not in word:

       is_all = False

if is_all == True:

   print(word + " is a vowel word.")

else:

   print(word + " is not a vowel word.")

Explanation:

Initialize a tuple, vowels, containing every vowel

Ask the user to enter a word

Initially, set the is_all as True. This will be used to check, if every vowel is in word or not.

Create a for loop that iterates through the vowels. Inside the loop, check if each vowel is in the word or not. If one of the vowel is not in the vowels, set the is_all as False.

When the loop is done, check the is_all. If it is True, the word is a vowel word. Otherwise, it is not a vowel word.

Write a statement that assigns total_coins with the sum of nickel_count and dime_count. Sample output for 100 nickels and 200 dimes is: 300

Answers

The statement which gives the sum of nickel and dime is written below :

total_coins = nickel_count + dime_count

The statement required is written using Python 3 :

  • We could write these as a function :

deftotal(nickel_count, dime_count) :

total_coins =dime_count+nickel_count

print(total_coins)

total(100, 200)

#the function total takes in two arguments(number of nickels and number of dimes)

#assigns the varibale total_coins to the sum of nickel_count and dime_count

  • We could also write this in the form of a program which prompts users to enter values :

nickel_count = int(input('Enter count of nickel : '))

# User is prompted to enter number of nickels

dime_count = int(input('Enter count of dime : '))

# User is prompted to enter number of dimes

total_coins = nickel_count + dime_count

#assigns the varibale total_coins to the sum of nickel_count and dime_count

print(total_coins)

#outputs the value of total_coins

Learn more : brainly.com/question/17615351

Answer:

total_coins = nickel_count + dime_count

Explanation:

The statement that performs the operation in the question is total_coins = nickel_count + dime_count

Full Program (Written in Python)

nickel_count = int(input("Nickel Count: "))

dime_count = int(input("Dime Count: "))

total_coins = nickel_count + dime_count

print("Total coins: ",total_coins)

The first two lines prompt user for nickel and dime count respectively

The third line adds the two coins categories together

The last line prints the total count of coins

This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width.(1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt)
(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)
(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)
(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width. (1 pt)
while (arrowHeadWidth <= arrowBaseWidth) {
// Prompt user for a valid arrow head value
}
Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:
Enter arrow base height:
5
Enter arrow base width:
2
Enter arrow head width:
4

**
**
**
**
**
****
***
**
*
This is what I have:
import java.util.Scanner;
public class DrawHalfArrow
{
public static void main(String[] args)
{
Scanner scnr = new Scanner(System.in);
int arrowBaseHeight = 0;
int arrowBaseWidth = 0;
int arrowHeadWidth = 0;
System.out.println("Enter arrow base height:");
arrowBaseHeight = scnr.nextInt();
System.out.println("Enter arrow base width:");
arrowBaseWidth = scnr.nextInt();
while (arrowHeadWidth >= arrowBaseWidth)
{
System.out.println("Enter arrow head width:");
arrowHeadWidth = scnr.nextInt();
}
// Draw arrow base (height = 3, width = 2)
for(int i=0; i < arrowBaseHeight; ++i)
{
for(int j=0; j < arrowBaseWidth; ++j)
{
System.out.print("*");
}
System.out.println();
}
// Draw arrow head (width = 4)
for(int i=0; i < arrowHeadWidth; ++i)
{
for(int j=0; j < arrowHeadWidth-i; ++j)
{
System.out.print("*");
}
System.out.println();
}
return;
}
}

Answers

Answer:

The modified program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

 int arrowHeadWidth, arrowBaseWidth, arrowBaseHeight;

 System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();

 System.out.print("Base Height: "); arrowBaseHeight = input.nextInt();

 while (arrowHeadWidth <= arrowBaseWidth) {

       System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();      }

 for(int i = 0; i<arrowBaseHeight; i++){

     for(int j = 0; j<arrowBaseWidth;j++){

         System.out.print("*");        }

         System.out.println();    }

 for(int i = arrowHeadWidth; i>0;i--){

     for(int j = 0; j<i;j++){

         System.out.print("*");        }

         System.out.println();    }

}

}

Explanation:

This declares the arrow dimensions

 int arrowHeadWidth, arrowBaseWidth, arrowBaseHeight;

This get input for the head width

 System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

This get input for the base width

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();

This get input for the base height

 System.out.print("Base Height: "); arrowBaseHeight = input.nextInt();

This loop is repeated until the head width is greater than the base width

 while (arrowHeadWidth <= arrowBaseWidth) {

       System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();      }

This iterates through the base height

 for(int i = 0; i<arrowBaseHeight; i++){

This iterates through the base width

     for(int j = 0; j<arrowBaseWidth;j++){

This fills the base

         System.out.print("*");        }

This prints a new line

         System.out.println();    }

These iterate through the arrow head

 for(int i = arrowHeadWidth; i>0;i--){

     for(int j = 0; j<i;j++){

This fills the arrow head

         System.out.print("*");        }

This prints a new line

         System.out.println();    }

Write a program that removes all non-alpha characters from the given input. Ex: If the input is: -Hello, 1 world$! the output is: HelloworldAlso, this needs to be answered by 11:59 tonight.

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in a string as a parameter, loops through the string and checks if each character is an alpha char. If it is, then it adds it to an output variable and when it is done looping it prints the output variable. A test case has been provided and the output can be seen in the attached image below.

def checkLetters(str):

   output = ''

   for char in str:

       if char.isalpha() == True:

           output += char

   return output