Number System Complete Tutorial (Computers) | Types | Conversions | Examples

Number System Complete Tutorial (Computers) | Types | Conversions | Examples




In this post, learn about Number System in Computers, their types, examples and most importantly the conversion of numbers in of various types.

Table of Contents

Number System

A number system is a writing system is a collection of various symbols which are called digits. Computers don’t understand high level languages like us. They can only understand numbers (mostly binary numbers).

Types of Number System

There are various types of Number Systems but here we will be discussing about the most common types of Number systems.

Binary Number System

  • Base 2 (2 Digits: 0 and 1)
  • This system is a positional notation with a radix of 2. Each digit is referred to as a bit.
  • Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used by almost all modern computers and computer-based devices.

Decimal Number System (Hindu–Arabic Numeral System)

  • Base 10 (10 Digits: 0 to 9)
  • Occasionally called denary.
  • Standard system for denoting integer and non-integer numbers.

Octal Number System

  • Base 8 (8 Digits: 0 to 7)

Hexadecimal Number System (HEX)

  • Base 16 (10 Digits & 6 Characters: 0 to 9 and A to F)


Conversion of Numbers in Various Number Systems

A. Binary to Other Number Systems

1. Binary To Octal Conversion

(11101010)2 = (352)8

Step 1: Write down the binary number

(011101010)2

Group all the digits in sets of three starting from the LSB (far right). Add zeros to the left of the last digit if there aren’t enough digits to make a set of three.

011 101 010

Step 2: Use the table below to convert each set of three into an octal digit. In this case,

011=3, 101=5, 010=2

So, the number 11101010 in binary is equivalent to 352 in octal.

To convert from binary to octal use the following table:

Binary:000001010011100101110111
Octal:01234567

2. Binary To Decimal Conversion

(11101010)2 = (234)10

Step 1: Write down the binary number

11101010

Step 2: Multiply each digit of the binary number by the corresponding power of two

1x27 + 1x26 + 1x25 + 0x24 + 1x23 + 0x22 + 1x21 + 0x20

Step 3: Solve the powers

1x128 + 1x64 + 1x32 + 0x16 + 1x8 + 0x4 + 1x2 + 0x1 = 128 + 64 + 32 + 0 + 8 + 0 + 2 + 0

Step 4: Add up the numbers written above

128 + 64 + 32 + 0 + 8 + 0 + 2 + 0 = 234. 

Thus 234 is the decimal equivalent of the binary number 11101010

3. Binary To Hexadecimal Conversion

(11101010)2 = (EA)16

Step 1: Write down the binary number

11101010

Step 2: Group all the digits in sets of four starting from the LSB (far right). Add zeros to the left of the last digit if there aren’t enough digits to make a set of four:

1110 1010

Step 3: Use the table below to convert each set of three into an hexadecimal digit, in this case:

1110 = E, 1010 = A

So, EA is is the hexadecimal equivalent to the decimal number 11101010.

To convert from binary to hexadecimal use the following table:

Binary:00000001001000110100010101100111
Hexadecimal:01234567
Binary:10001001101010111100110111101111
Hexadecimal:89ABCDEF

B. Decimal To Other Number Systems

1. Decimal To Binary Conversion

(123)10 = (1111011)2

Step 1: Divide (123)10 successively by 2 until the quotient is 0

 123/2 = 61, remainder is 1
  61/2 = 30, remainder is 1
  30/2 = 15, remainder is 0
  15/2 =  7, remainder is 1
   7/2 =  3, remainder is 1
   3/2 =  1, remainder is 1
   1/2 =  0, remainder is 1

Step 2: Read from the bottom (MSB) to top (LSB) as 1111011. This is the binary equivalent of decimal number 123.

2. Decimal To Octal Conversion

(123)10 = (173)8

Step 1: Divide (123)10 successively by 8 until the quotient is 0:

 123/8 = 15, remainder is 3
  15/8 =  1, remainder is 7
   1/8 =  0, remainder is 1

Step 2: Read from the bottom (MSB) to top (LSB) as 173. This is the octal equivalent of decimal number 123

3. Decimal To Hexadecimal Conversion

(123)10 = (7B)16

Step 1: Divide (123)10 successively by 16 until the quotient is 0:

123/16 = 7, remainder is 11

  7/16 = 0, remainder is 7

Here is the table for conversion Decimal to Hexa and Vice-Versa

Dec:0123456789101112131415
Hex:0123456789ABCDEF

Step 2: Read from the bottom (MSB) to top (LSB) as 7B. This is the hexadecimal equivalent of decimal number 123

B. Octal To Other Number Systems

1. Octal To Binary Conversion

(123)8 = (1010011)2

Step 1: Look up each octal digit to obtain the equivalent group of three binary digits.

