본문 바로가기

카테고리 338

2. MIPS : Control Instruction Control Instructions = Branch instruction, Jump instrucition Instruction의 20%가 control instruction일 정도로 common case이다. 때문에 이를 single instruction으로 표현할 필요가 있기에 만들어졌다. Control instruction은 control flow(program execution flow)을 바꾼다. 즉 PC(Program Counter)의 값을 변경한다. 언제 jump하는지에 따라서 다음과 같이 구분된다. Conditional jump 조건이 충족할 때만 jump 수행 beq, bne Unconditional jump 항상 jump을 수행 무엇을 이용하여 jump하는지에 따라 구분 jump ta.. 2021. 4. 20.
2. MIPS : ALU and Data Transfer Instruction ALU Instruction ALU는 산술 연산과 논리 연산을 담당한다. Register Arithmetic Instruction Addressing mode는 instruction이 어떤 operand를 가질 수 있는지를 결정하는 것이다. RISC의 ALU instruction은 레지스터 기반으로, register addressing mode와 R-format을 사용한다. 변수나 데이터는 레지스터에 저장되어, 레지스터로 사용된다. 모든 arithmetic operation은 3개의 operand를 가진다. 2개는 source이고, 1개는 destination이다. 예 : add a, b, c 예시 C 코드에서 f = (g + h) - (i + j)라는 코드는 다음과 같이 MIPS code로 컴파일 된다.. 2021. 4. 17.
2. MIPS : Instruction Format & Addressing Mode Instruction Format ENIAC은 아니었지만 현대의 컴퓨터는 모두 stored program computer이다. 따라서 프로그램은 컴퓨터에 저장된다. 이를 위해서 instruction은 binary instruction(machine code)로 변환되어야 한다. MIPS는 32-bit instruction word로 encode된다. 이를 위해 32-bit instruction을 어떻게 나눠서 opcode, operand 등을 encoding 할 것인지 결정해야 한다. MIPS는 3종류의 구조가 있고, I-type instruction, R-type instruction, J-type instruction이다. Format Operand 개수 Operand 구성 Instructions I.. 2021. 4. 17.
2. MIPS Instruction Set Instruction Set Dependency Dependency(독점성)을 위해서 다른 프로세서는 다른 insturction set을 사용한다. 즉, 응용프로그램이 다른 프로세서로 넘어가기 힘들게 하여 고객을 뺏기지 않게 하기 위함이다. 그러나 기본적으로 오늘날의 컴퓨터는 모두 RISC style로, 32-bit 구조를 가지고 있다. HW-SW interaction 프로세서는 응용프로그램을 돌리기 위한 것이다. 때문에 프로세서 designer들은 어떻게하면 벤치마크를 빠르게 돌릴 수 있는가를 고민한다. 이를 HW-SW interaction이라 한다. CISC v.s. RISC CISC 하나의 instruction이 여러 기능을 담당한다. 메모리가 비쌌던 시절에 프로그램의 크기를 최대한 줄이는데 효율적.. 2021. 4. 17.
1. Multicore Amdahl's Law (Law of diminishing returns) Law of diminishing returns 라고도 한다. 컴퓨터 시스템의 일부를 개선할 때 전체적으로 얼마만큼의 최대 성능 향상이 있는지 계산하는 데 사용된다. $T_improved = \frac{T_affected}{improvement \; factor} + T_unaffected$ 성능을 개선하기 위해서는 많은 비율을 차지하는 것(common case)을 개선해야 한다. 점점 더 발전함에 따라 발전을 이루는 속도가 더뎌진다. 예시 100s의 전체 execution time 중 80s가 multiply, 20s가 다른 작업이라고 하자. Multiply 작업의 속도를 2배 빠르게 할 경우 $total exec time = .. 2021. 4. 10.