mips

    [컴퓨터구조] 데이터패스(Datapath) 명령어 실행(MIPS)

    Datapath로 우리가 실행해 볼 명령어 1. 메모리 접근 명령어(memory-reference instructions) : lw , sw 2. 산술 논리 연산 명령어(arithmetic-logical instructions) : add, sub, and, or, slt 3. 흐름 제어 명령어(control flow instructions) : beq, j Datapath에서 명령어를 수행하는 과정 Fetch 1.PC 값을 이용해 명령어가 들어있는 주소(instruction address)를 찾는다. 2.메모리로부터 그 주소에 들어있는 명령어를 가져온다.(get intruction from memory) Decode 3.조합회로 내에서 간단하게 어떤 명령어인지 해석한다. Execute 4.필요한 레지스..

    [컴퓨터구조]MIPS Instruction Format

    Assembly code 는 기계어 형식으로 바꾸어 써야하며 MIPS 에서 기계어 형식은 3가지 type 이 존재한다. 1.R-type : 가장 기본적인 Instruction format - Arithmetic instruction format opcode : operation (6bit) rs : first source operand (5bit) rt : second source operand (5bit) rd : destination operand (5bit) shamt : shift amount (5bit) funct : function code (6bit) 예시) ADD $t0, $s0, $s1 ($t0 rt가 destination 역할) -사용하는 opcode A/L : ADDI , ORI Br..