Академический Документы
Профессиональный Документы
Культура Документы
Complex instructions have certain disadvantages that a small percentage of such instructions can sometimes reduce a computers overall performance. Processors having small simple instructions each having k time units, it can execute 100 instructions in 100k time units If 5% of instructions are slow requiring 21K units each, to execute an average set of 100 instructions requires (5*21 +95)k = 200 time units.
Example - RISC Architectures -Hewlett Packard PA- RISC -IBM and MOTOROLA Power PC -SGI MIPS -SPARC Developed by SUN Microsystems -ARM Advanced RISC machine
Data Types: 8-bit, 16-bit, 32-bit for integer data 32-bit single precision, 64-bit double precision
Addressing Modes:
Since one register that has zero always when used in addressing mode can be synthesized using r0 as the base displacement addressing.
Instruction Formats:
To provide facility for pipelining in the architecture all instructions are made of size 32-bits with a 6-bit primary opcode.
Op 6
RS1 5
RS2 5
RD 5
OP X 11
RS1 source register 1 RS2 source register 2 Rd destination register OP operation details.
Multi-Cycle
break fetch/execute cycle into multiple steps perform 1 step in each clock cycle advantage: each instruction uses only as many cycles as it needs
Pipelined
execute each instruction in multiple steps perform 1 step / instruction in each clock cycle process multiple instructions in parallel assembly line
Implementing MIPS
arithmetic-logic instructions: add, sub, and, or, slt memory-reference instructions: lw, sw control-flow instructions: beq, j
6 bits
5 bits
5 bits
5 bits
5 bits
6 bits
op
6 bits
rs
5 bits
rt
5 bits
rd
shamt
16 bits
funct
R-Format
op
6 bits
rs
rt
26 bits
offset
I-Format J-Format
op
address
Two types of functional elements in the hardware: elements that operate on data (called combinational elements) elements that contain data (called state or sequential elements)
An overview of Implementation:
Send Program Counter(PC) to memory that contains code and fetch the instruction from that memory
Read one or two registers, using fields of the instruction to select the registers to read. For the load word instruction, we need to read only one register, but most other instructions require that we need two registers.
All instruction classes except jump use arithmetic-logic unit (ALU) after reading the registers.
After using ALU, the actions required to complete various instruction classes differ A memory reference instruction will need to access memory either to write data for a store or read data for load An arithmetic/logical instruction write data from the ALU back into the register For branch instruction may need to change the next instruction address based on comparison.
Add
4
Separate adder as ALU operations and PC increment occur in the same clock cycle
PC
Registers Read register 1 Read Read data 1 register 2 Read Write data 2 register Write data RegWrite 16
3 ALUSrc M u x
ALU operation
MemWrite MemtoReg
Address
Read data
Instruction memory
M u x
Sign 32 extend
Separate instruction memory as instruction and data read occur in the same clock cycle
PCSrc Add 4 Shift left 2 Registers Read register 1 Read Read data 1 register 2 Write register Write data RegWrite 16 Read data 2 3 ALU operation Add ALU result M u x
New multiplexor
PC
ALUSrc
M u x
Data memory
M u x
MemRead