(1)8 = (001)2
(2)8 = (010)2
(3)8 = (011)2

You can use the table below to make these conversions.

Oct:01234567
Bin:000001010011100101110111

Group each value of step 1 to make a binary number:

001 010 011

So, (1010011)2 is the binary equivalent to (123)8

Step 2: Multiply each digit of the octal number by the corresponding power of eight:

1x82 + 2x81 + 3x80

Step 3: Solve the powers:

1x64 + 2x8 + 3x1

Step 4: Add up the numbers written above:

64 + 16 + 3 = 83

This is the decimal equivalent of the octal number 123.

2. Octal To Decimal Conversion

(123)8 = (83)10

Step 1: Write down the octal number:

123

Step 2: Multiply each digit of the octal number by the corresponding power of eight:

1x82 + 2x81 + 3x80

Step 3: Solve the powers:

1x64 + 2x8 + 3x1

Step 4: Add up the numbers written above:

64 + 16 + 3 = 83

This is the decimal equivalent of the octal number 123.

3. Octal To Hexadecimal Conversion

(123)8 = (53)16

Step 1: Look up each octal digit to obtain the equivalent group of three binary digits. You can use the table below to make these conversions.

Octal to Binary Conversion Table

Oct:01234567
Bin:000001010011100101110111

(1)8 = (001)2
(2)8 = (010)2
(3)8 = (011)2

Step 2: Group each value of step 1 to make a binary number.

001 010 011
(123)8 = (1010011)2

Step 3: Now convert the binary number from step 2 to hexa by grouping all the digits of the binary in sets of four starting from the LSB (far right).

0101 0011

Note: add zeros to the left of the last digit if there aren’t enough digits to make a set of four.

Step 4: Convert each group of four to the corresponding hexadecimal (use the table below)

0101=5, 0011=3.

So, 123 in octal is equivalent to 53 in hexadecimal

To convert from binary to hexadecimal use the following table:

Bin:00000001001000110100010101100111
Hexa:01234567
Bin:10001001101010111100110111101111
Hexa:89ABCDEF

B. Hexadecimal To Other Number Systems

1. Hexadecimal To Binary Conversion

(123)16 = (100100011)2

Step 1: Look up each octal digit to obtain the equivalent group of four binary digits.

(1)16= (0001)2
(2)16= (0010)2
(3)16= (0011)2

You can use the table below to make these conversions.

Binary:00000001001000110100010101100111
Hexadecimal:01234567
Binary:10001001101010111100110111101111
Hexadecimal:89ABCDEF

Step 2: Group each value of step 1

0001 0010 0011

Step 3: Join these values and remove zeros at left (if necessary) to get the binary result.

100100011

So, 100100011 is the binary equivalent of hexadecimal number 123.

2. Hexadecimal To Octal Conversion

(123)16 = (443)8

Step 1: Look up each hexadecimal digit to obtain the equivalent group of four binary digits.

(1)16 = (0001)2
(2)16 = (0010)2
(3)16 = (0011)2

You can use the table below to make these conversions.

Bin:00000001001000110100010101100111
Hexa:01234567
Bin:10001001101010111100110111101111
Hexa:89ABCDEF

Step 2: Group each value and remove zeros at left (if necessary) to get the partial result in base 2:

0001 0010 0011 = 100100011
So, (123)16 = (100100011)2

Step 3: Rearrange all the digits in sets of three starting from the LSB (far right). Add zeros to the left of the last digit if there aren’t enough digits to make a set of three.

100 100 011

Step 4: Use the table below to convert each set of three into an octal digit. In this case,

100=4, 100=4, 011=30.

So,

Binary to Octal conversion table:

Binary:000001010011100101110111
Octal:01234567

443 is the octal equivalent of hexadecimal number 123

2. Hexadecimal To Decimal Conversion

(123)16 = (291)10

Step 1: Write down the hexadecimal number:

(123)16

Step 2: Show each digit place as an increasing power of 16:

1x162 + 2x161 + 3x160

Step 3: Convert each hexadecimal digits values to decimal values then perform the math:

1x256 + 2x16 + 3x1 = (291)10

So, the number 291 is the decimal equivalent of hexadecimal number 123 (Answer).


Quick Conversion Table

BinaryDecimalHexadecimalOctal
0000
1111
10222
11333
100444
101555
110666
111777
10008810
10019911
101010A12
101111B13
110012C14
110113D15
111014E16
111115F17
100001610110
100011711111
100101812112
100111913113
101002014114
101012115115
101102216116
101112317117
1100024181110
1100125191111
11010261A1112
11011271B1113
11100281C1114
11101291D1115
11110301E1116
11111311F1117
100000322011110
10000006440111111110
100000001288011111111111111110

Number System Conversion Table PDF Download


Leave a Reply

Your email address will not be published. Required fields are marked *