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
Unscramble the words <br><br> A: ESUOM RETUPOC <br><br> B: KSID EVIRD
Mrrafil [7]
A. Mouse coputer
B. Disk drive
5 0
4 years ago
Read 2 more answers
How do u answer questions on brainly if ur on the app and on a phone. For me there is no answer button :(
Rudik [331]

Answer:

oh for me there is maybe try reloading?

Explanation:

8 0
3 years ago
Knowing the meaning of the acronym WAS I WHY can be most helpful to you when you?
9966 [12]
D. Three hundred yards from his hiding place he stopped where a huge dead tree leaned precariously on a smaller, living one.
6 0
3 years ago
My rank hasn't changed even though i've passed the point mark and i even tried to relogin but it still didn't change.
tatyana61 [14]
You need to wait, it isn't the website that ranks you, but actual people on the site. Just wait, have patience. 
5 0
3 years ago
Read 2 more answers
A method to move data through a network of links and switches which reserves communication sessions between end systems is calle
lubasha [3.4K]

Answer:Circuit switching and packet switching

Explanation: Circuit switching is the switching technique through the connection from the source port to the destination port.Packet switching is also a switching techniques in connectionless form for the data packets. Both these switching techniques helps in communication between end and start ports.

Other option are incorrect as the access networks provide the access to the network and throughput is the input passing in the network.Thus, the correct option is circuit switching and packet switching .

3 0
4 years ago
Other questions:
  • Which type of system must you connect to and use to make changes to Active Directory?
    15·1 answer
  • Tanya has received an email, apparently from her bank, stating that some of her records were lost during server maintenance work
    13·2 answers
  • When computer manufacturers overcame the enormous 13,000 Chinese character barrier by creating a workable keyboard through voice
    15·1 answer
  • How do you take apart a I pad and put it back together and it still works
    5·1 answer
  • What sound signal tells another boater that you wish to pass on your starboard (right) side?
    15·1 answer
  • Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
    13·1 answer
  • Houston want to have a quick conversion with his friend about an upcoming school activity. which type of website would be most u
    12·2 answers
  • Software refers to the physical parts of a computer.<br> a. True<br> b. False
    11·2 answers
  • A student is conducting an experiment in which he adds an inhibitor to an enzyme-catalyzed reaction that contains alkaline phosp
    14·1 answer
  • Which two things can a user view in the Reading pane?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!