Number System:- It defines a set of values that is used to represent quantity. Digital computers internally use the binary number system to represent data and perform arithmetic calculation.
Types of Number System
The number systems generally used by a computer are as follows:-
Binary Number System
This is system is very efficient for computers, but not for humans. It contains only two unique digits 0’s and 1’s. It is also known as Base 2 system. The Binary numbers 0 and 1 are called a bit. The computer always calculates input in binary form. Example:- (10101)2
Here, 2 represent base of Binary Number:-
A List of the first several power of 2 is:- 20= 1, 21 = 2 , 22= 4 , 23 = 8 , 24= 16 , 25=32, 26= 64 , 27 =128 , 28 =256 , 29 =512 , 210 =1024 , 211 =2048.
Decimal Number System
It consists of 10 digits from 0 to 9. These digits can be used to represent any numeric value. It is also known as Base 10 system or positional number system. Example:- (1275)10 , (10406)10.
Octal Number System
It consists of 8 digits from 0 to 7. It is also known as Base 8 system. Each position of the octal number represent a successive power of eight.
A List of the first several powers of 8 is:- 80 = 1, 81 = 8, 82 = 64, 83 = 512, 84 = 4096, 85 = 32768.
Representation of Octal Number in Binary
Octal | Binary Digits |
0 | 000 |
1 | 001 |
2 | 010 |
3 | 011 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
Hexadecimal Number System
It provides us with a shorthand method of working with binary system. There are 16 unique digits available in this system.
There are 0 to 9 and A to F, where A denotes 10, B denotes 11…….. F denotes 15. It is also known as Base 16 system or simply Hex. So, each position of the hexadecimal number represents a successive power of 16.
A List of the first several power of 16 is:- 160 = 1, 161 = 16, 162 = 256, 163 = 4096, 164 = 65536.
Decimals, Binary, Octal and Hexadecimal Equivalents:-
Decimals | Binary | Octal | Hexadecimal |
0 | 0000 | 0 | 0 |
1 | 0001 | 1 | 1 |
2 | 0010 | 2 | 2 |
3 | 0011 | 3 | 3 |
4 | 0100 | 4 | 4 |
5 | 0101 | 5 | 5 |
6 | 0110 | 6 | 6 |
7 | 0111 | 7 | 7 |
8 | 1000 | 10 | 8 |
9 | 1001 | 11 | 9 |
10 | 1010 | 12 | A |
11 | 1011 | 13 | B |
12 | 1100 | 14 | C |
13 | 1101 | 15 | D |
14 | 1110 | 16 | E |
15 | 1111 | 17 | F |
Conversation Between the Number System
Different types of conversion between the number systems are discussed below.
Decimal To Binary
To convert decimal to binary decimal following steps are involved.
Step 1 :- Divide the given number by 2 Step 2:- Note the quotient and remainder. Remainder Should 0 to 1. Step 3:- If quotient 0, then again decide the quotient by 2 and back to step 2. If quotient = 0, then stop the process. Step 4:- First remainder is called as Least Significant Bit (LSB) and last remainder is called as Most Significant Bit (MSB). Step 5 :- Arrange all remainder from MSB to LSB.
Example:- (43) 10 = (?)
REMAINDER | ||
2 | 43 | 1 —-> LSB |
2 | 21 | 1 |
2 | 10 | 0 |
2 | 5 | 1 |
2 | 2 | 0 |
2 | 1 | 1 —–> MSB |
0 |
Binary to Decimal
To convert binary to decimal following steps are involved.
Step 1:- Multiply the all binary digits by powers of 2. Step 2:– The power for integral part will be positive and for fractional part will be negative. Step 3:- Add all the multiplying digits.
Example:- ( 1101.10) 2 = (?) 10 (1101.10) 2 =1x 23 +1x 22 +0 x 21 +1×23 +1x 2-1+1×2-2 = 8 + 4 + 0 + 1 + 0.5 + 0= 13.5. Then, (1101.10) 2 —–>(13.5) 10
Binary to Octal
To convert binary to octal following steps are involved
Step 1:- Make the group of 3 bits from right to left. If the left most group has less than 3 bits, put in the necessary number of leading zeroes on the left. Step 2:- Now, convert each group to decimal number.
Example:- (110110100)2 —-> (?) 8 (110)= 6, (110)= 6, (100)= 4. Then, (110110100) 2 —-> (664) 8
Octal to Binary
Covert every digits of the number from octal to binary in the group of 3 bits.
Example:- (1034.5) 8 —->(?), (1) = 001, (0) = 000, (3) = 011, (4) = 100, (5) = 101. Then, (1034.5)8 —–> (001000011100.101)2
Binary to Hexadecimal
To convert a binary decimals to it’s hexadecimal equivalent follow the steps
Step 1:- Start making the group of 4 bits each from right to left from the given binary number. If the left most group has less then 4 bits put in the necessary number of leading 0’s on the left. Step 2:- Now, each group will be converted to decimal number.
Example:- (11110101111011)2 = (?) 16 0011 = 3 1101 = 13 —–> D 0111 = 7 1011 = 11 ——> B (11110101111011)2 —-> (3D7B) 16
Hexadecimal to Binary
For this type of conversation, convert each hexadecimal digit to 4 bits binary equivalent.
Example:- (BA81) 16 —-> (?)2
B = 11 —> 1011, A = 10 —-> 1010 , 8 —> 1000 , 1 —> 0001. Then, (B481)16 = (1011101010000001) 2
Decimal to Octal
To convert decimal to octal following steps are involved
Step 1:- Divide the given number by 8. Step 2:- Note the quotient and remainder. Digits of remainder will be from 0 to 7. Step 3:- If quotient 0, then again divide the quotient by 8 and go back to step 2. Step 4:- If quotient = 0, then stop the process. Step 5:– Write each remainder from left to right starting from MSD to LSD.
Example:- (97647) 10 —> (?) 8
8 | 97647 | 7 LSD |
8 | 12205 | 5 |
8 | 1525 | 5 |
8 | 190 | 6 |
8 | 23 | 7 |
8 | 2 | 2 MSD |
0 |
Then, (97647) 10 —> (276557) 8
Octal to Decimal
To convert octal to decimal following steps are involved
Step 1:- Multiply each digit to octal number with powers of 8. Step 2:- These powers should be positive for integral part and negative for fractional part. Step 3:- Add the all multiplying digits.
Example:- (327.4)8 —> (?) 10
(327.4)8 = 3 x 82 + 2 x 81 + 7 x 80 + 4 x 8-1 = 3 x 64 + 2 x 8 + 7 x 1 + 4/8 =192 + 16 + 7 + 0.5 = 215.5
Then, (327.4)8 —> (215.5) 10
Decimal to Hexadecimal
To convert decimal to hexadecimal, following steps are involves.
Step 1:- Divide the given number by 16. Step 2:- Note the quotient and remainder. Digits of remainder will be 0 to 9 or A to F. Step 3:- If quotient then again divide the quotient by 16 and go back to step 2. Step 4:- If quotient = 0 or less than 16, stop the process. Step 5:- Write each remainder from left to right starting from MSD to LSD.
Example:- (929987) 10 —> (?) 16
16 | 929987 | 3 –> LSD |
16 | 58124 | 12 –> (C) |
16 | 3632 | 0 |
16 | 227 | 3 |
16 | 14 | 14 –> (E) MSD |
0 |
Then, (929987)10 —> (E 30 C 3) 16
Hexadecimal to Decimal
To convert hexadecimal to decimal following steps are involved
Step 1:- Multiply each digit of hexadecimal number with power of 16. Step 2:- These powers should be positive for integral part and negative for fractional part. Step 3:- Add the all multiplying digits.
Example:- (BC9.8) 16 —> (?) 10
= B x 162 + C x 161 + 9 x 160 + 8 x 16-1 = 11 x 256 + 12 x 16 + 9 x 1 + 8/16 = 2816 + 192 + 9 + 0.5 = 3017.5 Then, (BC9.8) 16 —> (3017.5) 10
Computer Codes
In computer, any characters like alphabet, digit or any special character is represented by collection of 1’s and O’s in a unique coded pattern. In computers, the code is made up pf fixed size group of binary group of binary positions. The binary coding schemes that are most commonly used are as follows
Binary Coded Decimal (BCD)
It is a number system where four bits are used to represent each decimal digits. BCD is a method of using binary digits to represent the decimal digits (0-9). In BCD system, there is no limit on size of a number.
American Standard Code for information Interchange (ASCII)
These are standards character codes used to store data so that it may be used by other software programs. Basically, ASCII codes are of two types which as follows
- ASCII -7 :- It is a 7-bits standard ASCII code. It allows 27= 128 (from 0 to 127) unique symbols.
- ASCII – 8 :- It is a extended version of ASCII -7. It is an 8 bits code. Allows, 28 = 256 (0 to 255) It unique symbols or character.
Extended Binary Coded Decimal Interchange Code (EBCDIC)
In EBCDIC, characters are represented by eight bits. These codes store information which is readable by other computers. It allows (28 = 256) combination of bits.
You can also join us at QUORA