🔃 二进制 NOT 运算(按位取反)NOT Binary Values
把每个二进制数按位取反(NOT,反码):0 变 1,1 变 0。每行可以有多个数,结果保持原来的排列;可设置最少位数(例如按 8 位取反),保留或去掉前导 0,并同时显示十进制结果。适合学习位运算、计算反码和补码、做数字电路练习,数据在本地处理。Invert every bit of each binary value (bitwise NOT, ones' complement): 0 becomes 1 and 1 becomes 0. A line can hold several values and the layout is kept. Set a minimum width (e.g. invert as 8 bits), keep or drop leading zeros, and see the decimal value too. Handy for learning bitwise logic, working out ones' and two's complement and digital-logic exercises. Processed locally.
使用说明与常见问题How-to & FAQ
「二进制 NOT 运算(按位取反)」是什么?What is the NOT Binary Values tool?
把每个二进制数按位取反(NOT,反码):0 变 1,1 变 0。每行可以有多个数,结果保持原来的排列;可设置最少位数(例如按 8 位取反),保留或去掉前导 0,并同时显示十进制结果。适合学习位运算、计算反码和补码、做数字电路练习,数据在本地处理。Invert every bit of each binary value (bitwise NOT, ones' complement): 0 becomes 1 and 1 becomes 0. A line can hold several values and the layout is kept. Set a minimum width (e.g. invert as 8 bits), keep or drop leading zeros, and see the decimal value too. Handy for learning bitwise logic, working out ones' and two's complement and digital-logic exercises. Processed locally.
如何使用「二进制 NOT 运算(按位取反)」?How do I use the NOT Binary Values tool?
在「二进制 NOT 运算(按位取反)」中,把内容粘贴或输入到上方输入框,按需设置「最少位数(可选)」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「1010 0011」,得到「0101 1100」。In the NOT Binary Values: Paste or type into the input box, adjust "Minimum width (optional)"; the result appears below instantly — click "Copy result" to copy it. Example: "1010 0011" → "0101 1100".
怎样输入多个数?How do I enter several values?
每行一个数,或在同一行里用空格、逗号、分号或加号(+)分隔;可以带 0b 前缀,数中间的下划线会被忽略(如 1010_1100)。“自动”方式下:如果有一行包含两个以上的数,就每行单独计算;否则所有数一起计算。Put one value per line, or separate them with spaces, commas, semicolons or plus signs (+) on a line. A 0b prefix is fine and underscores inside a value are ignored (1010_1100). In Auto mode, if any line holds two or more values each line is worked out on its own; otherwise all values are combined.
NOT 和补码有什么关系?How does NOT relate to two's complement?
按位取反得到的是反码(ones' complement);反码再加 1 就是补码(two's complement),也就是计算机里表示负数的方法。例如 8 位的 00000101(5)取反是 11111010,加 1 得 11111011,即 −5 的补码。Inverting the bits gives the ones' complement; adding 1 gives the two's complement, which is how computers store negative numbers. For example the 8-bit 00000101 (5) inverts to 11111010, and adding 1 gives 11111011, the two's complement of −5.
为什么要设“最少位数”?Why set a minimum width?
取反的结果取决于位数:101 按 3 位取反是 010,按 8 位取反是 11111010。处理字节、寄存器或掩码时,请把最少位数设为 8、16 或 32,短的数会先在左边补 0 再取反。The result depends on the width: 101 inverted as 3 bits is 010, but as 8 bits it is 11111010. For bytes, registers or masks set the minimum width to 8, 16 or 32 so shorter values get leading zeros before they are inverted.
输入和输出是什么样的?What does the input and output look like?
例如在「二进制 NOT 运算(按位取反)」中输入 1010 ⏎ 0011,输出为:0101 ⏎ 1100(⏎ 表示换行)。For example, the NOT Binary Values turns the input 1010 ⏎ 0011 into: 0101 ⏎ 1100 (⏎ marks a line break).
有哪些选项可以调整?What options can I adjust?
「二进制 NOT 运算(按位取反)」的设置:「最少位数(可选)」可留空;可勾选:「去掉结果的前导 0」、「显示十进制」、「加 0b 前缀」。改动任一选项后结果会按新设置重新生成。Settings in the NOT Binary Values — "Minimum width (optional)" optional; tick boxes: "Drop leading zeros from the result", "Show decimal", "Add 0b prefix". Changing any option regenerates the result with the new setting.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「二进制 NOT 运算(按位取反)」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The NOT Binary Values runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「二进制 NOT 运算(按位取反)」免费吗?需要注册吗?Is the NOT Binary Values free? Do I need an account?
「二进制 NOT 运算(按位取反)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The NOT Binary Values is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.