Question: I dont think there is one correct answer for this, but I dont understand how to write the Little Man Computer code. The instruction is

I dont think there is one correct answer for this, but I dont understand how to write the Little Man Computer code.

The instruction is to convert a base 10 number to binary.

The range for the input is 0 to 63. Anything above 63 would end the program.

The following are instructions from the instructor. It doesnt make sense to me but Im hoping someone with experience with LMC can create some code.

We need to understand that for an output of the LMC you get a max of 3 decimal numbers. So, what if 5 digits were needed, say 12345? There would have to be 2 output statements: MSB and LSB. (most significant digit and least significant digit).

So MSB => 012 and LSB => 345. In the project, we want binary out 9 digits. So MSB, Middle, and LSB.

53 Decimal is: MSB => 110, and LSB => 101

Code may look like:

input

sto TMP_IN ; get number to convert

sub six ; subtract 32

brp cal_1 ; branch around

br nxt_1 ; branch around

cal_1 sto TMP

DAT six 032

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!