Find Jobs
Hire Freelancers

simple CPU simulation

$30-5000 USD

Завершено
Опублікований over 21 years ago

$30-5000 USD

Оплачується при отриманні
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
ID проекту: 2907827

Про проект

7 пропозицій(-ї)
Дистанційний проект
Активність 21 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
See private message.
$8 USD за 14 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0
7 фрілансерів(-и) готові виконати цю роботу у середньому за $40 USD
Аватарка користувача
See private message.
$51 USD за 14 дні(-в)
5,0 (10 відгуки(-ів))
5,2
5,2
Аватарка користувача
See private message.
$85 USD за 14 дні(-в)
5,0 (18 відгуки(-ів))
4,2
4,2
Аватарка користувача
See private message.
$14,45 USD за 14 дні(-в)
5,0 (8 відгуки(-ів))
3,7
3,7
Аватарка користувача
See private message.
$25,50 USD за 14 дні(-в)
3,9 (24 відгуки(-ів))
2,8
2,8
Аватарка користувача
See private message.
$8,50 USD за 14 дні(-в)
5,0 (5 відгуки(-ів))
2,4
2,4
Аватарка користувача
See private message.
$85 USD за 14 дні(-в)
5,0 (8 відгуки(-ів))
2,3
2,3

Про клієнта

Прапор UNITED KINGDOM
United Kingdom
0,0
0
На сайті з лют. 17, 2003

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.