Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

We have to write a c++ program for Little man's computer in which

Input:
A text file containing machine code (not assembly code) for little man's computer following instruction set . Instructions are in different lines (no need for semicolon at the end of each instruction)

Arithmetic 1xx ADD
2xx SUB
Data Movement 3xx STORE
5xx LOAD
BR 6xx JUMP
BRZ 7xx BRANC ON 0
BRP 8xx BRANCH ON +
Input/Output 901 INPUT
902 OUTPUT
Machine Control 000 HALT
(coffee break) COB

Output:
Any output specified in the input file by 902 will be displayed on screen

Computer specification:
· Two digits memory (mail box) address: 00-99

· Three digits instruction or data in each memory slot

· One calculator, one program counter

· The program in the input file needs to be loaded into memory first and stored in consecutive slots starting from address 00

· 901 instruction will ask user's input from keyboard, 902 displays content in calculator

Other requirements:
Your program should accept any length of input program that can be fit in little man's 100 memory slots and generate correct result and/or output on screen.

Submit the source code together with readme file with instruction to compile, build and use your program.

Example:
Input file contains following code (return positive difference):
901
310
901
311
210
808
510
211
902
000
Running of the program with this input will ask user to input 2 numbers, let's say 5 and 10, the program will output the positive difference on the screen, which is 5.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9209300

Have any Question?


Related Questions in Computer Engineering

Consider the following half-reactionsoxidation

Consider the following half-reactions: Oxidation: 2I - (aq)  --> I 2(aq)  +2e - Reduction: MnO 4 - (aq)  +8H + (aq)  + 5e -  -->Mn 2+ (aq)  + 4H 2 O (l) a) Write the overall reaction. b) A galvanic cell based on this rea ...

What are the best practices to follow for microsoft windows

What are the best practices to follow for Microsoft Windows network security. Which two would you start with and why?

A sample of a compound is decomposed in the laboratory and

A sample of a compound is decomposed in the laboratory and produces 330 g carbon, 69.5 g hydrogen, and 220.2 g oxygen. Calculate the empirical formula of the compound. Express your answer as an empirical formula.

Suppose that you want an operation for the adt list that

Suppose that you want an operation for the ADT list that adds an array of items to the end of the list. The header of the method could be as follows. public void addAll(T[] items) Write an implementation of this method f ...

Suppose a bowl has 9 chips one chip is labeled 1 three

Suppose a bowl has 9 chips. One chip is labeled "1", three chips are labeled "3", and five chips are labeled "5". Suppose two chips are selected at random with replacement. Let the random variable X equal the absolute di ...

System analysis project can you answer the 4 questions at

System Analysis project: can you answer the 4 questions at the task section. Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning ...

A researcher thinks that listening to classical music

A researcher thinks that listening to classical music reduces anxiety. She measures the anxiety of 10 persons then plays Mozart's "Eine Kleine Nachtmusik". Following that the researcher measures their anxiety again. (Not ...

Reminder all files must be closed when you are done with

Reminder: All files must be closed when you are done with them, even if it stops early due to an IOError. If you're using with, this will happen automatically. If you're trying to close things manually using .close(), th ...

What service is defined as it services for example in a gym

What service is defined as IT services? For example, in a gym, is members called IT services? What else? could you give me another example?

Two people agree to meet at a coffee shop they each

Two people agree to meet at a coffee shop. They each independently pick a random moment in time between 8 a.m. and 9 a.m. and show up exactly at their selected time. But they are very impatient, and only stay for 10 minu ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As