Watch this video for an explanation of binary
Computers are basically a collection of billions of switches. The switches can be on or off represented in binary. Binary is a number system represented by two numerical values:
All data and program instructions are stored as binary strings in a computer.
Place Value
In number systems, a digit’s place value determines how much it contributes to the final total
With decimal numbers (denary), we use base 10, with 10 values (0-9) for each digit
(2x100)+(3x10)+ 5x1) = 200 + 30 + 5 = 235
With binary,
we use base 2, with 2
values (0 and 1) for each digit
(1x4) + (0x2) + (1x1) = 4 + 0 +1 = 5
Typically, binary numbers are represented as bytes
- A bit is a single 0 or 1 digit
- A byte is 8 bits
- A nibble is 4 bits (half a byte)
Example
Calculate the Denary (Base 10) value of 10101101
(1x128)+(1x32)+(1x8)+(1x4)+(1x1) =128+32+8+4+1 = 173
Calculate the Binary equivalent of 43
Is 43> 128? - No so 0 goes under 128
Is 43 >64? - No so 0 goes under 64
Is 43>32? - Yes so 1 goes under 32. 43-32 = 11
Is 11>16? - No so 0 goes under 16
Is 11>8? - Yes so 1 goes under 8. 11-8 = 3
Is 3>4? No so 0 goes under 4
Is 3>2? - Yes so 1 goes under 2. 3-2 =1
1 left over so 1 goes under 1
So 43 converts to 00101011 in binary
Here are some workbooks for you to try out
Download this Spreadsheet for some further revision exercises.