Number Systems
In human system, to express a count ‘ten’, we use two digits. Do you know why and the logic behind all number systems. It’s simple.
-->0,1,2,3,4,5,6,7,8,9
From 0 to 9, we use single digits. After that there is no number or characters to express the count so we increase the no of digits --> 1_
After that we start counting from 0 to 9, --> 10,11,12,13,14,15,16,17,18,19
Again we increase the second digit by one and start counting from 0 to 9,
-->20,21,22,23,24,25,26,27,28,29……………..98,99
After you reach 99, you again increase one digit and start counting from 0-9,
-->100,101,102,…109,
-->110,111,112………..
This is how the number system works.
Let’s try with octal number system
-->0,1,2,3,4,5,6,7
After 7 there is no number exist in octal system. So increase the no of digits and start counting-->1_
-->10,11,12,13,14,15,16,17
Again increase the second digit and count
-->20,21,22,23,24,25,26,27…….
Here the number 10 expresses the count ‘eight’
11 expresses the count ‘nine’
12 expresses the count ‘ten’
13 expresses the count ‘eleven’ and so on.
Similarly we try for hexadecimal system,
-->0,1,2,3,4,5,6,7,8,9
After 9 still we have numbers or characters to express the count ‘ten’
-->0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
After ‘F’ (expresses the count 15), we increase the no of digits and start counting from 0 to ‘F’
-->10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F
-->20,21,22,23,24,25,26,27,28,29,2A,2B,2C,2D,2E,2F….
‘A’ represents the count ‘10’
‘B’ represents the count ‘11’
‘C’ represents the count ‘12’
‘D’ represents the count ‘13’
‘E’ represents the count ‘14’
‘F’ represents the count ‘15’
Totally from zero to 15, we express 16 numbers. That’s why it is called as ‘Hexadecimal System’
Binary System0 -->0
1-->1
2-->10
3-->11
4-->100
5-->101
6-->110
7-->111
8-->1000
9-->1001
10-->1010
11-->1011
12-->1100
13-->1101
14-->1110
15-->1111
In the memory of the computer, all these numbers are stored in Binary Format.
You can also express the Binary format in other number systems. But expressing in Binary and Hexadecimal system will be easy to work.
Four Digits in Binary is Equivalent to one digit in Hexadecimal system.
Binary Operations
More over there are many binary operations you have to learn
AND, OR, NOT, EX-OR
AND- this is just multiplying the corresponding digits of two binary numbers.
Example:
1100 0111
1001 1111
Ans: 1000 0111
OR – this is logical addition of corresponding digits of two binary numbers.
Logical addition means 1+1=1, 1+0=1, 0+0=0
Example:
1000 0111
1001 0110
Ans: 1001 0111
NOT – this is interchanging one’s with zero and zero’s with ones.
1100 1010
Ans: 0011 0101
EX-OR –Compare corresponding digits and
put one if both digits are different
put zero if both digits are same.
Example:
1100 1010
1001 0110
Ans: 0101 1100
ADD –this is ordinary addition of binary numbers.
Here 1 + 1 = 10, 1+1+1=11
Example:
1100 1010
1000 1001
Ans: 10101 1011