CS计算机代考程序代写 Address

Address
Code
Basic
Source
0x00400000
0x2009000a
addi $9, $0, 0x0000000a
addi $t1,$zero,10
0x00400004
0x01202020
add $4, $9, $0
add $a0, $t1,$zero

I type format
opcode
rs
rt
immediate
31 26 25 2120 1615 0
Address
Code
Basic
Source
0x00400000
0x2009000a
addi $9, $0, 0x0000000a
addi $t1,$zero,10
0x00400004
0x01202020
add $4, $9, $0
add $a0, $t1,$zero
Convert hexadecimal to binary
Binary form: 00100000000010010000000000001010 (32 bits)
2

Binary form: 00100000000010010000000000001010 (32 bits)
I type format
31 26 25 2120 1615 0
0x2009000a
Binary: 001000 00000 01001 0000000000001010 Decimal: 8 0 9 10
addi : R[rt] = R[rs] + SignExtImm R[9] = R[0] + 10
$t1 = $zero + 10 SignExtImm = { 16{immediate[15]}, immediate }
opcode
rs
rt
immediate

R type format
opcode
rs
rt
rd
shamt
funct
31 26 25 21 20 16 15 11 10 6 5 0
Address
Code
Basic
Source
0x00400000
0x2009000a
addi $9, $0, 0x0000000a
addi $t1,$zero,10
0x00400004
0x01202020
add $4, $9, $0
add $a0, $t1,$zero
Convert hexadecimal to binary
Binary form: 00000001001000000010000000100000 (32 bits)
4

Binary form: 00000001001000000010000000100000 (32 bits)
R type format
31 26 25 21 20 16 15 11 10 6 5 0
0x01202020:
opcode
rs
rt
rd
shamt
funct
000000 01001 00000 00100 00000 100000 add : R[rd] = R[rs] + R[rt]
R[4] = R[9] + R[0]
$a0 = $t1 + $zero SignExtImm = { 16{immediate[15]}, immediate }
Binary:
Decimal: 0 9 0 4 0 32

J type format
opcode
address
31 26 25 0
Address
Code
Basic
Source
0x00400004
0x08100003
j 0x0040000c
j plus
0x00400008
0x200a0014
addi $t10,$0,0×00000014
add $t2,$zero,20
Convert hexadecimal to binary
Binary form: 00001000000100000000000000000011 (32 bits)

J type format
opcode
address
31
0x08100003:
Binary:
26 25
000010 2
0
Decimal:
PC+4: 0x00400008
00000100000000000000000011 00000100000000000000000011
00000000010000000000000000001000(32bits)
j : PC= JumpAddr
JumpAddr = { PC+4[31:28], address, 2¡¯b0 }
JumpAddr = {0000, 00000100000000000000000011, 00} JumpAddr = 00000000010000000000000000001100 JumpAddr = 0x0040000C

Instruction = 00000001001000000010000000100000 Op =Instruction >> 26
Op = 00000000000000000000000000000000

opcode
rs
rt
rd
shamt
funct
31 26 25 21 20 16 15 11 10 6 5 0
Instruction = 00000001001000000010000000100000 (R type) Rs = Instruction >> 26
Rs = 00000000000000000000000000001001 Rs = RS & 0x1f(11111)
Rs = 00000000000000000000000000001001