01000100
10111100 // copy bits until a 1 is reached, then flip the rest
vs
01000100
10111011 // invert all bits:
+ 1 // add one
10111100
将数字写成x10k(一些位后跟着1,然后是k个零)。
假设你对它进行补码,然后加上1,你会得到y01k(其中y是x的补码),然后增量通过尾随的1传递并翻转0回来,变成y10k。
这与仅对x进行补码并保留尾部相同。