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 18:10
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 18:20
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
question
Engineering, 04.07.2019 19:10
With increases in magnification, which of the following occur? a. the field of view decreases. b. the ambient illumination decreases. c. the larger parts can be measured. d. the eyepiece must be raised.
Answers: 1
You know the right answer?
You have to write 3 subroutines which meet the following requirements: the first subroutine generate...
Questions
question
Social Studies, 19.07.2020 01:01
question
Mathematics, 19.07.2020 01:01
question
Social Studies, 19.07.2020 01:01
question
Mathematics, 19.07.2020 01:01
question
Geography, 19.07.2020 01:01
Questions on the website: 13722360