Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Translate the following JAVA program into a RISC-V assembly program. import java.util.Scanner; public class LExC { public static void main(String[] args) { int t0 =

Translate the following JAVA program into a RISC-V assembly program.

import java.util.Scanner;

public class LExC { public static void main(String[] args) { int t0 = (new Scanner(System.in).nextInt()); int t1 = (new Scanner(System.in).nextInt()); for (int i=t0; i>0; i-- ) { int result = calc(t0,t1 - i); System.out.print(result); } } public static int calc(int number1, int number2) { if(number2 == 0) return 0; return calc(number1, number2/2) + 1; } }

please note we need to translate those into assembly. which the format is something like :

addi x5,x0,5

addi x6,x0,6

etc

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 Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions