Question

I'm having trouble with my Computer Operation assignment. 1. What is the Zero register used for...

I'm having trouble with my Computer Operation assignment.

1. What is the Zero register used for in the ARMv8 architecture?

2. Can you implement the following code (shown below) in ARMv8 assembly, without using branching? How? Show your code

if (i == 0) r = r + 2;

else r = r - 1;

3. Implement the following code (shown below) in ARMv8 assembly down below. Show your code

z = a * (b+c)

4. How can you implement the following c-code for loop in ARMv8 assembly? Show your code

for (k = 0; k < 5; k++)

{ m = m + m;

}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer(i) :

Zero Register : As its name is suggesting ,that it ignores all writes to it and all reads of the zero Register,and then it returns 0. In most of the instructions ( not in all instructions ) , zero Register is used.

WZR and XZR are used as a zero Register in ARMv8 architecture.

Size of WZR is 32bits and size of XZR is 64bits.

Add a comment
Know the answer?
Add Answer to:
I'm having trouble with my Computer Operation assignment. 1. What is the Zero register used for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assignment: Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases...

    Assignment: Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases for data read and write into the register. The register has an enable and reset signal. When the reset is high the register should be cleared. When the enable is high and reset is low, data should be written into the register. Hint: The demo code shown below has the implementation for a 4-bit register that can be used as an example. library ieee;...

  • I'm having trouble figuring out the C++ code for the following assignment, keep getting errors. Help?...

    I'm having trouble figuring out the C++ code for the following assignment, keep getting errors. Help? Write a program that calculates a discount for buying certain quantities of coffee. Consider the following scenario: A coffee company sells a pound of coffee for $12.99. Quantity discounts are given according to the table below. Quantity Discount 5-9 5% 10-19 10% 20-29 15% 30 or more 20% Write a program that asks for the number of pounds purchased and computes the total cost...

  • C++ PROGRAMMING Hi! My assignment prompt is below. What I'm having the most trouble understanding is...

    C++ PROGRAMMING Hi! My assignment prompt is below. What I'm having the most trouble understanding is where the shapes are being stored. I'm assuming an array, but I'm not sure how sizing would work. Any help is appreciated, thanks! I have also attached the .h file we must use. Prompt: The goal of HW2 is to implement classes representing shapes. A given program will use this class to create shapes at arbitrary locations in the x-y plane and move them....

  • Answer the following questions I want to double check my work

    Answer the following questions I want to double check my work Q1: (8086 processor) Translate the following code segment written in high level languages into assembly code. Assume Ax contains signed number. If AX >=2 then CX=CX+1 ; Else AX-CX; End Q2: Show how this statement M JK-1 could be translated into assembly code using 8086 instruction set a) b) MIPS instruction set Assume M. J and K are memory variables In s086 assume 16-bit, we can use MOv instruction...

  • 5) Write TOY AL subprogram that implements the following subprogram interface: Label: SumEven On entry: Register $1...

    5) Write TOY AL subprogram that implements the following subprogram interface: Label: SumEven On entry: Register $1 is the return address of the caller. Register $A is the address in memory of an array A. Register $s is the size of the array A. On exit: Register $F is the sum of the entries of A that are even (divisible by 2) No values in memory have changed. Any of the registers may have changed value. Hint: The TOY assembly...

  • I'm having trouble rounding the numbers i'm getting in my output here's my code: #include<stdio.h> int...

    I'm having trouble rounding the numbers i'm getting in my output here's my code: #include<stdio.h> int main() { char gender; float a1, a2, a3, a4, a5; float waistmeasurement, wristmeasurement, hipmeasurement, forarmmeasurement; float B, bodyweight, Bodyfat, Bodyfatpercentage;    printf("This program determines the body fat of a person.Enter your gender (f|F|m|M): "); scanf("%c", &gender); printf("\n");    if(gender=='F' || gender=='f'){ printf("Enter body weight (in pounds): \n"); scanf("%f", &bodyweight); printf("Enter wrist measurement at fullest point (in inches): \n"); scanf("%f", &wristmeasurement); printf("Enter waist measurement at...

  • Problem 1: (20 marks) Part 1: (15 points) Compile the RISC-V assembly code for the following C co...

    please code using risc-v language and make it as simple as possible Problem 1: (20 marks) Part 1: (15 points) Compile the RISC-V assembly code for the following C code. Assume that n and k are passed in x3 and x4 respectively. Values n and k are initialized to 14 and 14. Assume that result returned in register fl and that double precision numbers are used. After you are done store the result in address: 12(x3). Are you allowed to?...

  • hello, I'm having trouble understanding the problems below for my Computer science class, please include a...

    hello, I'm having trouble understanding the problems below for my Computer science class, please include a work-through and some explanations on how to do it so that I can understand remember how do problems like this on my own. Thank you very much WE ARE USING C++ The following project includes the frequency_start_letter function and a few other functions that work with a string array. Reminder: you could click "Open in Repl.it" on the top right corner to see the...

  • I'm having trouble understanding pointers in my c programming class. I posted the pointer assignment below....

    I'm having trouble understanding pointers in my c programming class. I posted the pointer assignment below. If you could leave comments pointing out where pointers are used it would be much appreciated! ----------------------------------------------------------------------------------------------------------------------------------- Write a complete C program for an automatic teller machine that dispenses money. The user should enter the amount desired (a multiple of 10 dollars) and the machine dispenses this amount using the least number of bills. The bills dispenses are 50s, 20s, and 10s. Write a...

  • I'm having trouble with my Java Homework in which my professor wants us to solve the...

    I'm having trouble with my Java Homework in which my professor wants us to solve the 0-1 Knapsack problem with Dynamic Programming. The code below is what she provided and she requested that we not change any of her existing code but simply add to it. As you can see she gave us the stub file for the knapsack class and the Item class. You are a thief with a knapsack with a carrying capacity of knapsackCapacity pounds. You want...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT