little-man-computer

Why no Multiply or Divide function in Little Man Computer

ε祈祈猫儿з 提交于 2020-06-27 16:13:13
问题 Hello I am currently using Little Man Computer for a school project and I understand that LMC has an ADD and a SUB function. However I understand that there is no Multiply or Divide function in LMC and I would like to know why that is. 回答1: The LMC serves educational purposes, and is not intended to excel in efficiency. "The Architecture of Computer Hardware and System Software" (4 th ed. 2009), chapter 6 is one of the main references for the LMC. That chapter starts with this phrase: The

Why no Multiply or Divide function in Little Man Computer

你离开我真会死。 提交于 2020-06-27 16:11:35
问题 Hello I am currently using Little Man Computer for a school project and I understand that LMC has an ADD and a SUB function. However I understand that there is no Multiply or Divide function in LMC and I would like to know why that is. 回答1: The LMC serves educational purposes, and is not intended to excel in efficiency. "The Architecture of Computer Hardware and System Software" (4 th ed. 2009), chapter 6 is one of the main references for the LMC. That chapter starts with this phrase: The

What happens to instructions given to the Little man in the LMC that begin with 4?

久未见 提交于 2020-06-27 13:16:32
问题 This might be a really strange question, but I have been doing some work on the little man computer and it mildly annoys me that not only is there no operation code number 4, but there is absolutely no information on the internet as to why. The opcodes go 0-9 but skip 4. Are there never any three digit codes that start with 4? What happens if there is? Is there anyone out there that would be able to help answer this question? I just find it so strange. Thank you! 回答1: The Little Man Computer

How can I store an unknown number of inputs in different addresses in LMC (little-man-computer)?

£可爱£侵袭症+ 提交于 2019-12-12 21:28:53
问题 I want to create a code that ask the user to input a number n, then ask for n inputs and store them all in different addresses so they can be read as instructions to be executed. However, I'm stuck, because I don't know how to store n inputs in n different adresses. So far I am able to ask for an input n and then ask for n inputs, but they are all stored in the same address. Here is my code: IN STO N loopTop IN STO NBS LDA N SUB ONE STO N BRZ done BR loopTop done OUT HLT ONE DAT 001 N DAT 000

LMC: base conversion from decimal to base 9 included

余生长醉 提交于 2019-12-02 05:42:14
问题 I am trying to create an LMC assemble code that will allow a user to put two inputs: a decimal number and a base that the number should be converted to. The code should be able to convert any decimal number to any base between 2 and 9 included. I am aware that the division is not available on LMC: I can use subtractions. Lets say, from 12 decimal to base 3, I am able to get 12-3-3-3-3= 4, but how can I make the code understand that the rest of the division 12/3= 4 and rest of the division is