The MemData bus is the same as project 2, except, that it is input for instructions
as well as data.
The input signals for the ALU with registers and Instruction decode are:
MemData which is a 32 bit bus.
RESET which is a 1 bit signal
that resets the CPU when low.
clk is a one bit clock input.
Cin is tied to 0 for this project.
MemRead is a 1 bit memory read control signal that selects
the MemData or the register file to be input on the y bus of the ALU.
The output signals are:
res is a 32 bit result bus
RW is an output that is a logic
"1" when the CPU is reading data from the external data bus.
Address is a 32 bit address bus which is equal to PC
(just a simple counter starting at 0,
that is set to 0 whenever RESET is low) during the fetch
cycle, it is equal to the last 15 bits of the instruction for a Branch, Load,
or Store instruction,
and set to z for other instructions.
Overflow is the high order Cout.
| Instruction | Opcode | destination register address |
source y register address | source x register address | immediate value
(address for jmp, load, and store) |
|---|---|---|---|---|---|
| 8 bits | 3 bits | 3 bits | 3 bits | 15 bits | |
| NOP | 00000000 | 000 | 000 | 000 | 000000000000000 |
| load R3, h00ff | 01010100 | 011 | 000 | 000 | 000000011111111 |
| store R5, h2AAA | 01001100 | 000 | 101 | 000 | 010101010101010 |
| and R5, R0, R7 | 00101000 | 101 | 000 | 111 | 000000000000000 |
| or R1, R0, R7 | 00011000 | 001 | 000 | 111 | 000000000000000 |
| xor R5, R0, R7 | 01011000 | 101 | 000 | 111 | 000000000000000 |
| add R1, R0, R7 | 01100001 | 001 | 000 | 111 | 000000000000000 |
| mov R1, R0 | 01000000 | 001 | 000 | 000 | 000000000000000 |
| not R1, R0 | 00111111 | 001 | 000 | 000 | 000000000000000 |
| bra h0987 | 11001100 | 000 | 000 | 000 | 000100110000111 |
When you upload the files there are two filenames to enter, your local filename (which can be anything) and the upload filename, which for the module files must end in .v and for the list of files must be alu32ireg.ver.
Feel free to email comments and suggestions to acken@okstate.edu