位元本身沒有值,有值的是讀法。同一排 1111 1111,用無號讀法讀是 255;用二補數(有號)讀法讀是 −1。位元一個都沒動,換的是怎麼讀它。這個工具讓位元列成為唯一的真相來源:點下去就翻,底下所有讀法同時跟著更新。Bits have no intrinsic value — the interpretation does. The same pattern 1111 1111 reads as 255 in unsigned and −1 in two's complement (signed). Not a single bit changed; only the reading rule did. This tool makes the bit row the single source of truth: click a bit to flip it, and all four readouts update in the same visual beat.
「取負」操作演示二補數的 −x = ~x + 1 定義:先全部位元取反(~x),再從最低位加一,進位從右向左漣波直到遇見第一個 0 位元停下。工具把這兩拍分開演出:第一拍整排瞬間取反,第二拍一顆冷青火花沿位元列橫向推進。當操作使符號位元(最高位)意外翻轉,有號讀數突變正負,那一格會被框住指認出來。The "Negate" operation demonstrates the two's complement rule −x = ~x + 1: first invert all bits, then add 1 from the LSB, rippling carry leftward until it hits a 0. The tool plays this in two distinct beats: all bits invert at once, then a cyan carry spark travels the row bit by bit. If the carry flips the sign bit (MSB) unexpectedly — causing signed overflow — that cell is framed and highlighted.
32 位元模式的所有讀法一律以 BigInt 計算,完全繞開 JavaScript 位元運算子 32 位有號的限制(例如 1 << 31 在 JS 會是負數)。邏輯右移(>>>)在 8/16 位元模式下以無號遮罩手算,保持語意正確。術語對照:二補數、符號位元、最高位元(MSB)、算術右移(>>)、邏輯右移(>>>)、符號延伸、溢位、進位漣波。All 32-bit readouts use BigInt, bypassing JavaScript's 32-bit signed-integer trap (e.g. 1 << 31 becoming negative). Logical right shift (>>>) in 8/16-bit modes is computed via an unsigned mask. Glossary: two's complement, sign bit, MSB, arithmetic right shift (>>), logical right shift (>>>), sign extension, overflow, carry ripple.