Question: Write a Little Man program that prints out the sums of the odd values from 1 to 39. The output will consist of 1, 1+3,

Write a Little Man program that prints out the sums of the odd values from 1 to 39. The output will consist of 1, 1+3, 1+3+5, 1+3+5+7.... No input is required. As an aside, do you notice anything interesting about the output results that are produced by the series? (Hint: This series is sometimes used as part of an algorithm for finding square roots of numbers.)

Use the following LMC instruction set :

Arithmetic 1xx Add
2xx Subtract
Data movement 3xx store
5xx load
Jump 6xx BR
Branch on zero 7xx BRZ
Branch on positive 8xx BRP
Input 901 Input
Output 902 Output
End 000 Halt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!