[Computer architecture] Instruction format

준치·2022년 3월 24일
0

[Computer architecture]

목록 보기
16/18

R(register) type instruction format

그림 1. R-type instruction format field

  • op : 명령어가 실행할 연산의 종류 (opcode)
  • rs, rt : 첫 번째와 두 번째 근원지(source) 피연산자 레지스터
  • rf : 목적지(destination) 레지스터, 연산 결과가 기억된다.
  • shmat(shift amount) : 자리이동 양
  • funct(function code) : op 필드에서 연산의 종류를 표시하고 funct 필드에서는 그 중의 한 연산을 구체적으로 지정 (function code)

피연산자가 두개인 연산종류에 사용된다.
ex) add, sub, etc.

I(Immediate) type instruction format


그림 2. I-type instruction format field

  • op : 명령어가 실행할 연산의 종류 (opcode)
  • rs : 첫 번째 피연산자 레지스터
  • rt : 적재 결과가 들어갈 목적지 레지스터
    - lw, sw 에서 구분 잘하자
  • constant or address : offset or constant 지정

수치 연산과 데이터 전송 명령어에서 사용된다.
ex) addi, lw, sw etc.

J(Jump) type instruction format


그림 3. J-type instruction format field
점프 명령에 사용하는 명령어 형식이다.
6-bits의 op와 26-bits의 address로 구성된다.
26-bits 뿐이지만 여러 주소 지정방식을 사용하여 32bits인 MIPS register에 접근할 수 있다.

Reference

[1] D. Patterson and J. Hennessy, ⌜Computer Organization and Design, 5th Edition⌟ , chapter 2
[2] D. Patterson and J. Hennessy.(2021) ⌜컴퓨터 구조 및 설계, 6th Edition⌟ (박명순 외 3 옮김). 한티미디어 chapter 2
profile
설계 엔지니어 지망생

0개의 댓글