Question

In: Computer Science

This is a three-part question. If you want it piecemeal, then let me know. Assume that...

This is a three-part question. If you want it piecemeal, then let me know.

Assume that R31, R30, ... , R0 are the 32 ALU result bits output by our MIPS ALU.

a) Write down a logic expression for the Z (zero) flag that indicates when the result is zero as a function of these 32 result bits.

b) Write down a logic expression for an N (negative) flag that indicates whether the result is negative.

c) Suppose that there were four flags Z, N, V, and C (for zero, negative, overflow and carry). After the instruction sub  $t0,$t1,$t2 which subtracts $t2 from $t1 and places the result into $t0, what combination of the flags (Z, N, V, C) indicates that $t1 contains a value less than that in $t2? Write down the logic expression for LESS as a function of Z, N, V and C.  LESS = __________________

Solutions

Expert Solution

(a) zero (Z)flag is a status resistor that check for the result of an arithmetic operation is zero or not ,if the result is zero then the value of the flag is one(1) else value is zero(0)
we can check the status of zero flag using JZ(jump if zero).
example:

JZ label ;//jump to label if zero flag is set
label:....

(b) Negative (N) flag is also a status check resistor ,is check the value of an operation is negative or not ,when the result is negative then N flag is set(1) else it is zero(0).
we can check the status of zero flag using JS(Jump Sign (negative value)).

JS label ;//jump to label(memory location) if N flag is set
label:.....  

(c) we have subtraction s0=s1-s2;
And we have to check that the value of s1 is less then s2 or not.
So when s1 is less than s2 then value of s0 is negative and that we can check using Negative(N) flag ,when S0 is negative then the value of N flag is one(1)else it is zero(0).

SUB destination, source
  

code:
MOV A,s1
MOV B,s2
SUB A,B ;//this subtract s1-s2 and assign the result in A
JS label ;//if result of last operation is negative the move to label
label:....

overflow flag only affectec when 1.pos+pos = neg

2.neg+neg = pos

LESS=!Z && C && N


Related Solutions

This is a three-part question. If you want it piecemeal, then let me know. a) Why...
This is a three-part question. If you want it piecemeal, then let me know. a) Why do CISC processors tend to use micro-programming? b) Why do RISC processors not use micro-programming? c) What is the main advantage provided by a micro-programmed system?
7. Let us assume that what we want is to know whether the wines of the...
7. Let us assume that what we want is to know whether the wines of the designation of origin have the same alcoholic content, as well as their variability in the same, as those of another designation of origin, for example Baja California. It is a question of whether there is a clear differentiation in these two regions, because of the geographical proximity of the two regions, it is possible that there will be fraud and that wines from both...
Hello! Please let me know, thank you! You have a credit card with a balance of...
Hello! Please let me know, thank you! You have a credit card with a balance of $13,600 and an APR of 18 percent compounded monthly. You have been making monthly payments of $260 per month, but you have received a substantial raise and will increase your monthly payments to $335 per month. How many months quicker will you be able to pay off the account? 37.39 Months 36.05 Months 40.06 Months 11.71 Months 34.33 Months Thank you!
Let assume that you are going to purchase a house you know that the more space...
Let assume that you are going to purchase a house you know that the more space you have the more the house is going to cost. You decide to collect some data. square feet.           Price in kilo dollars 1400.                         200 1900.                         245 1900.                         260 2100.                         300 2250.                         310 1450.                         190 2300.                         400 3100.                         525 Simple linear regression: regression between one independent variable and a single independent variable. We can say the data has a positive correlation but what does that...
I would like you to let me know what you would do with the following case....
I would like you to let me know what you would do with the following case. You are the lead auditor for the accounting firm that audits Boeing that has had 2 recent crashes of its new Boeing 737 max jet. What would you do ?
This is an 8 Part Question. If you guys want to count it as 8 question...
This is an 8 Part Question. If you guys want to count it as 8 question on my chegg account please do so. I know it is long I just dont understand it The countries of Europe report that 46% of the labor force is female. The United Nations wonders if the percentage of females in the labor force is the same in the United States. Representatives from the United States Department of Labor plan to check a random sample...
Let me know what you believe to be the biggest health issue our nation is faced...
Let me know what you believe to be the biggest health issue our nation is faced with (beyond Covid-19).
Use the article to answer these questions. Let me know if you need more information. What...
Use the article to answer these questions. Let me know if you need more information. What question was asked? Summarize the main points of the article—what is the primary goal or aim of the described study? How was the question asked? Summarize the main methods used in the study. What did the authors find? Summarize the major results of the study. How does this article provide background information for quorum sensing in gingivitis? Some possible questions you could address…How does...
Let me know the effectiveness of the death penalty? Are there alternative punishments that would be...
Let me know the effectiveness of the death penalty? Are there alternative punishments that would be more effective than the death penalty?
Q2. Now that you know the answer to the above question, you decide that you want...
Q2. Now that you know the answer to the above question, you decide that you want to predict the amount of trash that all of them can pick up. You find strong correlations between certain data points and trash collected, and you want to develop a predictive model to see the result. Use the attached data (Trash data) to forma multiple regression model, and explain the usefulness of the model. Use the analysis tool in Excel to calculate the model...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT