Number System Operations
Add, subtract and multiply two or more numbers in binary, octal, denary or hexadecimal, with carries, borrows, overflow and underflow shown.
Numbers & operation
Working
Line the numbers up by place value and start at the rightmost column. In base 2 a column carries 2.
About This Simulation
This number system operations simulator does arithmetic directly in binary, octal, denary or hexadecimal. Addition and subtraction run one column at a time with carries and borrows explained, binary subtraction can also be done with two's complement, and multiplication is shown as partial products.
Features
- Add or subtract up to six numbers in base 2, 8, 10 or 16
- Carry and borrow row above the columns, with the final carry shown in the result
- Binary subtraction using two's complement (A + (−B))
- Long multiplication with partial products
- Register size option with overflow and underflow warnings
Topics covered
- Binary Arithmetic
- Hexadecimal and Octal Arithmetic
- Carry and Borrow
- Two's Complement Subtraction
- Binary Multiplication
Explanation
Arithmetic works the same way in any base: you work from the rightmost column, and a column carries when its total reaches the base. In binary a column carries at 2, in octal at 8 and in hexadecimal at 16. Subtraction borrows one of the base from the next column when the top digit is too small.
How it works
- Addition: add the digits in a column plus any carry. If the total is at least the base, write total − base and carry 1.
- Subtraction: if the top digit (minus any borrow) is smaller than the bottom digit, borrow the base from the next column.
- Two's complement subtraction: find −B by inverting B and adding 1, then add it to A. A carry out of the leftmost bit is ignored.
- Multiplication: multiply A by each digit of B, shift each partial product one place left per position, then add them. In binary each partial product is 0 or A shifted.
- Check any answer by converting to denary, calculating there and converting back.
Why it matters
Binary addition and subtraction are on the IGCSE syllabus, and hexadecimal arithmetic is useful for memory addresses and colour codes. In digital logic courses (CSE230, CSE260) the same ideas lead to adder and subtractor circuits.
Frequently Asked Questions
How do you add in hexadecimal?
Add each column in denary. If the total is 16 or more, subtract 16, write that digit (using A–F for 10–15) and carry 1. For example 9 + 8 = 17 → write 1, carry 1.
How does a computer subtract binary numbers?
It adds the two's complement of the second number: A − B = A + (NOT B + 1). This means the same adder circuit performs subtraction.
What does borrowing mean in binary subtraction?
When subtracting 1 from 0, take 1 from the next column, which is worth 2 in the current column, so 10₂ − 1 = 1.
Related Simulations
Number Systems
Two's Complement Simulator
Convert between denary and two's complement binary, with the invert-and-add-one steps and the negative place value shown.
Number Systems
Number System Converter
Convert between binary, decimal, hex, octal
Number Systems
Bitwise Operations Simulator
Apply AND, OR, XOR, NOT, logical and arithmetic shifts and rotations to 8-bit values, and use masks to set, clear and test bits.
Number Systems
Floating Point Representation Simulator
Store numbers as a two's complement mantissa and exponent, normalise them and see rounding errors, plus IEEE 754 32-bit and 64-bit.

