728x90
반응형
경희대학교 김정욱 교수님의 컴퓨터구조 강의를 기반으로 정리한 글입니다.
Arithmetic Operation

- Status: Overflow가 일어났는지 아닌지 체크
- Integer Result: value ($t0 에 저장될 값)
Overflow
Addition
- 두 부호가 같으면 overflow가 일어날 수 있음
- 두 부호가 다르면 overflow가 일어날 수 없음
Subtraction
- 두 부호가 같으면 overflow가 일어날 수 없음
- 두 부호가 다르면 overflow가 일어날 수 있음
Overflow Detection
- MIPS C compiler는 overflow exceptions 제공
- Signed instructions: add, addi, subtract는 overflow exception을 발생시킬 수 있음
- Unsigned instructions: addu, addiu, subu는 발생 x

Multiplication


- Product를 0으로 초기화
- Multiplier LSB가 1이면 Multiplicand를 Product에 추가
- Multiplier LSB가 0이면 아무 일 X
- Multiplicand Shift left
- Multiplier Shift right

bit 수만큼 연산
Division



- Remainder를 Dividend로 초기화
- Divisor에 앞에부터 채워서 초기화
- Remainder에서 Divisor를 한 번 빼봄 → 음수면 되돌림, Quotient Shift left 후 LSB에 0 추가 → 양수면 Quotient Shift left 후 LSB에 1 추가
- Divisor Shift right

bit 수 + 1만큼 연산
728x90
반응형
'Computer Science > Computer Architecture' 카테고리의 다른 글
| [컴퓨터구조] Lecture 12: The Processor - Part1 (0) | 2026.02.12 |
|---|---|
| [컴퓨터구조] Lecture 10: Arithmetic for Computers - Part2 (0) | 2026.02.08 |
| [컴퓨터구조] Lecture 08: Instructions - Language of the Computer - Part5 (0) | 2026.02.08 |
| [컴퓨터구조] Lecture 07: Instructions - Language of the Computer - Part4 (0) | 2026.02.08 |
| [컴퓨터구조] Lecture 06: Instructions - Language of the Computer - Part3 (0) | 2026.02.08 |