lw $t0, 4($s1) => $t0 <= V (copying value from address 80000+4 = 80004 i.e. V to temporary register t0)
lw $t1, 8($s1) => $t1 <= W (copying value from address 80000+8 = 80008 i.e. W to temporary register t1)
lw $t2, 12($s1) => $t2 <= X (copying value from address 80000+12 = 80012 i.e. X to temporary register t2)
lw $t3, 16($s1) => $t4 <= Y (copying value from address 80000+16 = 80016 i.e. Y to temporary register t3)
sub $t0, $t0, $t1 => $t0 <= V - W (subtracting value of t1 from t0 and storing back result to t0)
add $t2, $t2, $t3 => $t2 <= X + Y (adding value of t2 into t3 and storing back result to t2)
mul $t0, $t0, $t2 => $t0 <= (V - W)(X + Y) (multiplying value of t0 with t2 and storing back result to t0)
sw $t0, 24($s1) => Z <= (V - W)(X + Y)
=> Storing back result to address 80000+24 = 80024 i.e. Z
Implement the following command as an assembly language. Z=(V-W)(X+Y) Address : $s1 →80000 V→80004 W→80008 X→80012...
What is the assembly language equivalent of each of the following binary machine language instructions? When answering, use w as the label for address 6, x as the label for address 225, y as the label for address 240 and z as the label for address 14. a) 1100 0000 1111 0000 b) 0011 0000 0000 1110
Question 3 (10 points) Convert the following MIPS assembly code into machine language. Write the instruction in hexadecimal. The opcode for sw 43 (101011). sw St1, -4(St3) Question 4 (10 points) Consider the following MIPS assembly code: addi $s3, $0, 5 addi $s1, S0, 3 addi Ss1, $s1, 2 beq Ss3, Ssl, target addi Ss1, Ss1, 1 target: add Ss3, Ss1, Ssl a. After running the code, what is the value of Ss3? b. If the memory address of the...
I would like to know if the SOP function f(v,w,x,y,z)=(x+z)(w+y)(!w+x+!y)(!y+z+!v) and The Quartus II obtained function F(v,w,x,y,z)=(v((!x(z(!w xor (!y))))+(x((!y(w))+(y((z)))))))+(!v((!x(z(!w xor (!y))))+(x(((y))+(w))))) for the above SOP are equivalent?
(10 points) Translate the following algorithm into assembly language. IF 65 < X THEN X = 9+(X^2) ELSE X = - Y 3. (10 points) Translate the following algorithm into assembly language. X=0 FOR K = I TO 5 X=X+5 END_FOR 4. (10 points) Translate the following algorithm into assembly language. X=0 Y=5 Z=5 WHILE Z = 5 X=X+1 Y=Y-1 Z=X+Y 2. (10 points) Translate the following algorithm into assembly language. IF65 < X THEN X = 9t(X^2) ELSE X...
Assembly language (MIPS) Let register $8 be x and register $9 be y. Write a program to evaluate: Z = 3x - 5y+5 Leave the result in register $10. Inspect the register after running the program to check that the program works. Run the program several times, initialize x and y to different values for each run.
1) Convert the following C code into MIPS assembly For (b-0; b<N, ++b) C-Z[b] If (Z[b]>W) W-Z[b] note: assign array Z, integers C and integer W to registers $SO, $S1, $S2 respectively. Put comments for each assembly line to explain its purpose.
Let A-g's, u, v, w, x, y, z), B {q, s, y, z,C-{v, w, x, y, z), and D-6. Specify the following set. 9) Cu B 10) An B
(f) and (g) please f and g please letters Question 2 Indirect addressing mode in assembly language is sanilar to pointers in C. Answer the following questions: (1 point) a) How many 8-bit registers can a FSR access in the PICI8F452 MCU? b) Write the assembly language command to load the address of the variable with name: PVal into one of the FSR? (2 points) (2 points) (2 points) c) What is the meaning of: movf PREINC2, F? d) What...
Implement a simple four function calculator in the LC3 assembly language that will run on the LC-3 simulator. The LC-3 computer only reads a character at a time but is capable of displaying a string of characters. This calculator program will use multiple subroutines that perform purposes such as reading multi-digit numbers, converting them to integers, performing addition, subtraction, multiplication, or division on these numbers, and displaying the result. The inputs to the calculator will not exceed 4 digits. The...
MIPS assembly language Implement the following code in MIPS int array [ ] {2, 3, 4, 5, 6); int main) int num, position; scanf("%d",&num) ; position search(array, printf("The position is: num, 5); %d\n",positio int search(int array, int num, int size int position =-1; for(int i-0;i<size; i++) if(array [i]=num) { position-i; break; return position; Register map $s1: position $a0: array address $a1: num . $a2: size . $VO: return value