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;
}
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.
I'm having trouble with my Computer Operation assignment. 1. What is the Zero register used for...
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? 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 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
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...
I'm trying to write this program in C++ and I'm having trouble initializing the overload function I have to use. Here's the assignment and what I got so far, thanks for the help! /*2. Implement the game of Rock-Paper-Scissors in C++, where you can play against the computer. a. Scissors beat paper, paper beats rock, and rock beats scissors. If both you and computer choose the same tool, it is a tie. b. Your program should have a class game...
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...
Can someone please help me? I'm having trouble with this assignment and have been stuck trying to figure it out for over an hour. Here's the assignment details below: For this assignment, you will develop "starter" code. After you finish, your code should access an existing text file that you have created, create an input stream, read the contents of the text flie, sort and store the contents of the text file into an ArrayList, then write the sorted contents...
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...
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...
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?...