-
2의 보수를 이용한 음의정수 표현아무거나적어~ 2022. 1. 24. 18:33
2진법에서 -N(2)는 다음과 같이 구한다
$$
\begin{align*}
-N(2) &= \text{(two's complement of N(2) on the base 2)}(\because \text{definition}) \\
&= \text{(one's complement of N(2) on the base 2)} + 1 \\
&= \sim N(2)+1
\end{align*}
$$참고
r's complement number & (r-1)'s complement
요약 radix가 r인(r based) number system에서 N(r)의 자릿수를 d 라고 하자. 그러면 $$ \begin{align*} \text{(r-1)'s complement number of N(r)} &= r^{d}-N(r)-1 \\ ..
tinycaterpillar.tistory.com
출처
'아무거나적어~' 카테고리의 다른 글
상수 최적화, (0) 2022.01.24 If vs Switch (0) 2022.01.24 r's complement number & (r-1)'s complement (0) 2022.01.23 크롬 다크모드 (0) 2021.11.21 같이하는 버추얼 만드는법 (0) 2021.11.02