Questions tagged [little-man-computer]

Little Man Computer (LMC) models an instructional Von Neumann computer architecture and uses assembly language.

Little Man Computer (LMC) models an instructional Von Neumann computer architecture and uses language. It is mostly used for educational purposes.

Questions about programming issues involving LMC should clarify which simulator the code should run on, as there are different interpretations on how a LMC should work with negative numbers and overflow.

There are several simulators available on the web, including those published by:

These take assembly code as input and run the program visualising the process.

For more info, see:

90 questions
0
votes
1 answer

LMC to find prime numbers by user input

00: 599 01: 298 02: 738 03: 598 04: 297 05: 395 06: 730 07: 825 08: 597 09: 295 10: 717 11: 597 12: 196 13: 397 14: 592 15: 393 16: 600 17: 598 18: 902 19: 598 20: 196 21: 398 22: 594 23: 397 24: 600 25: 593 26: 196 27: 393…
l33tspeak
  • 95
  • 3
  • 13
0
votes
3 answers

little man computer- Branch on positive

In Little Man computer(LMC), the condition Branch on Positive(BRP) includes zero as a positive number( I thought number>0 is positive). I know LMC is a imaginative concept, but I was wondering if any processor (outdated or current ones) uses Branch…
user845405
  • 1,461
  • 5
  • 23
  • 43
0
votes
1 answer

Assembly Language questions. Little Man Computer Program

I am trying to write two different programs in LMC using an old assembly language. The first as is follows: Write a LMC program that takes two inputs, a number to count down from, and the step value (example: count down from 35 by 5), until it…
Ryan Hickman
  • 23
  • 1
  • 5
0
votes
2 answers

what must the minimum number of bits in each word of the Little Man computer be?

I came across the follow question while reading a CS book, can someone please explain it to me? >"The Little Man computer can have ten operation codes (0-9) and address 100 words of storage (0-99). If binary numbers are to replace decimal numbers,…
UnPatoCuacCuac
  • 315
  • 2
  • 7
  • 18
0
votes
1 answer

Multiplying two numbers by finding out the greatest and lesser value

I am using a Little Man Computer simulator program called visible virtual machine to learn the basics of coding in assembly language format. Currently I am trying to multiply any two numbers (x & y) but in an efficient way by grabbing the greatest…
user1261800
-1
votes
2 answers

LMC - Decimal to binary with rest

I am working on a challenge to write a program for the Little Man Computer: This program should take a decimal number as input and output the binary equivalent. It should repeatedly divide the input by 2, and then output the remainders. For example,…
-1
votes
1 answer

How to add cx^2 to a+bx in LMC, with overflow output as 999?

I need to write an LMC program to calculate the value of a+bx+cx² for given values of a, b, c and x. If the result exceeds 999, then it needs to output 999; if less than 999, then output the result. The a+bx+x² part (without c-coefficient) is…
Ali Asad
  • 1
  • 2
-1
votes
1 answer

Divison in LMC with and without remainder

I need a bit of help to code how to divide a sum of numbers, divided by n numbers put in. For instance, the sum is 10, with 2 numbers, the answer should be 5. But if the sum is 14 and the total input (n numbers) are 3, it should write out 4,…
ali03
  • 11
  • 2
-1
votes
1 answer

Negative division in little man computer

I always get stuck in a loop when I try to make a division with a negative number in LMC. For exemple 10/2 will give me 5 and -10/-2 will also work and give 5. The problem is when there is a single negative number in the division for exemple 10/-2…
-2
votes
1 answer

Sort three input numbers

I am looking at this assignment: Write a program that takes three inputs and outputs them in ascending order. I had used the following LMC simulator: https://www.101computing.net/LMC/# And this is what I've done so far: INP 901 Input num1 STA 318…
-3
votes
1 answer

Write LMC program that calculate sum of numbers input by user. Display summation before halting

I am trying to solve this code challenge: Write a LMC program that calculates the sum of numbers provided by the user. Display the summation as output before halting the program. If the user has provided less than or equal to ten input values,…
orbitalv
  • 3
  • 4
-3
votes
1 answer

Get maximum and count of input numbers

I need to create a simple LMC program for the following task: Input a series of numbers and output: the largest among them, and how many numbers were entered. The number 000 will be used to mark the end of the series of input numbers (000 is not…
Asher
  • 1
  • 2
-3
votes
2 answers

How do I code the Fibonacci sequence LMC?

I was wondering if it was possible to create a program that creates the Fibonacci Sequence in "Little Man Computer". The program would output in the letter boxes the individual numbers of the sequence. The only input made would be asking the user…
user205757
  • 1
  • 1
  • 3
-4
votes
3 answers

How create an Little Mans Computer (LMC) code that will get a number. Display 1 if the number is odd, display 0 if the number is even

I need help in my study's where it can display 1 if the number is even and 0 if the number is odd. for example if the input is 99 it will display the output 1 which means odd. and if i display 10 it will display the output 0 which means even. I…
-5
votes
1 answer

Little Man Computer - I'm trying to find the right answer

Write a Little Man program to accept an indefinite number of input values. The output value will be the largest of the input values. You should use the value 0 as a flag to indicate the end of input This is what I have done so far. INP STA FIRST BRZ…
1 2 3 4 5
6