Consider the following source code, where R, S, and T are constants declared with #define:
In compiling this program, GCC generates the following assembly code.
A. Extend Equation 3.1 from two dimensions to three to provide a formula for the location of array element A [i] [j] [k].
B. Use your reverse engineering skills to determine the values of R, S, and T based on the assembly code.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Additional Engineering Textbook Solutions
Digital Fundamentals (11th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Modern Database Management
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Introduction to Programming Using Visual Basic (10th Edition)
C++ How to Program (10th Edition)
- Write in C# programm and follow the instruction that is given in image Don't reject the question. Someone surely help mearrow_forwardPlease write this code in C PROGRAM. Thanks in advance.arrow_forwardQuestion #4 To gain a bit of practice writing CUDA programs your warm-up task is to implement the SAXPY function in CUDA (The name "SAXPY" stands for "single-precision a times x plus y."). For input arrays x and y, output array dest, and value a (all single-precision floating-point values), the function computes dest[i] = a*x[i]+y[i] for all array elements i. You can assume any value for "a". You need to test your program on a real GPU. i want solve this question on CUDA SAXPYarrow_forward
- Write a C program which initially creates 2 two-dimensional integer arrays: arrayA and arrayB. The size of the arrays should be 4 x 4. The program should use scanf() to take an integer test input (x). The program should then create and print array A and array B as shown: array A [x, 2x, 3x, 4x, 2x, 4x, 6x, 8x, 3x, 6x, 9x, 12x 4x, 8x, 12x, 16x] Array B [2x, 3x, 4x, 5x, 4x, 6x, 8x, 10x, 6x, 9x, 12x, 15x, 8x, 12x, 16x, 20x ] The program should then create and print new arrays for each of the following situations: • An array containing the sum of corresponding cells in arrayA and arrayB • An array containing the sum of corresponding rows in arrayA and arrayB• An array containing the sum of corresponding columns in arrayA and arrayB Note: include exactly one space after each element in each array (including the last one), each row on a new line, and exactly one blank line after each array as shown in the example. For example: Input Result 2 2 4 6 8 4 8 12 16 6 12 18 24 8 16…arrow_forwardQuestion 1 .Debug the following Python code. 1. Explain the problem 2. Write the correct, working code This code is supposed to have a function that plots two arrays.Why does it not perform as expected? import numpydef plotGraph(x,y): plt.plot(x,y) plt.show() arr1 = np.array([9,2,3,5,1])arr2 = np.array([15,11,7,9])plotGraph(arr1, arr2) Full explain this question very fast solution sent me step by step Don't ignore any part all part work u Text typing work only not allow paper workarrow_forwardplease solve the question during 20 mintarrow_forward
- I want to solve this for the question in an array wayarrow_forward1. Write a python function to calculate the following mathematical function: f(x) = sin(2x)e-x/5 Test your function for x = 4 and for the array x = np.array ([2.6, 9.1, 3.7]).arrow_forwardWrite a program in C++ to read array 2D with size 3x4 and perform the following: 1- Replace each element in the first row by the constant 2. 2- Find the sum of secondary diameter elements.arrow_forward
- Please written by computer source Question 1: Suppose we wish to write a procedure that computes the inner product of two vectors u and v. An abstract version of the function has a CPE of 14–18 with x86- 64 for different types of integer and floating-point data. By doing the same sort of transformations we did to transform the abstract program combine1 into the more efficient combine4, we get the following code: Our measurements show that this function has CPEs of 1.50 for integer data and 3.00 for floating-point data. For data type double, the x86-64 assembly code for the inner loop is as follows: Assume that the functional units have the characteristics listed in Figure 5.12. **See last page for figures A. Diagram how this instruction sequence would be decoded into operations and show how the data dependencies between them would create a critical path of operations, in the style of textbook Figures 5.13 and 5.14. vmovsd vmovsd vmulsd vaddsd | | | |…arrow_forwardWrite a c++ program that take an array of size 10 and insert values of your choice. Add/insert all the element of array using a single pointer / array name and print sum don’t use array indices like [ ]. And then print the same array contents and their addresses in the reverse order using same pointer. Your program will also find the largest of array. Write separate functions for input, reverse and finding largest. Pass array as parameter in all the functions. Note: Sample output of the program should be like this:Sum of elements of array are:___________ Reversed values of the array are:Value of element 10 is: _____________ and address is:____________…….Value of element1 is: ______________ and address is:____________ Largest Element of array is:__________ and at index:_____________arrow_forwardQuestion 2. Write a C++ program to perform following tasks: Declare a dynamic array of şize ´s'. Take input in s from user b. Fill the array with random numbers between 1 and 100 using built-in rand( ) function a. (https://www.cplusplus.com/reference/cstdlib/rand/) Find all the even and odd numbers and implement following array of pointes. с. Array of even numbers Array of odd numbers d. Write a function void Displav(int **x, int size) and call it appropriately for array created in part c. Iarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr