Question

In: Computer Science

(12 pts) Suppose r0 = 0xFFFFFFFF, r1 = 0x00000001, r2 = 0x00000000 Initially N, Z, C,...

(12 pts) Suppose r0 = 0xFFFFFFFF, r1 = 0x00000001, r2 = 0x00000000 Initially N, Z, C, V flags are
zero. Find the value of the N, Z, C, V flags of the following instructions. (Assume each instruction
runs individually, i.e. these instructions are not part of a program.). Hint: This time remember
what the default flag are values for the N, Z, C, V flags. The default flag values might vary based
on the flag type.
• ADD r3, r0, r2
• SUBS r3, r0, r0
• ADDS r3, r0, r2
• LSL r3, r0, #1

4. (12 pts) Suppose r0 = 0x0F0F0F0F, and r1 = 0xFEDCBA98, find the result of the following
operations.
• ORR r3, r1, r0
• AND r3, r1, r0
• BFI r3, r1, #4, #8
• MVN r3, r1
ADD r3, r1, r3

Solutions

Expert Solution

(1) ADD r3,r0,r2 will perform the addition of r0 and r2 and store the result in r3.

the value of r3=0xFFFFFFFF. (N,Z,C,V are zero since the result is not negative,not zero,no carry and no overflow)

SUBS r3,r0,r0 performs the substraction of r0-r0 and store the result in r3 and the flags are updated.

r3= 0x00000000 (N=0,Z=1 since the result is zero,C=0 and V=0)

ADDS r3,r0,r2 will perform the addition of r0 and r2 and store the result in r3 and the flags are updated.

r3=0xFFFFFFFF. (N,Z,C,V are zero)

LSL r3, r0, #1 performs the Logical Left shift operation by 1 bit with flag update.

r3=0xFFFFFFFE( N,Z,C,V flags are zero)

(2) ORR r3, r1, r0 performs r1 OR r0 and store the result in r3.

r3= 0xFFDFBF9F

AND r3, r1, r0 performs r1 AND r0 and store the result in r3.

r3= 0x0E0C0A08

BFI r3, r1, #4, #8 performs bit field insert.

Replace bit 4 to bit 11 of r3 with bit 0 to bit 7 of r1.

r3=0xFFFFF98F

MVN r3, r1 performs the operation of writing bitwise inverse of r1 to r3.

r3=0x01234567

ADD r3, r1, r3 perform the addition of r1 and r3 and store the result in r3. Here value of r3 is taking as 0x01234567.

r3=0xFFFFFFFF

Calculations are attaching here as an image.


Related Solutions

