Binary numbers
How a computer counts with only 0 and 1

Key ideas
- Decimal = base 10
- Digits 0 to 9
- Each place is worth ×10
- Binary = base 2
- Only two digits: 0 and 1
- Each place is worth ×2: 1, 2, 4, 8, 16
- n bits → 2ⁿ values
- 3 bits → 8 values
- 8 bits = 1 byte → 256 values (0 to 255)
Worked example
- Multiply each bit by its place value
- Add them up
- 10110₂ = 22
- Or picture light bulbs. Lit bulbs count, and dark bulbs don't. Sixteen, plus four, plus two. Twenty two.
- Now the other way. Let's convert thirteen to binary. Keep dividing by two, and write down each remainder. Thirteen divided by two is six, remainder one. Six gives three, remainder zero. Three gives one, remainder one. One gives zero, remainder one. Now read the remainders from bottom to top. One one zero one.
- Let's check it. Eight, plus four, plus one, is thirteen. Correct.
See the answer in Lesson 3 →
Full lesson text
Read everything said in the video
Where you have seen itFirst, last lesson's question. Three binary digits can make eight different patterns, from zero zero zero, all the way to one one one.
Where you have seen itHere's a fun fact. On your fingers, you count to ten. But if each finger is just up or down, a one or a zero, ten fingers can count all the way to one thousand twenty three.
The ideaTo understand binary, look at normal numbers first. In three hundred five, each place is worth ten times the one on its right. Ones, tens, hundreds. Three hundreds, zero tens, and five ones make three hundred five.
The ideaBinary works the same way, but in base two. There are only two digits, zero and one. And each place is worth double the one on its right. One, two, four, eight, sixteen.
Worked exampleLet's convert one zero one one zero to decimal. Multiply each bit by its place value. Then add them up. Sixteen plus four plus two, is twenty two. The same number our wire sent in lesson one.
Worked exampleOr picture light bulbs. Lit bulbs count, and dark bulbs don't. Sixteen, plus four, plus two. Twenty two.
Worked exampleNow the other way. Let's convert thirteen to binary. Keep dividing by two, and write down each remainder. Thirteen divided by two is six, remainder one. Six gives three, remainder zero. Three gives one, remainder one. One gives zero, remainder one. Now read the remainders from bottom to top. One one zero one.
Worked exampleLet's check it. Eight, plus four, plus one, is thirteen. Correct.
The ideaIn general, n bits give two to the power n values. Eight bits, called a byte, give two hundred fifty six values, from zero to two hundred fifty five.
Common mistakeThe most common exam mistake is reading the remainders from top to bottom. That gives one zero one one, which is eleven, not thirteen. Always read from the bottom up.
Memory trickHere's a memory trick. Place values just keep doubling. One, two, four, eight, sixteen. And for remainders, think of climbing a ladder. You always read them going up.
RecapLet's recap. Binary is base two, with only zero and one. Place values double at each step. To go from binary to decimal, add the place values of the ones. To go from decimal to binary, divide by two, and read the remainders upward.
RecapQuick question. What is one one one one one in decimal? The answer is in the next lesson.
Ready to test yourself? Practise real digital electronics interview questions, with model answers.
Practice questions →← All 33 lessons of the Digital Electronics course
Last updated