The Binary Number System
We study the binary number system used by computers and learn to convert numbers from decimal to binary and back.
All topics (11 of 11)
Chapter 1. Spreadsheets
Chapter 2. Databases
Chapter 3. Computer Networks and the Web
Chapter 4. Number Systems
A number system is a way of writing numbers. In everyday life we use the decimal system: it has ten digits (0–9), and each next place is ten times larger. The binary system has only two digits, 0 and 1, because the electronic circuits of a computer have two states: there is a signal or there is not.
To convert a binary number to decimal, multiply each digit by the matching power of two and add. From right to left the powers are 1, 2, 4, 8, 16, … For example, 1101₂ = 1·8 + 1·4 + 0·2 + 1·1 = 13. To convert a decimal number to binary, divide it by 2 repeatedly, writing down the remainders, and then read the remainders in reverse order.
Example: let us convert 13 to binary. 13 : 2 = 6 (remainder 1), 6 : 2 = 3 (remainder 0), 3 : 2 = 1 (remainder 1), 1 : 2 = 0 (remainder 1). Reading the remainders from bottom to top gives 1101. Check: 8 + 4 + 1 = 13, correct. This is how a computer stores text, images and sound as sequences of zeros and ones.
Key takeaways
- The binary system uses only the digits 0 and 1.
- Binary to decimal: multiply the digits by powers of two and add.
- Decimal to binary: divide by 2 and read the remainders in reverse.
- A computer stores all information in binary code.
Practice tasks
- Convert these binary numbers to decimal:
101,1010,11111. - Convert these decimal numbers to binary: 9, 20, 37. Check the result by converting back.
- Make a table of the binary notation of numbers from 0 to 15 and find the pattern.
Review questions
Test yourself: think first, then reveal the answer.
1Why does a computer use the binary system?Show answerHide answer
Because electronic elements with two states (signal or no signal) are easy and reliable to build.2What is the binary number `1010` in decimal?Show answerHide answer
8 + 2 = 10.
0 of 11 topics completed
Sign in to mark