➖ 二进制减法计算器(带借位竖式)Subtract Binary Numbers
用第一个二进制数依次减去后面的数:每行一个,或用空格、逗号、加号或减号分隔,支持任意位数、负数和 0b 前缀。两个非负数相减时可显示带借位的竖式;结果为负数时默认用负号表示,也可以按指定位数显示成补码。同时给出十进制和十六进制结果,可设置最少位数补 0、每 4 位分组。适合学习二进制减法、补码和数字电路练习,数据在本地处理。Subtract binary numbers: the first value minus each of the others. Put one per line or separate them with spaces, commas, plus signs or minus signs. Any length, negative numbers and the 0b prefix work. For two non-negative values you can show the column subtraction with borrows. A negative result is written with a minus sign, or as two's complement in a width you choose. See the result in decimal and hex too, pad to a minimum width or group every 4 bits. Handy for learning binary subtraction, two's complement and digital-logic exercises. Processed locally.
使用说明与常见问题How-to & FAQ
「二进制减法计算器(带借位竖式)」是什么?What is the Subtract Binary Numbers tool?
用第一个二进制数依次减去后面的数:每行一个,或用空格、逗号、加号或减号分隔,支持任意位数、负数和 0b 前缀。两个非负数相减时可显示带借位的竖式;结果为负数时默认用负号表示,也可以按指定位数显示成补码。同时给出十进制和十六进制结果,可设置最少位数补 0、每 4 位分组。适合学习二进制减法、补码和数字电路练习,数据在本地处理。Subtract binary numbers: the first value minus each of the others. Put one per line or separate them with spaces, commas, plus signs or minus signs. Any length, negative numbers and the 0b prefix work. For two non-negative values you can show the column subtraction with borrows. A negative result is written with a minus sign, or as two's complement in a width you choose. See the result in decimal and hex too, pad to a minimum width or group every 4 bits. Handy for learning binary subtraction, two's complement and digital-logic exercises. Processed locally.
如何使用「二进制减法计算器(带借位竖式)」?How do I use the Subtract Binary Numbers tool?
在「二进制减法计算器(带借位竖式)」中,把内容粘贴或输入到上方输入框,按需设置「最少位数(可选)」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「1011 - 110」,得到「101」。In the Subtract Binary Numbers: Paste or type into the input box, adjust "Minimum width (optional)"; the result appears below instantly — click "Copy result" to copy it. Example: "1011 - 110" → "101".
怎样输入多个数?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.
二进制减法怎么借位?How does borrowing work in binary?
逐位相减:1−0=1,1−1=0,0−0=0;0−1 不够减,要向左边一位借 1,借来的 1 在这一位相当于 2,所以 0−1 = 10−1 = 1,左边一位再减去借出的 1。勾选“显示竖式”后,两个非负数相减会在被借位的那一位上方标出 1。Subtract column by column: 1−0=1, 1−1=0, 0−0=0. For 0−1 you borrow 1 from the next column to the left, which is worth 2 here, so 0−1 becomes 10−1 = 1 and the column on the left gives up 1. With Show the working ticked, subtracting two non-negative values marks a 1 above each column that lent a borrow.
结果为负数时怎么表示?How is a negative result shown?
默认用负号加二进制表示,例如 110 − 1011 = −101(6 − 11 = −5)。勾选“负数结果用补码表示”后,会按“最少位数”(没填时按输入的最大位数,至少能放下结果)显示成补码,例如 8 位时 −5 = 11111011;结果超出该位数的补码范围会提示错误。By default it uses a minus sign and the binary digits, e.g. 110 − 1011 = −101 (6 − 11 = −5). With Show a negative result as two's complement ticked, it is written in two's complement using the Minimum width (or, if blank, the longest input, large enough for the result) — in 8 bits −5 is 11111011; a result outside that range gives an error.
可以连续减多个数吗?Can I subtract several values in a row?
可以。第一个数依次减去后面所有的数,例如 10000、1、1 得到 1110(16 − 1 − 1 = 14)。勾选“显示竖式”时会逐步列出每一步的结果。Yes. The first value has every following value subtracted in turn — 10000, 1, 1 gives 1110 (16 − 1 − 1 = 14). With Show the working ticked each intermediate result is listed.
加号 + 可以当分隔符吗?Can I use + as a separator?
可以。默认模式下 + 和空格、逗号一样只是把两个数分开,例如 1011+110 表示 1011 − 110(11 − 6 = 5),不会做加法。若要写带正负号的数,请每行一个或用空格/逗号分隔。Yes. In the default mode + is only a separator like a space or comma, so 1011+110 means 1011 − 110 (11 − 6 = 5), not addition. To enter signed values, put one per line or separate them with spaces or commas.
输入和输出是什么样的?What does the input and output look like?
例如在「二进制减法计算器(带借位竖式)」中输入 1011 ⏎ 110,输出为:101(⏎ 表示换行)。For example, the Subtract Binary Numbers turns the input 1011 ⏎ 110 into: 101 (⏎ marks a line break).
有哪些选项可以调整?What options can I adjust?
「二进制减法计算器(带借位竖式)」的设置:「最少位数(可选)」可留空;可勾选:「显示竖式(含借位)」、「负数结果用补码表示」、「数中间允许空格(如 1010 1100)」、「同时显示十进制」、「同时显示十六进制」、「加 0b 前缀」。改动任一选项后结果会按新设置重新生成。Settings in the Subtract Binary Numbers — "Minimum width (optional)" optional; tick boxes: "Show the working (with borrows)", "Show a negative result as two's complement", "Allow spaces inside a number (e.g. 1010 1100)", "Also show decimal", "Also show hex", "Add 0b prefix". Changing any option regenerates the result with the new setting.
计算精度如何?How precise are the results?
「二进制减法计算器(带借位竖式)」使用 JavaScript 双精度浮点数(约 15–16 位有效数字),部分功能使用 BigInt 处理大整数。The Subtract Binary Numbers uses double-precision floating point (about 15–16 significant digits); some features use BigInt for large integers.
「二进制减法计算器(带借位竖式)」免费吗?需要注册吗?Is the Subtract Binary Numbers free? Do I need an account?
「二进制减法计算器(带借位竖式)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Subtract Binary Numbers is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.