159.233讲解、辅导Superpicocomputer、讲解c/c++编程语言、辅导c++
- 首页 >> 其他 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
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