Can you please give the machine code output for each section? Example: add r3,r2,r1 This instruction add r2 and r1 and r

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Can you please give the machine code output for each section? Example: add r3,r2,r1 This instruction add r2 and r1 and r

Post by answerhappygod »

Can you please give the machine code output for eachsection?
Example:
add r3,r2,r1
This instruction add r2 and r1 and result stored to r3.
This is R -type instruction,
Opcode Rs1(5 bits) Rs2(5bits) Rd(5 bits) Function(11bits)Opcode = 000000
Rs1 = r2 = 00010
Rs2 = r1 = 00001
Rd = r3 = 00011
Function = 00000 100000 (For ADD )
So instruction format is,
000000 00010 00001 00011 00000100000Machine code = 0x00411820
Can You Please Give The Machine Code Output For Each Section Example Add R3 R2 R1 This Instruction Add R2 And R1 And R 1
Can You Please Give The Machine Code Output For Each Section Example Add R3 R2 R1 This Instruction Add R2 And R1 And R 1 (133.6 KiB) Viewed 32 times
1) (40 pts) Using all the given DLX handouts, give the machine code of each of the following instructions: (assuming that the current instruction is located in memory with it address equal to 0x000024ac) a) sub r3,r5,r7 b) addi r2,r4,#–21 c) lhi r7,#0x3ca0 (LHI follows the ALU-immediate instruction format) d) jal sub (sub is the starting address label of the subroutine to jump to with its value equal to 0x00004134) e) sh -16(r5),r13 f) beqz r3, target (target equals an address of x00001c38) g) slti r7,r3,#-3 h) srl r3,r4,r5
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply