Title: Single Cycle CPU
1Single Cycle CPU
Chris Nevison, Colgate University (with minor
modifications by Alyce Brady, Kalamazoo College)
2Read Select
M U X
Data Out
M U X
Data Out
Register File Read 2 Registers Simultaneously
3Read Select
M U X
D E C O D E R
Data Out
Write Select
M U X
Data Out
Write Enable
Clock
Data In
Register File Read 2 and Write 1 Simultaneously
4 Write?
Registers
Select Register
Data Output
Data Input
One Step Back
5 Write?
Which op.
Registers
Select
R-Type Instruction Path e.g., add t0, t1, t2
6 Write
Registers
Mem Read
Select
Data Memory
0 1
M U X
1 0
M U X
Sign Ext
Mem Write
Immediate
R-Type Instruction Path (in a larger
context) e.g., add t0, t1, t2
7 Write
Registers
Mem Read
Select
Data Memory
0 1
M U X
1 0
M U X
Sign Ext
Mem Write
Immediate
Load/Store Instruction Path e.g., sw t0,
100(s0)
8 Write
Registers
Mem Read
Select
Data Memory
0 1
M U X
1 0
M U X
Sign Ext
Mem Write
Immediate
Load/Store Instruction Path e.g., lw t0,
100(s0)
925-21
Write
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
Mem Write
15-0
Instruction Path with Instruction from Memory
10Simple Instruction Path, including Incrementing
the Program Counter
4
Detect Zero
25-21
Write
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
Mem Write
15-0
111 0
M U X
M U X
0 1
Shft Left 2
4
Branch
Detect Zero
25-21
Write
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
Mem Write
15-0
Branch Instruction Path e.g., beq s0, zero,
addr
12Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
4
Jump
Detect Zero
25-21
Write
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
Mem Write
15-0
Jump Instruction Path e.g., j addr
13Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
4
Jump
and Branch
Detect Zero
25-21
Write
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
Mem Write
15-0
14Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
15Control Lines, Top to Bottom
- A RegDst
- B Jump
- C Branch
- D MemWrite
- E MemToReg
- F ALUOp
- G MemRead
- H ALUSrc
- I RegWrite
16Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Sign Ext
R-Type Start to 10 ns
Mem Write
15-0
ALU CTRL
5-0
17Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
ADD
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
ALU
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
R-Type Register Rd 10-15 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
18Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
ADD
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
ALU
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
R-Type ALU 15-25 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
19Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
ADD
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
ALU
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
R-Type Reg Write 25-30 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
20Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Load Word 0-10 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
21Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Load Word Reg Read 10-15 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
22Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Load Word Address Comp 15-25 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
23Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Load Word Memory Access 25-35 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
24Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
Load Word Memory Access 35-40 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
25Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
BEQ 0-10 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
26Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
BEQ Register Rd 10-15 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0
27Shft Left 2
25-0
1 0
M U X
M U X
0 1
31-28
Shft Left 2
A B C D E F G H I
4
C O N T R O L
31-26
25-21
Write
Zero
20-16
PC
Instruction Memory
Registers
Mem Read
M U X
0 1
Data Memory
0 1
M U X
15-11
1 0
M U X
BEQ ALU test 15-25 ns
Sign Ext
Mem Write
15-0
ALU CTRL
5-0