Question
I have the program in C im not sure how to transcribe it here is my c code: #include float voltage,power; void findvoltage(float,float); void findcurrent(float,float);
I have the program in C im not sure how to transcribe it
here is my c code:
#include
float voltage,power; void findvoltage(float,float); void findcurrent(float,float);
main() {
float current,resistance;
printf("Enter the current value:");
scanf("%f",¤t);
printf("Enter the value of Resistance:");
scanf("%f",&resistance);
findvoltage(current,resistance);
findcurrent(current,voltage);
}
void findvoltage(float current,float resistance) {
voltage=current*resistance;
printf("voltage %f: ",voltage);
}
void findcurrent(float current,float voltage) {
power=current*voltage;
printf("power is %f:",power);
}
2. Write a ARMv8 program that finds voltage drop and power dissipated by a resistance (R) when a current (I) flows through it. Resistance and current values are given as inputs. Create a function that would find the voltage drop, and create another function that would find the power. Use these functions in your program. The input and output values are single precision floating-point values. Assume the input resistance value (R) is in register SO and current (I) is in register S1. Store the computed voltage drop in register S2 and computed power in register S3. Assemble, test, and simulate the assembly code using DS-5 simulator. Do not upload the entire DS-5 project. OnlyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started