STORE4> SUB5> IN6> OUT7> END8> JMP9> SKIPZ31104130//STORE O67//OUT 711/LOAD 1//OUT 7//END6770Output SpecificationsEach piece of the architecture must be accurately represented in...


Example:<br>The Problem<br>Input File<br>Using C programming language write a program that simulates a variant of the Tiny Machine<br>Architecture. In this implementation memory (RAM) is split into Instruction Memory (IM) and Data<br>Memory (DM). Your code must implement the basic instruction set architecture (ISA) of the Tiny<br>Machine Architecture:<br>//IN 5<br>//OUT 7<br>//STORE O<br>//IN 5<br>//OUT 7<br>//STORE 1<br>//LOAD O<br>//SUB 1<br>55<br>67<br>30<br>55<br>67<br>1 LOAD<br>2- ADD<br>3> STORE<br>4> SUB<br>5> IN<br>6> OUT<br>7> END<br>8> JMP<br>9> SKIPZ<br>31<br>10<br>41<br>30<br>//STORE O<br>67<br>//OUT 7<br>11<br>/LOAD 1<br>//OUT 7<br>//END<br>67<br>70<br>Output Specifications<br>Each piece of the architecture must be accurately represented in your code (Instruction Register, Program<br>Counter, Memory Address Registers, Instruction Memory, Data Memory, Memory Data Registers, and<br>Accumulator). Data Memory will be represented by an integer array. Your Program Counter will begin<br>pointing to the first instruction of the program.<br>Your simulator should provide output according to the input file. Along with this output your program<br>should provide status messages identifying details on the workings of your simulator. Output text does<br>not have to reflect my example word-for-word, but please provide detail on the program as it runs in a<br>readable format that does not conflict with the actual output of your simulator. After each instruction print<br>the current state of the Program Counter, Accumulator, and Data Memory. The INPUT instruction is the<br>only one that should prompt an interaction from the user.<br>For the sake of simplicity Instruction Memory (IM) and Data Memory (DM) may be implemented<br>as separate arrays.<br>Hint: Implementing a struct for your Instructions and an array of these structs as your Instruction<br>Memory greatly simplifies this program.<br>Example:<br>Assembling Program...<br>Program Assembled.<br>Example:<br>typedef struct {<br>int opCode, device Or Address;<br>} Instruction;<br>Run.<br>PC = 10|A= NULL|DM= [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]<br>Instruction IM[MAXPROGRAMSIZE];<br>/* input value */<br>Note: IM, MDR1, and IR are of type Instruction. All other CPU registers and Data Memory (DM) are of<br>type int.<br>PC = 11 | A=X|DM = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]<br>/* outputting accumulator to screen */<br>Input Specifications<br>PC = 12| A=X| DM= [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]<br>* storing accumulator to memory location 0 */<br>PC = 13 | A =X|DM = [X, 0, 0, 0, 0, 0, 0, 0, 0, 0]<br>Your simulator must run from the command line with a single input file as a parameter to main. This file<br>will contain a sequence of instructions for your simulator to store in

Extracted text: Example: The Problem Input File Using C programming language write a program that simulates a variant of the Tiny Machine Architecture. In this implementation memory (RAM) is split into Instruction Memory (IM) and Data Memory (DM). Your code must implement the basic instruction set architecture (ISA) of the Tiny Machine Architecture: //IN 5 //OUT 7 //STORE O //IN 5 //OUT 7 //STORE 1 //LOAD O //SUB 1 55 67 30 55 67 1 LOAD 2- ADD 3> STORE 4> SUB 5> IN 6> OUT 7> END 8> JMP 9> SKIPZ 31 10 41 30 //STORE O 67 //OUT 7 11 /LOAD 1 //OUT 7 //END 67 70 Output Specifications Each piece of the architecture must be accurately represented in your code (Instruction Register, Program Counter, Memory Address Registers, Instruction Memory, Data Memory, Memory Data Registers, and Accumulator). Data Memory will be represented by an integer array. Your Program Counter will begin pointing to the first instruction of the program. Your simulator should provide output according to the input file. Along with this output your program should provide status messages identifying details on the workings of your simulator. Output text does not have to reflect my example word-for-word, but please provide detail on the program as it runs in a readable format that does not conflict with the actual output of your simulator. After each instruction print the current state of the Program Counter, Accumulator, and Data Memory. The INPUT instruction is the only one that should prompt an interaction from the user. For the sake of simplicity Instruction Memory (IM) and Data Memory (DM) may be implemented as separate arrays. Hint: Implementing a struct for your Instructions and an array of these structs as your Instruction Memory greatly simplifies this program. Example: Assembling Program... Program Assembled. Example: typedef struct { int opCode, device Or Address; } Instruction; Run. PC = 10|A= NULL|DM= [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Instruction IM[MAXPROGRAMSIZE]; /* input value */ Note: IM, MDR1, and IR are of type Instruction. All other CPU registers and Data Memory (DM) are of type int. PC = 11 | A=X|DM = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] /* outputting accumulator to screen */ Input Specifications PC = 12| A=X| DM= [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] * storing accumulator to memory location 0 */ PC = 13 | A =X|DM = [X, 0, 0, 0, 0, 0, 0, 0, 0, 0] Your simulator must run from the command line with a single input file as a parameter to main. This file will contain a sequence of instructions for your simulator to store in "Instruction Memory" and then run via the fetch/execute cycle. In the input file each instruction is represented with two integers: the first one represents the opcode and the second one a memory address or a device number depending on the instruction.
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here