An Example Hardwired CPU

1  Introduction

2  Architecture

3  Instruction Set

op1 op2 Rd Rs immediate
2 2 2 2 8

4  Instruction Phases

5  CPU Control Lines

6  Inside the Decode Logic

Figs/irdecode.gif

6.1  Phase Zero

6.2  Phase One

op1 op2 instruct pcsel pcload irload imload rw dwrite jumpsel addrsel regsel dreg sreg aluop
0x xx all x 0 0 0 0 0 0 0 x x x x
1x xx all 1 1 0 1 0 0 0 0 x x x x

6.3  Phase Two

op1 op2 instruct pcsel pcload irload imload rw dwrite addrsel regsel dreg sreg aluop
00 00 AND Rd, Rs x 0 0 0 0 1 x 3 Rd Rs op2
00 01 OR Rd, Rs x 0 0 0 0 1 x 3 Rd Rs op2
00 10 ADD Rd, Rs x 0 0 0 0 1 x 3 Rd Rs op2
00 11 SUB Rd, Rs x 0 0 0 0 1 x 3 Rd Rs op2
01 00 LW Rd, (Rs) x 0 0 0 0 1 2 2 Rd Rs x
01 01 SW Rd, (Rs) x 0 0 0 1 0 3 x Rd Rs x
01 10 MOV Rd, Rs x 0 0 0 0 1 x 1 Rd Rs x
01 11 NOP x 0 0 0 0 0 x x x x x
10 00 JEQ Rd, immed 0 j 0 0 0 0 x x Rd x op2
10 01 JNE Rd, immed 0 j 0 0 0 0 x x Rd x op2
10 10 JGT Rd, immed 0 j 0 0 0 0 x x Rd x op2
10 11 JLT Rd, immed 0 j 0 0 0 0 x x Rd x op2
11 00 LW Rd, immed x 0 0 0 0 1 1 2 Rd x x
11 01 SW Rd, immed x 0 0 0 1 0 1 x Rd x x
11 10 LI Rd, immed x 0 0 0 0 1 x 0 Rd x x
11 11 JMP immed 0 1 0 0 0 0 x x x x x

6.4  Read/Write Logic

6.5  Register Select Logic

6.6  Destination Register Write Logic

6.7  Address Select Logic

00 (zero) Program Counter
01 (one) Immediate Register
10 (two) sbus, i.e the source register
11 (three) dbus, i.e the source register

6.8  Jump Logic

6.9  Finally ...

7  Implementing the CPU

8  An Example Program

9  Other Areas of the CPU

9.1  The PC Adder

9.2  The Register File




File translated from TEX by TTH, version 3.85.
On 19 Dec 2010, 11:36.