덧셈
interger addition
- overflow
- result가 range를 벗어나는 경우
- carry하고는 개념이 다르다
- c언어에서는 overflow 무시
Saturating operations
- overflow발생하면 최대값 return
- video
- white+white⇒black return하는게 자연스러움
곱셈
Multiplcation
- multiplicant,multiplier,product으로 구성
- 32bit(multiplicand) * 32bit 계산(alu) ⇒ 64bit 결과
- 기존 하드웨어 : ALU 64bit,multiplicand: 64bit 필요
개선된 multiplication
- 32bit*32bit 계산 ⇒ 64bit 결과
- alu : 32bit, multiplicand : 32bit 로 개선
- multiplier를 product에 저장
- multiplicand를 shift하는게 아니라 product만 shift해줌
나눗셈
- dividend, divisor, quotient, remainder 로 구성!
- divisor 은 dividend와 비교하여 1bit씩 오른쪽으로shift
- quotient는 매번 왼쪽으로 1bit씩 shift
개선된 나눗셈
- multiplication과 유사
- dividend를 왼쪽으로 shift
- divisor는 가만히 있음
- quotient는 매번 왼쪽으로 shift
REF
13. Implementing Division