Write down a c++ program for little man''s computer

Assignment Help Computer Engineering
Reference no: EM1333930

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.

Reference no: EM1333930

Questions Cloud

Aspects of judgments in the advice : Critically analyze Dan's friend's advice. Point out the relevant aspects as well as any judgments in the advice.
Trends and challenges paper and presentation : Prepare paper discussing existing trends and challenges in HR management and show how a complete performance management system differs from the use of annual performance appraisals
Vision and strategy of the organization : How does Coca Cola customer service perspective relate to the mission, vision and strategy of the organization?
Inflation and interest rates : What is the difference between systematic and unsystematic risk? How is the beta coefficient used to assess risk? Is it better to maximize return or minimize risk? Why?
Write down a c++ program for little man''s computer : 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)
Elucidate how an increase in your nominal income : Elucidate how an increase in your nominal income and a decrease in your real income might occur simultaneously.
Analyze the business strategy of kodak and wal-mart blockbus : Analyze the business strategy of Kodak, Wal-Mart and Blockbuster.
How is employment-at-will applied in your organization : How is employment-at-will applied in your organization or in one with which you are familiar and what extent do the exceptions to employment-at-will limit its application in the organization
Addressing the confidentiality of medical records : What interests are served by maintaining confidentiality of medical records?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to develop a simple scientific calculator

make a Clear button to clear the result text box and reset all controls.

  Explaining the access controls

Access controls are built on three key principles. List and define them briefly. And also explain how to apply these key principles on the smart phone devices GPS tracking system.

  Write down four logic functions that are true

Implement the four functions using a ROM.Assume that X consists of 3 bits, x2 x1 x0

  Program to determine weighted average of test

Write an algorithm for a program which prompts the user to enter the five test scores, determine total of the five tests and determine the weighted average of each test supposing that each test weighs 20%.

  Write java program that can serve as simple calculator

Write down a Java program that can serve as a simple calculator. This calculator keeps track of a single number (of type double) that is called result and that starts out as 0.0.

  Benefits of ansi/tia/eia cabling standards

Discuss about the benefits of the ANSI/TIA/EIA cabling standards in detail and also explain why telecommunications managers must be familiar with them.

  Modify java application that displays the product number

make a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit).

  Define the best possible scenario for an organization

If in a hypothetical situation your company was capable to hire only either technically sound managers with weak leadership skills OR strong leaders with less knowledge/interest in routine management, that would you opt for and why.

  Developing the sequential circuit

Develop a sequential circuit which can detect two or more consecutive 1's in a stream of the input bits. Specifically, if last two bits in sequence were 1, the circuit must output 1. Otherwise, it must output 0.

  Are there any other examples of famous projects

Are LANs a stable technology or are they changing just as fastly as other forms of communication technologies?

  Executing the request-response messages over smtp

How could you execute the request-response messages over SMTP that is a one-way protocol (do not assume any special receipt notification functionality that some mailers support)?

  What is csma/cd

What do you feel is the future for Token Ring? What are its advantages or disadvantages.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd