Design A Simple 32-Bit
Design A Simple 32-Bit
All instructions are 32-bit wide. Three instructions format : R-type,I-type and J-type. Op: 6-bit opcode of the instruction Rs,Rt,Rd: 5-bit source and destination register numbers. Sa: 5-bit shift amount used by shift instructions Funct: 6-bit function field for R-type instructions Immediate: 16-bit immediate value or address offset Immediate: 26-bit target address of the jump instruction
OVERVIEW
Using
two previous lab projects(register and ALU) for single-cycle CPU design. Using datamem.v and instrmem.v for design. The instructions include: R-type: ADD,SUB,SLT,JR I-type : SW,LW,BNE,XORI J-type: J
Memory Instruction memory where instructions are stored Data memory where data is stored Registers 32 32-bit general purpose registers, R0 is always zero Read source register Rs Read source register Rt Write destination register Rt or Rd Program counter PC register and Adder to increment PC Sign and Zero extender for immediate constant ALU for executing instructions
Combinational Elements
ALU, Adder Immediate extender Multiplexers Instruction memory Data memory PC register Register file Timing of reads and writes
5 5 5 32 32 16
32 32
Extend
m u x
1
select
32
A L U
32
ExtOp
ALU control
Storage Elements
PC
Instruction
32
32 32 32
Data Memory
Address Data_out Data_in
32
Address
Instruction Memory
Registers
RA RB RW BusA BusB BusW
32
MemRead
32 32
MemWrite
Clocking methodology
Clock RegWrite
xx