Showing posts with label binary representation of numbers. Show all posts
Showing posts with label binary representation of numbers. Show all posts

Thursday, October 25

Binary Numbers


Binary Numbers Tutorial – Binary numbers are used in computer programming and are used in all modern computer based devices. In Binary numeral system, there are two numeric values which are used to represent the numbers and those two values are 0 and 1. The numerical value represented in every case depends upon the value assigned to each symbol. For example: - 0 is denoted as 0, 1 is denoted as 1 and 2 is denoted as 10. Binary numeral system is also termed as base – 2 system because in this the base 2 is used to give a numeric value to a number.

Binary Representation of Numbers – Binary numbers are represented using two numerical values only that are 0 and 1. We know that in decimal system we use base 10 to represent numbers, the binary works on the same principle but the only difference is that it uses base as 2. For Understanding Binary Numbers, let me show you an example.
For example: - if we have a three digit number 432 then we know that number 4 holds the ones place which means 4 multiplied by 10^0, 3 holds the tens place which means 3 multiplied by 10^1 and 4 holds the hundreds place which means 4 multiplied by 10^2. In Binary system, we apply the same method but the only difference is we use base 2 instead of base 10. For this number we use 2^0, 2^1, 2^2 and so on.

To convert a Binary number to a decimal number, we follow the same pattern. For example: - if we have 100111 then it can be expanded as 1 X 2^5 + 0 X 2^4 + 0 X 2^3 + 1 X 2^2 + 1 X 2^1 + 1 X 2^0 which can be simplified as 32 + 0 + 0 + 4 + 2 + 1 = 39. Hence 39 can be written as 100111.

Multiplying Binary Numbers – Binary numbers are multiplied the same way as we multiply numbers in the decimal system. For example: - 1 X 1 = 1, 1 X 0 = 0 and 0 X 1 = 0. Therefore if we have to multiply 101 and 11 then it will be 1111

Dividing Binary Numbers – Binary numbers are divided the same way as we divide the numbers in decimal system. For example: - 11011 divided by 101 gives 101 as a quotient and 10 as a remainder.