Computer Science
Grade 7
20 min
9. Binary Operations: Addition and Subtraction
Learn the basics of binary addition and subtraction.
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Recall the four fundamental rules of binary addition.
Add two 8-bit binary numbers, correctly managing 'carry' bits.
Recall the four fundamental rules of binary subtraction.
Subtract a smaller 8-bit binary number from a larger one, correctly managing 'borrow' operations.
Define the concept of an 'overflow' error in binary addition.
Verify the results of binary arithmetic by converting the numbers and the answer to the decimal system.
How can a computer do millions of calculations per second using only two numbers, 0 and 1? 🤖 Let's learn its secret language for math!
In this lesson, you will learn how to perform the most basic math operations, addition and subtraction, using the binary number system. This is the foundat...
2
Key Concepts & Vocabulary
TermDefinitionExample
Binary Digit (Bit)The smallest unit of data in a computer, represented as either a 0 or a 1.In the binary number 1011, each digit (1, 0, 1, 1) is a bit.
Base-2 SystemThe number system used by computers that has only two digits: 0 and 1. Each place value is a power of 2.The binary number 101 is equal to (1 * 2²) + (0 * 2¹) + (1 * 2⁰), which is 4 + 0 + 1 = 5 in decimal.
CarryIn addition, a carry is a digit that is transferred from one column of digits to the next column on the left when the sum of the first column is 2 or more.In binary, 1 + 1 = 10. The '0' is written in the current column, and the '1' is the carry to the next column.
BorrowIn subtraction, a borrow is when you take value from a higher place value column to the right to make a subtra...
3
Core Syntax & Patterns
Binary Addition Rules
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0, carry 1
Use these rules for adding each column of binary numbers, starting from the right (LSB). If you have a carry from the previous column, add that in as well (e.g., 1 + 1 + 1 = 1, carry 1).
Binary Subtraction Rules
0 - 0 = 0
1 - 0 = 1
1 - 1 = 0
0 - 1 = 1, with a borrow
Use these rules for subtracting each column, starting from the right. When you need to subtract 1 from 0, you must 'borrow' from the next column to the left, which gives you a value of 2 in your current column.
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
If you are using an 8-bit system and you add 11111111 and 00000001, what happens?
A.The result is 00000000, and the system reports success.
B.The result is 100000000, which fits perfectly.
C.An overflow error occurs because the result requires 9 bits.
D.borrow error occurs because the numbers are incompatible.
Challenging
Which of the following binary subtraction problems correctly results in the decimal number 5?
A.1100 - 0110
B.1001 - 0100
C.1010 - 0100
D.1111 - 1011
Challenging
A student is subtracting 00110101 from 01001000. They make a mistake during the chain borrow. The correct process is that the '1' at the 2^5 position becomes '0', the 2^4 position becomes '1', the 2^3 position becomes '1', and the 2^2 position becomes '2'. What is the most likely error the student made?
A.They forgot to change the initial '1' at the 2^5 position to a '0'.
B.They incorrectly turned all the intermediate '0's into '2's instead of '1's.
C.They borrowed from the '1' at the 2^3 position instead of the 2^5 position.
D.They correctly borrowed but then subtracted 1-1 instead of 2-1 in the 2^2 column.
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free