Denary to Binary Taking numbers to bits What
Denary to Binary Taking numbers to bits …
What are denary and binary? Denary Binary • “base ten” • Ten digits or symbols of the system • “base two” • Two digits or symbols of the system • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 • 0, 1
Why denary, why binary? Why Denary? Why Binary • Humans have 10 fingers • Logic circuits have two states • TRUE (on, “yes”, 1) • FALSE (off, “no”, 0)
Two-state systems A light switch can be “on” or “off” – there are just two potential states for it to be in.
Taking the first byte Denary (Decimal) 103 102 104 Tens of thousands 27 26 25 Hundre d-andtwentyeights Sixtyfours Thirtytwos hundreds Binary 24 23 sixteens eights 101 100 tens units 22 21 20 fours twos units
Counting on two fingers Denary Binary 0 0000 9 0000 1001 1 0000 0001 10 0000 1010 2 0000 0010 11 0000 1011 3 0000 0011 12 0000 1100 4 0000 0100 13 0000 1101 5 0000 0101 14 0000 1110 6 0000 0110 15 0000 1111 7 0000 0111 16 0001 0000 8 0000 17 0001
Converting 139 – Division method 2 )139 69 2 )69 34 2 )34 17 2 )17 8 2 )8 4 2 )4 2 2 )2 1 Remainder 0 Remainder 0 Using the “Remainder” method Starting from the bottom, our Denary 139 becomes: 1000 1011 in binary
Converting 139 – Subtraction method We have a 128, and a decimal value of 11 left to place 139 – 128 = 11 We also have an 8, and 3 left to place 11 – 8 = 3 now we now have a 2, 3– 2=1 and the remaining 1 is a single unit. 1 0 0 0 1 1 128 64 32 16 8 4 2 1
Binary to Denary … bit by bit
Binary to Denary – From the table: 128 64 32 16 8 4 2 1 1 1 0 1 0 Simply place the binary number in the cells, and add the corresponding decimal values; in this case: 128 + 64 + 16 + 8 + 2 = 218
Binary to Denary – from the right No “ones” Add 2 (we have a “two”) No “fours” Add 16 and 8 (we have a “sixteen” and an “eight”) No “Thirty-twos” Add 128 and 64 (we have one of each) 1 1 0 128 + 64 + 16 + 8 + 2 = 218 1 0
- Slides: 11