1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Daniel [21]
2 years ago
15

Half of the integers stored in the array data are positive, and half are negative. Determine the

Computers and Technology
1 answer:
jonny [76]2 years ago
7 0

Answer:

Check the explanation

Explanation:

Below is the approx assembly code for above `for loop` :-

1). mov ecx, 0

2). loop_start :

3).    cmp ecx, ARRAY_LENGTH

4).    jge loop_end

5).    mv temp_a, array[ecx]

6).    cmp temp_a, 0

7).    branch on nge

8).        mv array[ecx], temp_a*2

9).   add ecx, 1

10).   jmp loop_start

11). loop_end :

Assumptions :-

*ARRAY_LENGTH is register with value 1000000

*temp_a is a register

Frequency of statements :-

1) will be executed one time

3) will be executed 1000000 times

4) will be executed 1000000 times

5) will be executed 1000000 times

6) will be executed 1000000 times

7) `nge` will be executed 1000000 times, branch will be executed 500000 times

8) will be executed 500000 times

9) will be executed 1000000 times

10) will be executed 1000000 times

Cost of statements :-

1) 10 ns

3) 10ns + 10ns + 10ns [for two register accesses and one cmp]

4) 10ns [for jge ]

5) 10ns + 100ns + 10ns [10ns for register access `ecx`, 100ns for memory access `array[ecx]`, 10ns for mv]

6) 10ns + 10ns [10ns for register_access `temp_a`, 10ns for mv]

7) 10ns for nge, 10ns for branch

8) 30ns + 110ns + 10ns

10ns + 10ns + 10ns for temp_a*2 [10ns for moving 2 into a register, 10ns for multiplication],

110ns for array[ecx],

10ns for mv

9) 10ns for add, 10ns for `ecx` register access

10) 10ns for jmp

Total time taken = sum of (frequency x cost) of all the statements

1) 10*1

3) 30 * 1000000

4) 10 * 1000000

5) 120 * 1000000

6) 20 * 1000000

7) (10 * 500000) + (10 * 1000000)

8) 150 * 500000

9) 20 * 1000000

10) 10 * 1000000

Sum up all the above costs, you will get the answer.

It will equate to 0.175 seconds

You might be interested in
A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
Mrrafil [7]

Answer:

Check below for answers and explanations.

Explanation:

The major reasons why computer processes are suspended or terminated are:

1. When there is insufficient memory for successful completion of the process

2. When there's an unauthorized access of any of the computer resources by the process.

It is possible that some processes are terminated why some are suspended because, when the system runs out of memory, the running processes are put on hold until the system is able to create free memory space for the completion of the process. In this case the process is suspended. But if the system cannot provide enough space for the process, the process is terminated.

In the example provided in this exercise, some of the processes were suspended because the system wants to create free memory space for their completion while others are terminated either because the available space is not sufficient for their completion or they want to access an unauthorized resources on the system.

4 0
3 years ago
A program that helps computer users do specific things like word processing, etc., e-mailing, or browsing the Internet
Dimas [21]

This is an application

6 0
3 years ago
Which of the following is one of the first two levels of formatting in a Word document?
Dafna1 [17]

Explanation:

Paragraph Formatting.

5 0
3 years ago
What limited the possibilities of game development from a technical viewpoint?
lyudmila [28]

Answer:

1)Estimation of the game project

2) Development of Prototype

.

3) Reproduction Stage

4)Communication

5) Polish

Explanation:

The limited the possibilities of game development from a technical viewpoint are the reason why some of developers in gaming are diverting away into another area of computer technology. Some of these limiting factors are;

1):Estimation of the resources needed for the game development which is hard most especially for video games and some of the reasons is that the industry is fast changing. And there are things to be estimated such as time,is there any need bro change the code.

2)Development of Prototype of the game in other to

Know if a feature is valid can be a problematic process.and to know where to perform modifications.

3) Reproduction Stage:

This one of the main limiting problem in almost every game development , and this usually occur when a game ships, reproduction stage is skipped. And without proper preproduction, there will be no coherence in product.

4) Most of the Video games can be easily ruined by bugs and features that is badly executed. And this is where polishing comes in, polishing can be really demanding.

5 0
3 years ago
Define Proportional spacing fornt.​
givi [52]

Answer:

Alphabetic character spacing based on the width of each letter in a font. ... Proportional spacing is commonly used for almost all text. In this encyclopedia, the default text is a proportional typeface, and tables are "monospaced," in which all characters have the same fixed width.

hope this answer helps u

pls mark me as brainlitest .-.

7 0
3 years ago
Other questions:
  • A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
    11·2 answers
  • To create a new folder, press ____.
    12·1 answer
  • Cassie is worried about credential management on a network where users often have over six passwords to remember. She’s curren
    13·1 answer
  • Write a program that extracts the last three items in the list sports and assigns it to the variable last. Make sure to write yo
    8·1 answer
  • Ok.,so i have a sopitify account and by accident i pressed the downlaod on button and it says start you free trial i pressed tha
    11·2 answers
  • Suppose that a laptop identifies its processor as follows: AMD’s A84500M. What does the AMD represent?
    5·1 answer
  • In what way , if any, can your social media presence affect your chances of getting a job in social media?
    8·1 answer
  • Electronically, or on paper draw a Binary Search Tree using the values below. Note: Insert each value into the tree in order fro
    12·1 answer
  • Hardware is found outside the system unit.​
    13·1 answer
  • True or False, In adversarial searching, agents using the MiniMax algorithm always select the state that has the highest guarant
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!