Is the L(r1) = L(r2) where r1 = (ab*+c)(λ+∅) and r2 = (a+c)(b*+∅)? what are the...
Is the L(r1) = L(r2) where r1 = (ab*+c)(λ+∅) and r2 = (a+c)(b*+∅)? what are the languages of L(r1), L(r2)? show the definition's using regular expression, assume Σ = (a,b,c)
An experiment was set up with the circuit diagram shown. Assume R1 = 12 Ω, R2...
An experiment was set up with the circuit diagram shown. Assume R1 = 12 Ω, R2 = R3 = 6 Ω, r = 0 Ω and E = 6 V. (a) One of the steps to examine the set-up is to test points with the same potential. Which of the following points can be tested? points b, c, and dpoints d, e, and f    points f, h, and jpoints a, h, and i (b) At which three points should the currents...
Suppose r0=0x0F0F0F0F and r1=0xFEDCBA98, find the result of the following operations. Note that the below instructions...
Suppose r0=0x0F0F0F0F and r1=0xFEDCBA98, find the result of the following operations. Note that the below instructions are not part of a program. Each instruction runs independently, without influencing each other. i) EOR R4,R1,R0 ii) ORR R4,R1,R0
n the figure ε1 = 2.72 V, ε2 = 0.766 V, R1 = 6.82 Ω, R2...
n the figure ε1 = 2.72 V, ε2 = 0.766 V, R1 = 6.82 Ω, R2 = 1.61 Ω, R3 = 5.68 Ω, and both batteries are ideal. What is the rate at which energy is dissipated in (a) R1, (b) R2, and (c) R3? What is the power of (d) battery 1 and (e) battery 2?   
Find the constants a, b, c, d, e, r0, r1 for the ellipse r =15/(3−2cosθ) and...
Find the constants a, b, c, d, e, r0, r1 for the ellipse r =15/(3−2cosθ) and sketch the graph.
Suppose the term structure of interest rates has these spot interest rates: r1 = 6.9%. r2...
Suppose the term structure of interest rates has these spot interest rates: r1 = 6.9%. r2 = 6.7%, r3 = 6.5%, and r4 = 6.3%. a. What will be the 1-year spot interest rate in three years if the expectations theory of term structure is correct? (Do not round intermediate calculations. Enter your answer as a percent rounded to 1 decimal place.) 1-year spot in 3 years % b. If investing in long-term bonds carries additional risks, then how would...
(1 point) Suppose that R1={(2,2), (2,3), (2,4), (3,2), (3,3), (3,4)},R1={(2,2), (2,3), (2,4), (3,2), (3,3), (3,4)}, R2={(1,1),...
(1 point) Suppose that R1={(2,2), (2,3), (2,4), (3,2), (3,3), (3,4)},R1={(2,2), (2,3), (2,4), (3,2), (3,3), (3,4)}, R2={(1,1), (1,2), (2,1), (2,2), (3,3), (4,4)},R2={(1,1), (1,2), (2,1), (2,2), (3,3), (4,4)}, R3={(2,4), (4,2)}R3={(2,4), (4,2)} , R4={(1,2), (2,3), (3,4)}R4={(1,2), (2,3), (3,4)}, R5={(1,1), (2,2), (3,3), (4,4)},R5={(1,1), (2,2), (3,3), (4,4)}, R6={(1,3), (1,4), (2,3), (2,4), (3,1), (3,4)},R6={(1,3), (1,4), (2,3), (2,4), (3,1), (3,4)}, Determine which of these statements are correct. Check ALL the correct answers below. A. R3R3 is transitive B. R2R2 is not transitive C. R3R3 is reflexive D....
Suppose R1,R2,...,Rn are mutually independent and uniformly distributed random variables on [0,1]. Assume R(1) ≤ R(2)...
Suppose R1,R2,...,Rn are mutually independent and uniformly distributed random variables on [0,1]. Assume R(1) ≤ R(2) ≤···≤ R(n) are the order statistics of the R1,R2,...,Rn. It is given that 1 ≤ a < b ≤ n. What is the distribution of R(b)−R(a)?
#65 Suppose Z ~ N(0, 1), and P(Z < z) = 0.9750. Find z. Enter your...
#65 Suppose Z ~ N(0, 1), and P(Z < z) = 0.9750. Find z. Enter your exact value from Table A4. If you use Excel instead, enter your value rounded to 2 decimal places #89 Suppose X ~ N(10, 2), and P(X < x) = 0.5. Find x. Enter your exact numerical value. #90 Suppose X ~ N(11, 4). Find P(X > 3). Round your answer to 4 decimal places. #60 Suppose X ~ N(100, 2). Find P(X < 98)....
4.(12 pts) A 20,000 liter tank is initially half full with 10,000 liters of 2% nitric...
4.(12 pts) A 20,000 liter tank is initially half full with 10,000 liters of 2% nitric acid. A solution of 5% nitric acid is pumped in at a rate of 30 liters per minute and the well mixed mixture is pumped out at the same rate of 30 liters per minute. (a)(8 pts) Set up (But Don’t Solve) an IVP whose solution gives the amount of x(t) of pure nitric acid (in liters) in the tank at time t (b)(4...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT