The Problem Input File 55 67 gC 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 Using 30 55 67 1+ LOAD 2- ADD 3 STORE 4 SUB 5 IN 6+ OUT 7 END 8+ JMP 9> SKIPZ OUT 7 /STORE I LOADO /SUB I /STORE O OUT 7 LOAD 1 OUT 7 END 31 10 41 30 67 11 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. Äfter 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 (DMI) 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: Example: Assembling Program. Program Assembled. typedef struct { int gCode, 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, MDRI, 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] 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 * storing accumulator to memory location 0/ PC = 13|A=X|DM = [X, 0,0, 0, 0, 0,0, 0,0, 0] instnuction
The Problem Input File 55 67 gC 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 Using 30 55 67 1+ LOAD 2- ADD 3 STORE 4 SUB 5 IN 6+ OUT 7 END 8+ JMP 9> SKIPZ OUT 7 /STORE I LOADO /SUB I /STORE O OUT 7 LOAD 1 OUT 7 END 31 10 41 30 67 11 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. Äfter 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 (DMI) 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: Example: Assembling Program. Program Assembled. typedef struct { int gCode, 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, MDRI, 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] 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 * storing accumulator to memory location 0/ PC = 13|A=X|DM = [X, 0,0, 0, 0, 0,0, 0,0, 0] instnuction
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 8 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY