Find Jobs
Hire Freelancers

simple CPU simulation

$30-5000 USD

Completed
Posted about 21 years ago

$30-5000 USD

Paid on delivery
Design and develop software to model a very simple microprocessor system using UML to capture the design and C++ code to implement the design. ## Deliverables Use C++ code for the following use-cases: - Reset CPU Execute program instructions Single step (execute next instruction) Trace n (execute n instructions one at a timedisplaying each instruction as it executes) The CPU should have four registers - R0, R1, R2 and R3 and the following instruction types: - Instruction Description MOVE Rx,Ry move contents of Rx MOVE data_value, Rx move data value into Rx ADD Rx, Ry add Rx to Ry and store it in Ry Sub Rx, Ry subtract Rx to Ry and store in Ry OUTPUT Rx output contents of Rx to display HALT end of instructions where Rx and Ry are one of the register R0 - R3b All instructions are encoded as a three single digit numbers d1d2d3:- The first digit is the op-code, the next two digits are operands for the instruction. If the instruction only requires a single register then it is the last digit. If any operands are not required then the digit value is zero. The op-code for the different instruction types are :- Op-code Instruction type 1 MOVE register to register 2 MOVE data to a register 3 ADD 4 SUB 5 OUTPUT 6 HALT Examples of possible instruction codes and the equivalent instruction: - Instruction code Instruction 112 MOVE R1, R2 251 MOVE 5, R1 301 ADD R0, R1 430 SUB R3, R0 502 OUT R2 600 HALT You'll need to provide additional functions in the classes such as constructors and any others you think are relevant. Regarding classes: The flash ROM class could provide the following functions: - 1. void program(int*p) 2. void erase 3. int read(int location) The CPU class will need a member variable to represent the program counter and most likely additional functions to assist the execute function to fetch and decode the program instructions from the EPROM. You should test your implementation with the following outline sample program:- int instructions[] = {241,232,312,502,600}; /* MOV 4,R1 MOV 3,R2 ADD R1,R2 OUT R2 HALT */ The main program should look like the following: - //CPU and EPROM seperate void main () { CPU x; ROM e; [login to view URL](instructions); [login to view URL](); [login to view URL](e); }; Provide additional member functions to the above classes to enhance the microprocessor system to handle additional instruction such as overloading the ROM program() function to read the instructions from a file. Also add additional classes such as RAM to store data and INPUT to take input from the keyboard and possibly a computer class which aggregates all the components. Also consider error checking. ## Platform It needs to run on Visual C++ 6.0. Operating system - Windows NT
Project ID: 2907827

About the project

9 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$8 USD in 14 days
0.0 (0 reviews)
0.0
0.0
9 freelancers are bidding on average $34 USD for this job
User Avatar
See private message.
$51 USD in 14 days
5.0 (10 reviews)
5.2
5.2
User Avatar
See private message.
$22.10 USD in 14 days
4.8 (39 reviews)
3.7
3.7
User Avatar
See private message.
$14.45 USD in 14 days
5.0 (8 reviews)
3.7
3.7
User Avatar
See private message.
$85 USD in 14 days
5.0 (8 reviews)
3.2
3.2
User Avatar
See private message.
$25.50 USD in 14 days
3.9 (24 reviews)
2.8
2.8
User Avatar
See private message.
$8.50 USD in 14 days
4.1 (5 reviews)
2.7
2.7
User Avatar
See private message.
$8.50 USD in 14 days
5.0 (5 reviews)
2.4
2.4
User Avatar
See private message.
$85 USD in 14 days
5.0 (8 reviews)
2.3
2.3
User Avatar
See private message.
$17 USD in 14 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
United Kingdom
0.0
0
Member since Feb 17, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.