Find Jobs
Hire Freelancers

simple CPU simulation

$30-5000 USD

Færdiggjort
Slået op cirka 21 år siden

$30-5000 USD

Betales ved levering
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
Projekt-ID: 2907827

Om projektet

7 forslag
Projekt på afstand
Aktiv 21 år siden

Leder du efter muligheder for at tjene penge?

Fordele ved budafgivning på Freelancer

Fastsæt dit budget og din tidsramme
Bliv betalt for dit arbejde
Oprids dit forslag
Det er gratis at skrive sig op og byde på jobs
Tildel til:
Brug Avatar.
See private message.
$8 USD på 14 dage
0,0 (0 anmeldelser)
0,0
0,0
7 freelancere byder i gennemsnit $40 USD på dette job
Brug Avatar.
See private message.
$51 USD på 14 dage
5,0 (10 anmeldelser)
5,2
5,2
Brug Avatar.
See private message.
$85 USD på 14 dage
5,0 (18 anmeldelser)
4,2
4,2
Brug Avatar.
See private message.
$14,45 USD på 14 dage
5,0 (8 anmeldelser)
3,7
3,7
Brug Avatar.
See private message.
$25,50 USD på 14 dage
3,9 (24 anmeldelser)
2,8
2,8
Brug Avatar.
See private message.
$8,50 USD på 14 dage
5,0 (5 anmeldelser)
2,4
2,4
Brug Avatar.
See private message.
$85 USD på 14 dage
5,0 (8 anmeldelser)
2,3
2,3

Om klienten

Flag for UNITED KINGDOM
United Kingdom
0,0
0
Medlem siden feb. 17, 2003

Klientverificering

Tak! Vi har sendt dig en e-mail med et link, så du kan modtage din kredit.
Noget gik galt, da vi forsøgte at sende din mail. Prøv venligst igen.
Registrerede brugere Oprettede jobs i alt
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Indlæser forhåndsvisning
Geolokalisering er tilladt.
Din session er udløbet, og du er blevet logget ud. Log venligst ind igen.