Irish Potato Famine
From Ece
Contents |
Team Name and Members
Team name: Irish Potato Famine (IPF)
Team leader: Brice McElroy
Team member: Tina McGlaston
Design Overview
The team will create a 16-bit processor based on the MIPS instruction set. Our processor will implement 15 instructions, use 12 registers, and use separate program and data memories. The clocking type will be rising edge triggered. The processor will utilize pipe-lining when possible by forwarding, and the necessary signals to indicate data hazards. These will be contained in the datapath. Below is a description of the register file.
| Register Address | Register Name |
|---|---|
| 0000 | $zero |
| 0001 | $v0 |
| 0010 | $v1 |
| 0011 | $v2 |
| 0100 | $v3 |
| 0101 | $t0 |
| 0110 | $a0 |
| 0111 | $a1 |
| 1000 | $t1 |
| 1001 | $t2 |
| 1010 | $t3 |
| 1011 | $t4 |
Instruction Format
R-Format
| Opcode | rs | rt | rd/func |
|---|---|---|---|
| 4 bits | 4 bits | 4 bits | 4 bits |
I-Format
| Opcode | rs | Immediate8 |
|---|---|---|
| 4 bits | 4 bits | 8 bits |
J-Format
| Opcode | Address |
|---|---|
| 4 bits | 12 bits |
Instructions
| Name | Mnemonic | Operation | Opcode | Format |
|---|---|---|---|---|
| Add | add | add $s1, $s2, $s3; $s3 = $s1 + $s2 | 0000 | R |
| Add immediate | addi | addi $s1, 100; $s1 = $s1 + 100 | 0001 | I |
| Subtract | sub | sub $s1, $s2, $s3; $s3 = $s1 - $s2 | 0010 | R |
| And | and | and $s1, $s2, $s3; $s3 = $s1 & $s2 | 0011 | R |
| Or Immediate | ori | ori $s1, $s1, 1; $s1 = $s1 | 1 | 0100 | I |
| Or | or | or $s1, $s2, $s3; $s3 = $s1 | $s2 | 0101 | R |
| Exclusive Or | xor | xor $s1, $s2, $s3; $s3 = $s1 ^ $s2 | 0110 | R |
| Shift Left logical | sll | sll $s1, 1; $s1 = $s1 << 1; | 0111 | I |
| Shift Right logical | srl | srl $s1, 1; $s1 = $s1 >> 1; | 1000 | I |
| Branch Equal to Zero | bez | bez $s1, L; if $s1 == 0; go to L | 1001 | I |
| Branch if not equal | bne | bne $s1, $s2, BranchAddr; if $s1 != $s2; pc = pc + 4 + BranchAddr | 1010 | R |
| Set Less Than | slt | slt $s1, $s2, $s3; $s3 = ($s1 < $s2); | 1011 | R |
| Load Word | lw | lw $s1, A($s2); $s1 = Mem[$s2 + SignExtImm] | 1100 | R |
| Store word | sw | sw $s1, A($s2); Mem[$s0 + SignExtImm] = $s1 | 1101 | R |
| Jump | j | j address; pc = address | 1110 | J |
Assembly language and machine code for the test program
while ($a1 > 0) do {
$a1 = $a1 - 1;
$t0 = Mem[$a0];
if ($t0 > 0100hex) then {
$v0 = $v0 ÷ 8;
$v1 = $v1 | $v0; //or
Mem[$a0] = FF00hex;
}
else {
$v2 = $v2 × 4;
$v3 = $v3 ⊕ $v2; //xor
Mem[$a0] = 00FFhex;
}
$a0 = $a0 + 2;
}
return;




