Binary Calculator with Steps

Type two binary numbers and pick an operation to see the column working with carries or borrows, the decimal check, and two's complement signed sums.

Działa w Twojej przeglądarce. Twoje pliki nigdy nie opuszczają urządzenia. Zobacz, jak to sprawdzić

…

Jak to zrobić

  1. 1
    Enter two binary numbers

    Type numbers using only 0 and 1.

  2. 2
    Pick an operation

    Choose add, subtract, multiply or divide.

  3. 3
    Read the working

    Follow the carries, borrows or rows in the layout.

  4. 4
    Check in decimal

    Compare with the decimal and hex results.

  5. 5
    Try two's complement

    Convert signed numbers and add them with overflow checks.

  6. 6
    Practise

    Solve generated questions with worked answers.

O tym narzędziu

Binary arithmetic is the first real hurdle in computer science and digital electronics courses. The rules are tiny, 1 + 1 = 10 and 10 − 1 = 1, but carries ripple and borrows chain across several columns, and two's complement adds a layer that confuses many students. This calculator shows the working the way it is written on paper. For addition you see the carry row above the numbers and an explanation of every column. For subtraction you see where each borrow was taken. Multiplication uses the shift-and-add method, with one row for each 1 bit, and division is binary long division with each compare-and-subtract step. Every result is checked in decimal and hexadecimal. A separate tab handles signed numbers in two's complement for 4, 8, 16 or 32 bits: it converts decimal values, shows the invert-and-add-one method, adds two signed values the way a processor does by discarding the carry out, reads the result back and flags overflow when the true answer does not fit. Practice questions cover each operation with full working.

Addition and subtraction

Binary addition follows four facts: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0 carry 1, and 1 + 1 + 1 = 1 carry 1. Work from the right and carry into the next column. Subtraction uses 0 − 0 = 0, 1 − 0 = 1, 1 − 1 = 0, and 0 − 1 needs a borrow: take 1 from the next column to the left, which is worth 2 in this column, so 10₂ − 1 = 1. When several zeros sit to the left, the borrow passes through them, turning each into 1.

Multiplication and division

Multiplying by a binary digit is either copying the number (for 1) or writing zeros (for 0), so multiplication becomes shifting and adding rows. Division compares the divisor with the bits brought down from the left: if it fits, write 1 and subtract; if not, write 0. The result is a quotient and a remainder.

Two's complement

In n-bit two's complement the leftmost bit has the value −2^(n−1), so 8 bits hold −128 to 127. To write a negative number, write its size in binary, invert every bit and add 1. Adding two values works like unsigned addition, ignoring any carry out of the leftmost bit. Overflow happens when two numbers with the same sign give a result with the other sign, which means the true sum is out of range.

Worked example

1011 + 110 (11 + 6). Column 1: 1 + 0 = 1. Column 2: 1 + 1 = 10, write 0 carry 1. Column 3: 0 + 1 + 1 = 10, write 0 carry 1. Column 4: 1 + 0 + 1 = 10, write 0 carry 1. The final carry gives 10001, which is 17. In 8-bit two's complement, −5 is 00000101 inverted (11111010) plus 1 = 11111011, and −5 + 3 = 11111011 + 00000011 = 11111110, which reads back as −2.

Limits

Inputs are limited to 64 bits for unsigned arithmetic and 4 to 32 bits for two's complement. Fractions, floating-point formats (IEEE 754) and bitwise logic operations are not covered here. Subtraction in the calculator tab needs the first number to be the larger; use the two's complement tab for negative results.

Przykład z rozwiązaniem

1011 + 110 = 10001 (11 + 6 = 17); −5 in 8 bits = 11111011; −5 + 3 = 11111110 = −2.

W skrócie

Najczęstsze pytania

How do you add binary numbers?

Add column by column from the right: 1 + 1 = 10, so write 0 and carry 1. The calculator shows every carry above the numbers.

How does borrowing work in binary subtraction?

When you subtract 1 from 0, borrow 1 from the next column to the left. It is worth 2 in the current column, so 10₂ − 1 = 1.

How do I find the two's complement of a number?

Write the positive value in binary with the chosen number of bits, invert every bit, then add 1.

What is overflow?

A result that does not fit in the number of bits. In two's complement it shows up when adding two positives gives a negative, or two negatives a positive.

Can I multiply and divide in binary?

Yes. Multiplication uses shift-and-add rows and division uses binary long division, both with steps.

Does the tool show decimal and hex?

Yes. Each result is checked in decimal, and the hexadecimal value is shown too.

Całkowicie za darmoBez opłat i rejestracji
Pliki zostają prywatneWszystko działa w Twojej przeglądarce
Łatwo w Twoim językuDostępne w wielu językach