Answer:
Refer below.
Explanation:
Because we are inserting commands to beq, we will need an execution of the ALU, and then a register write. This result in and increase cycle time of the PC relative branch:
440+90=530ps.
As it is the longest time to execute, so its a critical path
Explanation:
(a^2 + 3a +5) × (a + 7)
= a^3 + 7a^2 + 3a^2 + 21a + 5a + 35
= a^3 + 10a^2 + 26a + 35
Answer:
#include <iostream>
using namespace std;
int main()
{
int input = 0;
int count = 0;
int sum = 0;
int sumNegative = 0;
while (true) {
cout << "Enter a number: ";
cin >> input;
if (input == 0) break;
count++;
sum += input;
if (input < 0) {
sumNegative += input;
}
}
cout << "Count of the numbers: " << count << endl;
cout << "Sum of all the numbers: " << sum << endl;
cout << "Sum of the negative numbers: " << sumNegative << endl;
}
Explanation:
Your requirements regarding the sum and the negative numbers was a bit vague so I just did something you can probably adjust easily to your liking.