In: Computer Science
Run the following RISC-V codes separately and explain what each code does and how you interpret the register results:
Code 1.
addi x3, x3, 1
slli x3, x3, 62
addi x4, x4, 7
mul x5, x4, x3
mulh x6, x4, x3
Code 2.
addi x3, x3, 1
slli x3, x3, 63
addi x4, x4, 1
mul x5, x4, x3
mulhsu x6, x4, x3
Code 3.
addi x3, x3, 1
slli x3, x3, 63
addi x4, x4, 1
mul x5, x4, x3
mulhsu x6, x3, x4
Code 4.
addi x7, x7, 45
addi x4, x4, 3
div x5, x7, x4
div x6, x4, x7
Code 5.
addi x7, x7, -46
addi x4, x4, 3
div x5, x7, x4
rem x8, x7, x4
Code 6.
addi x7, x7, -46
addi x4, x4, 3
divu x5, x7, x4
Code 1
Code 2
Code 3
Code 4
Code 5.
Code 6