subject
Engineering, 25.11.2019 23:31 nicpinela1234

You have to write 3 subroutines which meet the following requirements: the first subroutine generates the 10th number in the fibonacci series starting with 0 and prints only the 10th number. the second subroutine prints "n" numbers in the fibonacci series. for this subroutine, the value of n is put in the stack segment before the subroutine call. the subroutine has to access the value from the stack. the third subroutine generates the 10th number in the fibonacci series and prints only the 10th number. furthermore, during the number generation process, each number is stored in a cache of size 5. for simplicity, assume that the nth number is stored in n mod 5 index of the cache. for example, 0th number is stored in cache location 0, 5th number is also stored in cache location 0, 3rd number is stored in cache location 3, and 8th number is stored in cache location 3.the main program first calls subroutine 1 and then calls subroutine 2 with 10 as parameter. then, it calls subroutine 3 followed by subroutine 2 with 5 as parameter. finally, the main program prints the contents of the cache. the two outputs should be the same but the second will execute faster because caching in this case is saving instruction cycles.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:10
Refrigerant 134a enters an insulated compressor operating at steady state as saturated vapor at -26°c with a volumetric flow rate of 0.18 m3/s. refrigerant exits at 9 bar, 70°c. changes in kinetic and potential energy from inlet to exit can be ignored. determine the volumetric flow rate at the exit, in m3/s, and the compressor power, in kw.
Answers: 1
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
You know the right answer?
You have to write 3 subroutines which meet the following requirements: the first subroutine generate...
Questions
question
Health, 25.02.2021 16:40
question
Biology, 25.02.2021 16:40
question
Mathematics, 25.02.2021 16:40
question
Mathematics, 25.02.2021 16:40
question
Mathematics, 25.02.2021 16:50
Questions on the website: 13722362