Computer/Architecture

MIPS Instruction

Detacher 2012. 7. 20. 10:18

MIPS(Microprocessor without Interlocked Pipeline Stages)

RISC(Reduced Instruction Set Computer) 방식

 - CPU 명령어 개수를 줄여 하드웨어 구조를 간단하게 하는 방식. 마이크로 프로세서를 설계하는 방식


32비트 기준


32개의 범용 32비트 레지스터를 가짐.

프로그램은 명령어들의 집합 

- CPU는 메모리 상에 올라와있는 Instruction Mem.를 찾아가서 명령어(Instruction)들을 하나씩읽어와 해독, 연산, 적재.

명령어는 3가지 타입 

- R, I, J

   6      5     5     5     5      6 bits
[  op  |  rs |  rt |  rd |shamt| funct]  R-type
[  op  |  rs |  rt | address/immediate]  I-type
[  op  |        target address        ]  J-type


R-type Instruction (6필드) - REGISTERS

Arithmetic instruction format

Op             rs              rt            rd            shamt            funct

6bit            5bit            5bit         5bit          5bit                6bit


Op - Operation 이름, funct 필드와 함께 Instruction 종류 나타냄.

rs - reg. source (5비트 - 32개 레지스터 선택 가능)

rt - reg. source (5비트 - 32개 레지스터 선택 가능)

rd - reg. destination 연산결과 값 저장 (5비트 - 32개 레지스터 선택 가능)

shamt - shift amount, shift 명령어에서 이동 크기

funct - Instruction 종류 나타냄. select the variant of the operation in the OP field


I-type Instruction (4필드) - IMMEDIATE

Transfer(lw, sw), conditional branch(beq, bne), imm(addi, ori, andi) format

address/immediate - 직접연산


J-type Instruction (2필드) - JUMP

jump instruction format

target address - 목적지 주소







'Computer > Architecture' 카테고리의 다른 글

C언어 -> MIPS instruction  (0) 2012.07.22
Arithmetic  (0) 2012.07.20
Imm, unsigned  (0) 2012.07.20
Program Counter -> Instruction Memory  (0) 2012.07.20
어셈블리어 용어  (0) 2012.07.20