Binary System
Binary System
128 64 32 16 8 4 2 1
128 64 32 16 8 4 2 1
27 26 25 24 23 2² 21 20
1 0 0 0 1 1 0 1
For example:
Since 0 = OFF & 1 = On, we will calculate only the place value of ones
10001101 in binary system = 128+8+4+1 = 141
Learning Objective 1:
Convert from binary system to denary system
8 0 6 9 0 4 5 3
• The name "digit" comes from the fact that the ten digits (Latin digiti meaning
fingers) of the hands correspond to the ten symbols of
the common base 10 numeral system, i.e. the decimal (ancient Latin
adjective decem meaning ten) digits.
Digit
Decimal/Denary System:
8 0 6 9 0 4 5 3
Bit
Binary System:
1 0 0 0 1 1 0 1
Learning Objective 2:
What is a bit?
Learning Objective 3:
What is a byte?
A bit:
the smallest increment of data on a computer, can hold only one of two values: 0 or 1, corresponding to the electrical
values of off or on, respectively.
A byte:
8 bits assembled together. A byte contains enough information to store a single ASCII character, like "h".
Bit
Binary System:
1 0 0 0 1 1 0 1
Byte
Challenge yourself
• What is the smallest number in 8 digits in the denary system?
• What is the greatest number in 8 digits in the denary system?
• How many numbers can be put in an 8-digit number in the denary
system?
• What is the smallest number in 8 bits (a byte) in the binary system?
• What is the greatest number in 8 bits (a byte) in the binary system?
• How many numbers can be put in an 8-digit number (a byte) in the
binary system?
• Can you observe and conclude formulas generalized for any number
system (of any base)?
Learning Objectives
Convert from binary system to denary system
What is a bit?
What is a byte?
4- Convert from denary system to binary system
Learning Objective 4:
Convert from denary system to binary system
By subtracting method:
Example:
Convert 125 in decimal (denary) system to binary
Can we get 128 from 125? No. Then the place value of the bit whose place value 128 is 0.
125 – 128? No. ---> 0 , R = 125
125 – 64? Yes. ---> 1 , R = 61
61 - 32? Yes. ---> 1 , R = 29
29 - 16? Yes. ---> 1 , R = 13
13 - 8? Yes. ---> 1 , R = 5
5 - 4? Yes. ---> 1 , R = 1
1 - 2? No. ---> 0 , R = 1
1 - 1? Yes. ---> 1 , R = 0
128 64 32 16 8 4 2 1
0 1 1 1 1 1 0 1
Learning Objective 4:
Convert from denary system to binary system
By division method:
Example:
Convert 125 in decimal (denary) system to binary
Can we get 128 from 125? No. Then the place value of the bit whose place value 128 is 0.
125 / 2? 62. ---> R = 1
62 / 2? 31. ---> R = 0
31 / 2? 15. ---> R = 1
15 / 2? 7. ---> R = 1
7 / 2? 3. ---> R = 1
3 / 2? 1 ---> R = 1
1 / 2? 0 ---> R = 1
128 64 32 16 8 4 2 1
0 1 1 1 1 1 0 1
Which is greater? 256 in decimal or 11111111 in binary?
A) 256 is greater
B) 11111111 is greater
C) Both numbers are equal
Now go check your answer
• https://www.rapidtables.com/convert/number/binary-to-decimal.html
Think about it:
• https://www.mentalfloss.com/article/318
79/12-mind-blowing-number-systems-oth
er-languages
• https://www.frontiersin.org/articles/10.3389/
fpsyg.2013.00480/full
Uses of the hexadecimal system: (// separates alternative answers within a marking
point)
• colour codes // colour in HTML/CSS
• error messages
• locations in memory
• memory dump // debugging
• IP(v6) address
• ASCII // Unicode
• assembly language
• URL