For the following code, answer the questions below.
{
for (i=0; i < 6; i++)
{ do
something}
}
In predicting the branch terminating the inner loop (located at the
end of the loop), answer the prediction success rate with the
following schemes. Assume 0 for NOT-TAKEN and 1 for TAKEN.
Question)) A prediction table of two-bit saturating counters (initial value = 00) indexed by PC
For the following code, answer the questions below. { for (i=0; i < 6; i++) ...
Ch04.4. [6 points] Branch Prediction. Consider the following sequence of actual outcomes for a single static branch. T means the branch is taken. N means the branch is not taken. For this question, assume that this is the only branch in the program. TTTNTNTTTNTNTTTNTN Assume that we try to predict this sequence with a Branch History Table (BHT) using one-bit counters. The counters in the BHT are initialized to the N state. Which of the branches in this sequence would...
Predictors Given the following piece of code below, compute the accuracies of the 1 bit and 2 bit predictors. Assume that the branch is taken if the "if" condition is met. The 1 bit predictor is initialized to 1 and the 2 bit predictor is initialized to 10. i-0; do1 if (i%2--?) { #Branch 1 if (i%2-1){ #Branch 2 }while (i<10000); #Branch 3 1 bit 2 bit Branch 1 Branch 2 Branch 3
Implement the following statements using MS430 assembly instructions. You may use more than one, but you should minimize the number of instructions required. You can use both native and emulated instructions. Use hex notation for all numbers 1. (a) Move the word located in register R14 to R15 (b) Increment the word in R6 by 2. (c) Perform a bitwise ANDing of the word located at address 0x0240 with the datum in R15, placing the results in R15. (d) Rotate...
In the MATLAB code below what does the line:
A(i) = 0;
do?
Is A(i) just a variable or does in index something?
P=1000; r=0.01; n=1; f for loop to calculate monthly interest and yearly interest for i=1:10 A(i)=0; for j=1:12 Am=P* (1+r)^n; P=Am; end A(i) = Am; end % display the amount compounded annually for 10 years i=1:10; table=[i', A']; disp('year Amount') fprintf('%2d %6.2f \n', table')
b. The following 68HC11 code forms part of a polling loop: LOOP LDAA PORTC ANDA #01 BNE LOOP do something More code The code is written to check if a door is closed using the circuit below: +5v To portC bit 0 (Isb) i. Describe the polling system operation i. Discuss why an interrupt system may be preferable and describe how you would implement an interrupt solution. Code not necessary. ii. If the system is already using an interrupt for...
Given the following pseudo code: Answer the following questions: What is the Big-0 order of the memory required by the algorithm? What is the Big-0 order of the operations required by the algorithm? How many times is the statement in the innermost loop executed, as a function of n? What are the best and worst case scenarios of order of operations of this algorithm?
8) Answer the following questions for the 4-function ALU described below: Si So Function 00 Pass A 0 1 A ORB 110 A B 11 A-1 a) What would the Boolean equations for the LE, AE, and CE be? b) Draw the circuit for only the lowest order bit, A, and Bo- c) Write the Behavioral VHDL code for an 8-bit version of the ALU described above.
whats the answers
For the following code, indicate how many times the loop body will execute for the following input values: 2 1 0? userNum - 3 while (userNum > 0) { // Do something // Get user um from input } 3 Given the following code, how many times will the inner loop body execute? int row: int col; for (row = 0; row < 2; row - row + 1) { for (col = 0; col < 3;...
I need a matlab code to answer the questions below
ICE09B Make an Array Develop a MATLAB code which will produce an array that looks like the following: 4 10 1. You must start with a blank array and build the array with a DNFL. You can NOT just load the array with an assignment statement. Hint: Use "addition" for your variables Square all values in the array 2. Blackboard will ask you for a screenshot of your properly working...
answer for all questions....
How do modern operating systems solve this? [3 marks] i) This is a snapshot of a page table and a translation look aside buffer (TLB) of an operating system (Assume that these are the only populated entries). Toble 1: Page Table Entry Virtual Page Page Frame Time Loaded Time R bit M bit number Referenced 2 0 60 161 0 1 1 1 130 0 160 1 2 26 162 0 1 30 3 20 163...