---------------------------------------------------------------------------------------- For the instructions given below, is the instruction legal? If so, evaluate it and, given the values in the registers, give the final value in HEX. $1 = 0x0000D0A0 $5 = 0x00012BAD $2 = 0x00000073 $6 = 0x0234EF01 $3 = 0xFFFFFF00 $7 = 0x00007B01 $4 = 0x00000FFF $8 = 0x00000005 a) add $10,$1,$2 b) sub $10,$2,$1 c) and $10,0x00000345,0x00000001 d) lw $10,$8($7) e) add $10,$3,-10 f) or $10,$3,0x000000AB g) and $10,$5,0x000000AB h) xor $10,$6,$5 i) sll $10,$7,3 j) sra $10,$6,2 k) sra $10,$3,1
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
---------------------------------------------------------------------------------------- For the instructions given below, is the instruction legal? If so, evaluate it and, given...
Assume the MIPS instruction subset is redefinied to contain
only the following instructions:
1. Assume that our MIPS instruction subset is redefined to contain only the following instructions: Instruction Instruction fetch Register read & ALU operation Data Memory Register write decode 0 ns R-format 2ns 1 ns lw ns l ns 2 ns 5 ns 1 ns ns 1 ns ns 0 0 bne The table lists the times required for each step within each instruction. Recall that with the...
Given the big-endian instruction memory map shown below in (b), and the initial values $t1 0XE7eeeADD, $s5 = 0x80000010 . We execute the following instructions: lw $t1, 12($s5) andi $t1, $t1, 0x3E0000A9 sra $s5, $s5, 3 addi $se, $s5, 2 sw $t1, -4($s0) Answer the following questions: (a) What values are contained in $se and sti after executing the above instructions? Write your answers in Hex format.
Given the big-endian instruction memory map shown below in (b), and the initial...
1. The MIPS instruction set includes several shift instructions. They include logical-shift-left (sll), logical-shift-right (srl), and arithmetic-shift-right (sra). [2 +2 4 points] a) Why does not MIPS offer an "arithmetic-shift-left (sla)" instruction? b) Write a MIPS code to implement the logical-shift-left (sll) instruction for a machine that did not have this particular instruction? In other words, you have to write the equivalent of the sll instruction using mul, add and other instructions. Try writing the equivalent of sll Ss1, Ss2,...
2.4 For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address of the arrays A and B are in registers $s6 and $s7, respectively. sll $t0, $s0, 2 # $t0 = f * 4 add $t0, $s6, $t0 # $t0 = &A[f] sll $t1, $s1, 2 # $t1 =...
Computer organization
6) Given the MIPS five stage pipeline and the following instruction sets: [30 pts, 10 pts each] instruction set #1 1w $1, 40 ($6) add $2, $3, $1 add $1, $6, $4 and $1, $1, $4 sw $2, 20 ($4) instruction set #2 add $1, $5, $3 sw$1, 0 ($2) lw $1, 4 ($2) add $5, $5, $1 sw$1, 8 ($2) a) If there is no forwarding or hazard detection, write the instructions (same order) and insert nop's...
6. In each of the instructions shown below, assume that the label LOOP corresponds to memory address 0x40CE0078. a) (5) Show in hex the 32-bit machine code for the instruction bltzal $14,LOOP Assume that the machine code will be located at address 0x40CE8880. b) (5) Register $14 contains negative 2 in two’s complement form. Show, in hex (0xdddddddd), the 32-bit contents of all registers within the CPU that are modified when the instruction bltzal $14,LOOP is executed.. c) 5) Show...
(Computer Architecture MIPS Assembly) Using minimum amount of nops - rewrite the code segment below so it doesn't cause any hazards. You may not reorder the original instructions, just insert nop where needed. add $3, $2, $3 lw $4, 100($3) sub $7, $6, $2 xor $6, $4, $3
Given the following sequence of instructions: lw $s2, 0($s1) //1 lw $s1, 40($s3) //2 sub $s3, $s1, $s2 //3 add $s3, $s2, $s2 //4 or $s4, $s3, $zero //5 sw $s3, 50($s1) //6 a. List the read after write (current instruction is reading certain registers which haven’t been written back yet) data dependencies. As an example , 3 on 1 ($s2) shows instruction 3 has data dependency on instruction 1 since it is reading register $s2. b. Assume the 5...
7 [24 marks] Consider the following MIPS code segment that is executed on a 5-stage pipeline architecture that does not implement forwarding or stalling in hardware. (1) add $4, $1, $1 (2) add $7, $4, $9 (3) lw $2, 40($8) (4) sub $8, $1, $2 (5) sw $8, 80(S2) (6) sub $2, $8, $4 (7) lw S8, 2($1) (8) add $8, $4, S2 Identify the data dependences that cause hazards. You are to use the following format to inform each...
The code chain below is executed on a data forwarding, 5-stage pipelined processor. Which of the following instructions will encounter a stall? Write the instruction number along with the number of stall cycles that instruction experiences. (Note the data forwarding) 1. add $4, $5, $6 2. add $7, $4, $5 3. sw $8, 0($7) 4. add $8, $8, $6 5. lw $6, 0($8) 6. add $10, $9, $8