contributed by < ShinWeiPeng >
開發環境
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ lscpu
HugoPeng changed a year agoView mode Like Bookmark
https://hackmd.io/@sysprog/binary-representation#%E8%A7%A3%E8%AE%80%E8%A8%88%E7%AE%97%E6%A9%9F%E7%B7%A8%E7%A2%BC
NOT operator
x = ~x
一補數、二補數
單位元為0,對應到10進制正負換算
x = ~x + 1 // x = -x
一補數(無號數/有號數)
二補數(無號數/有號數)
HugoPeng changed 2 years agoView mode Like Bookmark