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]
3 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]3 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
Which of these is unused normal, unvisited link ??
Tomtit [17]

Answer:

hover

Explanation:

hope my answer help you

8 0
3 years ago
Why does an annular eclipse occur when the moon is between the sun and Earth, but is too far from Earth for a total eclipse?
velikii [3]

Answer:

Moon Is Far from Earth

Explanation:

The reason we can see the glowing outer edge of the Sun at the maximum point of an annular eclipse is that it happens while the Moon is near its farthest point from Earth, called apogee, when the Moon is smaller than the Sun when viewed from Earth.

5 0
3 years ago
What key will cause the windows boot manager to appear as long as it is pressed during the windows startup process?
Zigmanuir [339]
The <span>key that will cause the windows boot manager to appear as long as it is pressed during the windows startup process is the S</span>pacebar.  T<span>he </span>spacebar<span>  or </span>space bar<span> is a long horizontal key on the lower edge of a keyboard that is always the largest and longest key on the keyboard.</span>
7 0
3 years ago
I Need Help With This I'm Just At Home Working And I Am Kinda Stuck On This Question Please Help
kvasek [131]

Answer:

move forward 300 pixels and turn right by 15 pixels

repeat then turn left instead of right

do this either 5 or 10 times idk which one

Explanation:

6 0
3 years ago
Define financial literacy
iren2701 [21]
Financial literacy means the power to understand how money works in this socity. like how someone maneges money or makes money. How someone investets in to it and how someone donates it
5 0
3 years ago
Read 2 more answers
Other questions:
  • I'm trying to connect fire stick but it doesn't have HDMI input so guys what would do you recommend to buy I tried a converter b
    8·1 answer
  • Blogs are typically written by large companies or organizations as a way to express formal, technical, or scholarly information
    5·2 answers
  • Fair use allows individuals to break copyright so long as they ________.
    15·1 answer
  • Cobbling together elements from the previous definition and whittling away the unnecessary bits leaves us with the following def
    7·1 answer
  • Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
    5·1 answer
  • Jamie has to enter the names, grades, and scores of a group of students into a worksheet. Which option will Jamie use to describ
    15·1 answer
  • One of the functions of an IDE is to check for: flowchart errors. Syntax errors. memory errors X input and output.​
    12·2 answers
  • Freeeeeeee brainliest!!!
    10·1 answer
  • Examine about the Internal &amp; External Fragmentation methods give an example for each. essay​
    15·1 answer
  • When operating your vessel with a vhf radio, what channel must you monitor?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!