1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Shalnov [3]
3 years ago
14

You are evaluating three branch prediction strategies: (1) predict always taken, (2) predict always not taken and (3) use the 2-

bit branch predictor. Experimentally, your measurements show that conditional branches account for 20% of all instructions and 70% of all branches are taken. The 2-bit predictor has an accuracy of 70%. Assuming that the penalty of a mis-prediction is 4 cycles and 0 cycles for a correct prediction, compute the average stall cycles per instruction of the three strategies.
Computers and Technology
1 answer:
Shkiper50 [21]3 years ago
6 0

Solution :

The penalty of the misprediction = 4 cycles

The conditional branches of instructions = 20%

The Branch taken is  = 70%

2-bit predictor accuracy is = 70%

1). The predict always taken

   The stall only for the conditional instruction for which branch is not taken.

    Stalls = $0.2 \times (1-0.7) \times 4$

             $= 0.2 \times 0.3 \times 4$

             = 0.24 cycles

2). The predict not always taken

   The stall only for the conditional instruction for which branch is taken.

    Stalls  $= 0.2 \times 0.7 \times 4$

             = 0.56 cycles

3). The 2- bit predictor

   The stalls $= 0.2 \times (0.7 \times 0.3\times 4+0.3 \times 0.3\times 4)$

                    = 0.2 x 1.2

                    = 0.24 cycles

You might be interested in
When using a public computer or network, you should always _______. A. install a firewall. B. run an anti-virus program beforeha
SpyIntel [72]
Answer is c log out of any sites you have logged into ..bc it's a public computer
5 0
3 years ago
Read 2 more answers
Which unique address is a 128-bit address written in hexadecimal?
pentagon [3]
Every hexadecimal digit represents 4 bits, so the address has 128/4 = 32 digits.

A GUID (Globally Unique IDentifier) has 128 bits. They are usually written like this:

{38a52be4-9352-4<span>53e-af97-5c3b448652f0}.</span>

There are different types of guids, depending on how they are generated. The first digit of the third group reveals the type. In the example above it is 4. A type 4 guid is fully random (except of course for the 4).

3 0
3 years ago
Lesson 3 - Calling All Operators
Tresset [83]

Answer:

.m

Explanation:

3 0
3 years ago
Write a program that takes paragraph from the user and prints all unique words in that paragraph using strings in c++
Bezzdna [24]

Answer:

void printUniquedWords(char filename[])

void printUniquedWords(char filename[]) {

void printUniquedWords(char filename[]) {     // Whatever your t.text file is

    fstream fs(filename);

    fstream fs(filename);   

    fstream fs(filename);       

    fstream fs(filename);           map<string, int> mp;

    fstream fs(filename);           map<string, int> mp;   

    fstream fs(filename);           map<string, int> mp;       // This serves to keep a record of the words

    string word;

    string word;     while (fs >> word)

    string word;     while (fs >> word)     {

    string word;     while (fs >> word)     {         // Verifies if this is the first time the word appears hence "unique word"

        if (!mp.count(word))

        if (!mp.count(word))             mp.insert(make_pair(word, 1));

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }   

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();   

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)             cout << p->first << endl;

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)             cout << p->first << endl;     }

        if (!mp.count(word))             mp.insert(make_pair(word, 1));         else             mp[word]++;     }       fs.close();       // Traverse map and print all words whose count     //is 1     for (map<string, int> :: iterator p = mp.begin();          p != mp.end(); p++)     {         if (p->second == 1)             cout << p->first << endl;     } }

5 0
3 years ago
What do the points on this website do?
DanielleElmas [232]

Answer:

They allow you to ask more questions and also your rank goes up or down.

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • You discover memory is corrupted, what would be an indication of a software vs. a hardware issue?
    5·1 answer
  • Which of the following is a valid SQL statement? a. c.customer#, order#, orderdate, shipdate FROM customers c NATURAL JOIN order
    13·1 answer
  • The scope of a variable declared within a for() loop is:
    6·1 answer
  • If you're able to understand directions more easily when you hear them instead of reading them you are most likely
    12·1 answer
  • Jess and Ann have decided to exchange messages using the Caesar cipher. If the predetermined key is seven places to the left, th
    10·1 answer
  • Use of the Internet for recruiting is: a. popular with job seekers, but not recruiters. b. the most commonly used search tactic
    5·1 answer
  • ________ development is the term used to describe an information system development methodology that emphasizes flexibility and
    11·1 answer
  • Computers have small bumps on the keyboards that enable persons to type without looking at the keyboard. These letters are:
    6·2 answers
  • Difference between customized and packaged software​
    10·1 answer
  • A user may enter some text and the number of times (up to a maximum of 10) to repeat it. Display the text repeated that many tim
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!