How we can implement a cardiac machine simulator in c++

Assignment Help Computer Engineering
Reference no: EM1331500

Implement a CARDIAC machine simulator in C++, that will:

- Keep track of CARDIAC memory cells in an array of 100 integers (0-99).
- Keep track of the bug location; which could be an index into the memory array. Watch out for cells 0 and 99; they are special.
- Read the input tape from a file that starts with a number telling you how many items are on the tape.
- Output to the screen.

Running instruction 9xx exits the program.

An example run of your application would look something like this.

input.txt (This is our first CARDIAC program with 946 instead of 900 and 002 instead of the blank.)
18
002
800
030
004
020
130
021
200
022
631
023
531
024
321
025
946
002
820

Acceptable screen output:
3
2
1
0

Operation codes are as follows:

Code Abbreviation Meaning
0 INP Copy input to memory.
1 CLA Copy memory to accumulator.
2 ADD Add memory to accumulator.
3 TAC Move bug if accumulator < 0.
4 SFT Shift accumulator left then right.
5 OUT Copy memory to output.
6 STO Copy accumulator to memory.
7 SUB Subtract memory from accumulator.
8 JMP Backup bug to 99 then move bug.
9 HRS move bug and stop computing.

Reference no: EM1331500

Questions Cloud

Explain how the below game should be set-up : Explain how the below game should be set-up, played and solved a consumer decide.
Write down a not so bad cardiac simulator : The user has to be prompted to type in a 3 digit number, and then the program should print to the screen whatever the CARDIAC Instruction Decoder box would show had that been the instruction.
Evaluating strategy : Identify the types of organizations that may need to evaluate strategy more frequently than others.
Incremental cash flows : Discuss qualitatively how you might have incorporated the likely growth of digital photography in the sales projections developed above?  (Remember hindsight is 20-20.)
How we can implement a cardiac machine simulator in c++ : Keep track of the bug location; which could be an index into the memory array. Watch out for cells 0 and 99; they are special. Read the input tape from a file that starts with a number telling you how various items are on the tape.
Explaining individualism and collectivism affectivity : Define the following relationships: Individualism v collectivism affectivity
Use the nadler tushman congruence model : Using the Nadler-Tushman Congruence Model, conduct an analysis of this chosen company's outputs. Remember that outputs exist at the individual, group and organizational levels and that there are often differences between the output goals an organizat..
Assume the price of every old edition microeonomic book : Assume the price of every old edition microeonomic book. Determine the values of B and T that maximize Sam's utility.
Literature review on organizational behaviour theories : Literature Review on Organizational Behaviour Theories - prepare a literature review to highlight how organizational behavioral theories apply to professional practice

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mapping the cache organization

A computer has a memory of 16 blocks, 32 bytes each, and a cache of 8 blocks, which blocks may be read from the block No. 5 in the cache, if the system utilizes: Fully associative the mapping cache organization.

  Listing the key points of the policies & procedures.

Find out some significant policies and procedures that system administrators use to set up desktop workstations

  Prompts the user to enter the number of students

Write down a Java program that prompts the user to enter the number of students and each student's name and score, and finally displays the student with the highest score and the student with second-highest score.

  Make a 2010 word flowchart listing the steps

You are sitting on a chair in a large room. You see an empty chair, facing you, across the room. You want to get to that chair on the other side of the room and sit in it.

  Encipher a message using a keyword

The first program will encipher a message using a keyword and second program will decipher a message using a keyword.

  Local v/s network printers

Write down a paper explaining the Windows Printer Model for Server 2008. Explain the local v/s network printers and how to decide which printers to deploy.

  Security devices for protection against different attack

Describe two or more attacks for which the routers (layer 3 devices) are vulnerable. Explain how these attacks are detected and prevented by the security devices.

  Address operating systems that .net does not support

Why will a company like Microsoft choose to create the .NET proprietary platform when J2EE is readily available? As a software developer, how could you address operating systems that .NET does not support.

  Code to declare the four pointer variables

In C++: A pointer variable may consist of a pointer to a valid object, a pointer to a deleted object, NULL, or the random value. Write down the code which generates and sets four pointer variables a, b, c, and d to display each of these possibilit..

  Find out the winner based on observation

Write down an application that randomly "throws"two dice and displays their values. Save as TwoDice.java

  Explain how vb .net uses a database

express how VB .NET uses a database. Briefly summarize the components of a database and the characteristics of a DBMS. Include a discussion of ADO .NET and its capabilities.

  How would you propose the update to star topology

How would you propose the update to Star topology

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