Find the element with rank 4

Assignment Help Computer Engineering
Reference no: EM133626036

IN ASSEMBLY ARMv8 program that computes the histogram of a set of non-negative integers. The input numbers will be specified in double word type in your program and will range between 0 and 100. Your program will count how many times each integer appears in a histogram with 101 bins.

(2) The code must include a procedure for returning the element of a particular rank, e.g. the 8th smallest number. The rank will always be defined starting from the minimum value, and rank 1 corresponds to the smallest element. See the example below.

(3) Optionally, the code can accept a list of ranks and call the procedure multiple times. In this case, the number of ranks to be tested should also be provided in the data section (not shown in example).

(4) The procedures must return correctly to the caller and this must be demonstrated by a printout of the result by the caller.

(5) The code must print the histogram, as well as the values with the ranks specified in the data section using printf as shown below.

The input data and the length of the array will be specified as follows:

.data inpdata: .dword 2, 0, 2, 3, 4, 6 inplen: .dword 6 rank:

.dword 4

The output of the histogram computation should be:

Number:0,1,2,3,4,5,,6 count: 1,0,2,1,1,0,1

The last printed row should correspond to the maximum value found in the data. You can use \t in the printf format string to insert a tab in the output, but ugliness of the printouts will not be penalized.

To find the element with rank equal to 2, we need to look for the histogram bin that includes the second smallest number. This can be found by adding the counts in the bins of the histogram, starting from 0, until we reach or exceed 2. In this example, we need to include bins 0, 1 and 2 to include the second smallest number of the input (in bin 2). Therefore, the element with rank 2 has value equal to 2.

Similarly, to find the element with rank 4, we need to identify the histogram bin that includes the fourth smallest number. To reach it, we need to include bins 0, 1, 2 and 3

Therefore, the element with rank 4 has value equal to 3.

The output of your program should have the following form. Keep in mind that the main function should print the value returned by your procedure.

The value of the rank-4 element is 3

Test your code with data that span the entire range from 0 to 100; that would produce histograms with empty bins; or histograms with one non-empty bin.

Test your rank finder procedure with rank equal to 1, N (the length of the input array), a value in the middle of a bin, and a value at the end of a bin, such as 2 and 3 in the above example.

Reference no: EM133626036

Questions Cloud

What happens to the compute resources during : What happens to the compute resources during a FaaS call? Server scales for less resources Server scales for more resources Server is turned off after function
Create a filter on the data display a multiple filter : Create a filter on the data Display a multiple filter showing 2014, 2016 January Invoice month and Aggregate Sales Type set to International
Which medications you give to help with common side effect : You just ordered amoxicillin/clavulanate for a 35 year old male for a sinus infection. Which medications can you give to help with the most common side effect?
Apply the general number format to values : Apply the General number format to values on the vertical (value) axis. Use default values for format code and links. (Hint: close the Format pane and do not
Find the element with rank 4 : Find the element with rank 4, we need to identify the histogram bin that includes the fourth smallest number. To reach it, we need to include bins 0, 1, 2 and 3
Discuss how you would go about designing the study : Discuss how you would go about designing this study. Identify the advantages as well as limitations of the design you choose.
How you have personally empowered a patient or fellow nurse : What are the best strategies the nurse can employ to empower patients. Provide example of how you have personally empowered either a patient or a fellow nurse.
Describe problems for this compatibilist account of freedom : Soft-determinists (also known as compatibilists) maintain that free actions are those that are caused in the right way.
Write a program that asks the user to provide their name : Write a program that asks the user to provide their name. The program should then display their name 5 times, separated by spaces. For example

Reviews

Write a Review

Computer Engineering Questions & Answers

  How the core value of responsible stewardship applies

how the core value of responsible stewardship applies to the development and enforcement of process synchronization in our computer systems.

  Design assumptions that control electronic circuit systems

The central bank has a vault controlled system for nine (9) vaults in its care. An ant-theft system is put in place to protect the vaults. Show the design assumptions that control all nine (9) VAULT electronic circuit systems as one integrated circu..

  Deducing security policy to mitigate the threat.

Information like sales data, client data, and the network configuration. Recognize the threats these significant items are subject to and deduce the security policy in order to mitigate that threat.

  Write a function that receives an integer array

Write a function that receives an integer array, the length of the array, an integer for indicating the position, an integer for insertion).

  What advantages accrue to a malicious outsider by knowing

Is network address translation an example of security by obscurity? That is, does the firewall merely hide addresses that an outsider might be able to find out

  Define cognitive aid and their application in systems design

Define cognitive aids and their applications in systems design. Enumerate and explain briefly any four principles affecting flexibility principle. Differentiate between Multi-modal system and multimedia system.

  Calculate the daily average distance walked by the user

Using Java, how can I use a loop that runs 7 times (using the final variable) to ask and get how many steps the user walks each day of the seven days.

  Discuss the various prototypes developed in budget control

Discuss the various prototypes developed in the budget control example as either throw-away or evolutionary prototypes.

  What is the overall error for the validation set

What is the overall error for the validation set? What is the percent improvement relative to the naive rule (using the validation set)?

  Create an implementation of the citypathconnector interface

Create an implementation of the CityPathConnector interface. Use the stack data structure (java.lang.Stack) in your implementation.

  Design an efficient dynamic programming algorithm to find

You are given an n by m grid G, and each square (i, j) has a; apples. Starting from the bottom-left square, you will make your way to the top-right square

  Describe the design that would best support the ability

Describe the design that would best support the ability of a programmer to have two versions of a database in his application.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd