Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 2 Points ) Table 2 gives the RISC - V binary code and data ( both in hexadecimal representation ) for a program. Suppose

(2 Points) Table 2 gives the RISC-V binary code and data (both in hexadecimal representation) for a program. Suppose PC=000400000 before program execution.
Table 2: Memory Content Before Program Execution
\table[[Address,,,,Momory,Content,,,],[cdots,cdots,cdots,cdots,cdots,...,cdots,cdots,-],[0x00400000,0\times 0Ee10517,0\times 00050513,0\times 00800593,0x00B000eE,0x00008067,0x00450293,0x00259313,0x00650363],[0x00400020,0x0272d863,0x0002=303,0xinfe2Be13,0x00=4e63,0x000in2e83,0x01435863,0x01de2223,0xinfe=0=13],[0x00400040,0xlarr=0006e3,0\times 006-:2223,0\times 00428293,0xine000=3,0\times 00000B67,...,dots,...],[cdots,cdots,cdots,cdots,...,...,cdots,cdots,cdots],[0\times 10010000,0\times 0000001e,0\times 00000021,0\times 0000000e,0\times 0000000b,0\times 0000000E,0x00000020,0\times 0000001b,0\times 0000000=],[0\times 10010020,0\times 00000011,0\times 00000022,0\times 00000033,0\times 00000044,0\times 00000055,0x00000066,0\times 00000077,0\times 00000088],[cdots,cdots,cdots,cdots,cdots,cdots,cdots,cdots,cdots]]
a)(1 Point) Please translate the RISC-V binary code back into RISC-V assembly code in Table 3. The semantics of the first instruction AUIPC is: x10=PC+(Imm2012), and here Imm20=00fc10.
Table 3: Assembly Code of the Program
\table[[Label,Instruction],[L1: ,,AUIPC \times 10,0\times 0fc10],[L2:,ADDI x10,x10,0],[L3:,ADDI X11, X0,8],[L4:,JAL x1, L6],[L5:,JALR x0,x1,0],[L6:,ADDI x5, X10,4],[L7:,SLLI x6,x11,2],[L8:,ADD x7,x10,x6],[L9:,BGE x5,x7, L21],[L10:,LWx6,0(x5)],[L11:,ADDI x28,x5,-4],[L.12:,BLT x28,x10, L18],[L13:,LW x29,0(x28)],[L14:,BGE x6,x29, L18],[L15:,SW x29,4(x28)],[L16:,ADDI x28,x28,-4],[L17:,BEQ\times 0,x0,L12],[L18:,SW \times 6,4(\times 28)],[L19:,ADDI x5,x5,4],[L.20:,BEQ\times 0,x0,L9],[L21:,JALR x16,x0,0]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

Why is job analysis considered to be a basic HR tool?

Answered: 1 week ago

Question

5.1 Define recruitment and describe the recruitment process.

Answered: 1 week ago