联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2019-05-20 11:20

159.233 Assignment 3 - The Superpicocomputer!

Due 24th May 2019

This assignment is concerned with the design of a microcoded control unit for a simple CPU. The Picocomputer described in

the lectures notes has 6 simple instructions. The Superpicocomputer for this assignment has 7 instructions, as follows:

Opcode Name Operand Description

0 LDA address Load byte in memory at address given by operand into the Accumulator

1 STA address Store byte in Accumulator in memory at address given by operand

2 ADD address Add byte in memory at address given by operand to the Accumulator

3 SUB address Subtract byte in memory at address given by operand from the Accumulator

4 JMP address Always fetch next instruction from address given by operand

5 JPZ address If Accumulator is zero, fetch next instruction from address given by operand

6 JPC address If last Add or Sub operation caused a carry, fetch next instruction from address given by

operand

Stream has the following files

superpico.lgf - the log file for the superpicocomputer, you are not allowed to change this.

ucodeasm.c - the microcode assembler

picoucode - the microcode text file with the first two instructions completed

The outputs from the microcode ROM are:

oepc, oemem, oeacc, oeconst - output enables

ldmar, ldpc, ldacc, ldabr, ldir - load a register

incpc - increment PC

write - write to memory

sub - perform subtraction instead of addition

irnext - next microinstruction is at address IR+8

carry - bottom bit of next microinstruction address is carry out

eqz - bottom bit of next microinstruction address is eqz

To write the microcode, use the microcode assembler, this lets you type in the microcode as text. A line of microcode starts

with the number of the instruction followed by a colon, this is followed by the outputs that are to be asserted separated by

spaces. A number with a colon before it represents the address of the next micoinstruction and // means the rest of the line is a

comment. The microcode assembler inserts the microcode into the superpico.lgf file and opens it in log. You will need to put

the files in your log folder.

To start the superpicocomputer, clear the 'stop' input by clicking it, to debug your microcode you can step through it by setting

'stop' and then clicking 'step' repeatedly. To reset the PC, set and then clear the 'reset' input. Note that the datapath is very

similar to the datapath for the picocomputer.

Note that the maximum size of the microprogram is 32 instructions and you can't use oepc and incpc in the same

microinstruction. The test program should print Fibonacci numbers. If it does not do this, then your microcode does not work.

Be aware that your microcode does not print Fibonacci numbers, it executes the instructions in my test program to print the

numbers.

You must submit your picoucode file in stream. Submit the text file for your microcode, do not submit the lgf file!.

Marks will be awarded for efficient, working microcode. Use comments in the microcode as documentation. Marks will be

subtracted for plagiarism, late submission and bad documentation. Even if your microcode does not work, you should still

submit it.

M Johnson 2019


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp