Question

In: Computer Science

Variable Register a $9 b $19 c $2 C Operators + add - subtract & bitwise...

Variable Register a $9 b $19 c $2

C Operators + add - subtract & bitwise and ! bitwise or ~ bitwise not

Assume the variables, a, b and c are stored in the registers given above. Give a single MIPS assembly instruction from the MIPS Core Instruction Set that performs the equivalent operation for each of the following C

statements. a = ~ ( b | c ); // MIPS equivalent: --------

c = b - 2; // MIPS equivalent: ----------

b = a & 0x100F; // MIPS equivalent:----------

Solutions

Expert Solution

)

1.a=~(b|c)

lw      $3,4($fp)

        lw      $2,8($fp)

        or      $2,$3,$2

        nor     $2,$0,$2

        sw      $2,0($fp)

2.c=b-2

lw      $2,4($fp)

        addiu   $2,$2,-2

        sw      $2,8($fp)

3.b = a & 0x100F

lw      $2,0($fp)

        andi    $2,$2,0x100f

        sw      $2,4($fp)


Related Solutions

Data Encryption (Strings and Bitwise Operators) Write a C program that uses bitwise operators (e.g. bitwise...
Data Encryption (Strings and Bitwise Operators) Write a C program that uses bitwise operators (e.g. bitwise XOR) to encrypt/decrypt a message. The program will prompt the user to select one of the following menu options: 1. Enter and encrypt a message 2. View encrypted message 3. Decrypt and view the message (NOTE: password protected) 4. Exit If the user selects option 1, he/she will be prompted to enter a message (a string up to 50 characters long). The program will...
C++ For this assignment, you will write a C++ program to either add (A), subtract (S),...
C++ For this assignment, you will write a C++ program to either add (A), subtract (S), multiply (M), and (N), or (O) two matrices if possible. You will read in the dimensions (rows, then columns) of the first matrix, then read the first matrix, then the dimensions (rows then columns) of the second matrix, then the second matrix, then a character (A, S, M, N, O) to determine which operation they want to do. The program will then perform the...
ARITHMETIC INSTRUCTIONS a) ADD with register/memory       ADD r [or] ADD M b) ADD immediate.      ...
ARITHMETIC INSTRUCTIONS a) ADD with register/memory       ADD r [or] ADD M b) ADD immediate.       ADI 8 bit data c) ADD with carry       ADC r [or] ADC M Exercise 1: Write Assembly Language Program to add any 3 numbers. Exercise 2: Write Assembly Language Program to add the value 05H with value stored in register C.
Must make a "Calculator" using C. The calculator must subtract, add, divide, and multiply inputs, and...
Must make a "Calculator" using C. The calculator must subtract, add, divide, and multiply inputs, and tell whether a number is prime or not. The user chooses how many inputs go into the calculator. For example, the code will ask the user what function they want. If the user chooses to subtract, the the code will then ask the user how many numbers they want to subtract. After, the code will ask the user to input as many numbers as...
Write a python program to display a menu with the following options: (1) add, (2) subtract,...
Write a python program to display a menu with the following options: (1) add, (2) subtract, (3) multiply, (4) divide (5) mod, and (6) do nothing. I f the user enters something else (except 1-6), the program should display an error message. Otherwise, it should ask the user for two numbers, perform the calculation, and display the result.
C++ Program Overload the following operators to work with the Rational class and add test cases...
C++ Program Overload the following operators to work with the Rational class and add test cases in the driver program. Make sure your driver program now tests each of these symbols for your Rational Class. + – * / == != < <= > >= << (stream insertion operator, use the toString function) >> (stream extraction operator) Make sure you test all 12 operators Example Run (Bold is input), everything else is a print statement using the overloaded operators Enter...
using c language: Add two vectors of doubles. Name this function vect_add(). Subtract two vectors of...
using c language: Add two vectors of doubles. Name this function vect_add(). Subtract two vectors of doubles. Name this function vect_sub(). Multiplies element by element two vectors. Name this function vect_prod(). Compute and return the dot product of two vectors. Name this function vect_dot_prod(). The dot product operation is the result of taking two vectors(single dimension arrays) and multiplying corresponding element by element and then adding up the sum of all the products. For example, if I have 2 vectors...
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to...
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to decimal and confirm: 110110 + 111000 001100 – 011100
First prove A and B to be Hermitian Operators, and then prove (A+B)^2 to be hermitian...
First prove A and B to be Hermitian Operators, and then prove (A+B)^2 to be hermitian operators.
a = [4, −9, 4] b = [7, 2, 3] c = [5, −8, 9] d...
a = [4, −9, 4] b = [7, 2, 3] c = [5, −8, 9] d = [1, −3, 2] e = [6, −2, −5, 9] f = [4, −3, 7, 5] g = [1, 3, −1, 5] h = [7, −5, 5] i = [5, 13, −7, 11] Express the hyperplane implicitly or explicitly given the following a) a and h b) f and i c) e, f, and g d) The hyperplane containing b, c and d can...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT