Professional Documents
Culture Documents
Processor Design - Chapter 8
Processor Design - Chapter 8
Chapter 8:
Programmable Processors
Slides to accompany the textbook Digital Design, First Edition,
by Frank Vahid, John Wiley and Sons Publishers, 2007.
http://www.ddvahid.com
1 0
s
Registers
Controller
Comparator
Arithmetic &
Logic Unit
8.2
Basic Architecture
• Processing generally consists of:
somehow
– Loading some data connected
to the
– Transforming that data Data memory D outside
world
– Storing that data
• Basic datapath: Useful circuit in a n-bit
2x1
programmable processor
– Can read/write data memory, where main
Register file RF
data exists
– Has register file to hold data locally
– Has ALU to transform local data ALU
Datapath
Basic Datapath Operations
• Load operation: Load data from data memory to RF
• ALU operation: Transforms data by passing one or two RF register values through
ALU, performing operation (ADD, SUB, AND, OR, etc.), and writing back into RF.
• Store operation: Stores RF register value back into data memory
• Each operation can be done in one clock cycle
Data memory D Data memory D Data memory D
Init
IR=I[PC]
Fetch
PC=0 PC=PC+1
Controller n-bit
2x1
PC IR
Register file RF
Controller
ALU
Instruction memory I
0: 0000 0000 00000000
1: 0000 0001 00000001 Instructions in 0s and 1s –
2: 0010 0010 0000 0001 machine code
3: 0001 0010 00001001
opcode operands
Program for Three-Instruction Processor
Desired program
0: RF[0]=D[0]
1: RF[1]=D[1]
2: RF[2]=RF[0]+RF[1]
3: D[9]=RF[2}
Computes
D[9]=D[0]+D[1]
Instruction memoryI
0: 0000 0000 00000000
Data memory D
1: 0000 0001 00000001
2: 0010 0010 0000 0001
3: 0001 0010 00001001
n-bit
2 1
PC IR
Register file RF
Controller
ALU
Decode
RF_W_addr 4 W_data
op=0000 op=0001 op=0010 W_addr
RF_W_wr
RF_Rp_addr 4 W_wr
Rp_addr
Load Store Add Controller RF_Rp_rd 16x 16
Rp_rd
RF_Rq_addr 4 RF
RF[ra]=D[d] D[d]=RF[ra] RF[ra] = Rq_addr
RF_Rq_rd
RF[rb]+ Rq_rd
RF[rc]
16 Rp_data Rq_data
alu_s0 16 16
A B
s0 ALU
Init
IR=I[PC]
Fetch
PC=0 PC=PC+1
D_addr 8
addr rd data I addr D
D_rd
Decode 16 rd 256x 16
D_wr
16 wr
PC IR W_data R_data
op=0000 op=0001 op=0010
clr up Id
16
16
Load Store Add 1 0
RF_s 16-bit
RF[ra]=D[d] D[d]=RF[ra] RF[ra] = s
PC_clr PC_inc I_rd IR_ld 2x1
RF[rb]+ 16
RF[rc]
RF_W_addr 4 W_data
W_addr
RF_W_wr
RF_Rp_addr 4 W_wr
Rp_addr
Controller RF_Rp_rd 16x 16
Rp_rd
RF_Rq_addr 4 RF
Rq_addr
RF_Rq_rd
Rq_rd
16 Rp_data Rq_data
alu_s0 16 16
A B
s0 ALU