Professional Documents
Culture Documents
301 RISC Processor Fa14
301 RISC Processor Fa14
Allison
I. Application You are to complete the design of an 16-bit “Reduced Instruction Set Computing” (RISC)
processor that will fetch and execute a simple set of 16-bit machine instructions.
II. Instruction Set Architecture -- The 16 opcodes for 16-bit RISC Processor will be encoded in bits IR[15:9]
of the instruction register. IR[8:6] will have the binary code for the destination register. IR[5:3] and IR[2:0]
will have the binary codes for the source registers.
A. Memory Structure
1. 256x16 address space
2. Each memory location holds one 16-bit word.
B. Processor Register Set (available to user)
1. Eight 16-bit integer registers (R0, R1, R2, R3, R4, R5, R6 and R7).
2. 16-bit Program Counter (PC).
3. Flags Register (N, Z, C)
C. Data Types -- 16-bit single word signed integer (i.e. -32768 to +32767)
D. Addressing Modes
1. Immediate (16-bit integer, in a “trailing word”)
2. Register
3. Register indirect (load, store and jmp)
4. PC relative (je, jne and jc)
E. Instruction Opcodes/Formatting
1. Double‐source op’s: all these instructions are register based. No memory accesses are allowed.
15 9 8 6 5 3 2 0
Triple operand operations (i.e. add / sub / cmp) are to be performed as:
dest_reg src1_reg operation src2_reg
Example: sub r4, r2, r3 ; {N,Z,C, r4} r2 ‐ r3 [Binary code: 1110001_100_010_011]
cmp r6, r7 ; {N,Z,C} r6 ‐ r7 [Binary code: 1110010_000_110_111]
2. Single‐source op’s: all single-operand (i.e. single source operand) instructions are register based.
No memory accesses are allowed.
All single source operand operations (i.e. mov / shl / shr/ inc/ dec) are to be performed as:
dest_reg operation src2_reg
Examples: dec r4 ; {N,Z,C, r4} r4 – 1 [Binary code: 1110111_100_000_100]
shl r5, r1 ; {N,Z,C, r5} r1 << 1 [Binary code: 1110100_101_000_001]
mov r6, r7 ; r6 r7 [Binary code: 1110011_110_000_111]
4. Conditional jumps (relative), Jump (register indirect): the result of a “jump” type instruction is
to change the PC (if applicable). The “effective address” of the “conditional jump” instructions is
calculated by adding the 16-bit “sign-extension” of a 8-bit signed offset to the Program Counter.
15 9 8 7 0
The “effective address” of the “unconditional” jump instruction is the contents of the src2_reg.
15 9 8 6 5 3 2 0
opcode src2_reg
F. Reset
In response to an external reset input, your processor should do the following:
(1) PC 00h (2) Flags (N,Z,C) 0002 (3) Goto the “fetch state”
301 RISC Specifications – Page 2