## Introduction:

You’ve heard about the number system. Number systems are techniques for representing numbers of a certain type. It is a mathematical notation for representing numbers, consistently using digits or other symbols. Typically we use a decimal number system in our day-to-day life. However, the computer only understands binary numbers. Others are octal and hexadecimal number systems. In this post, I will try to cover this topic from various aspects. The weight structure counting technique will also discuss. I tried to make things as simple as possible. First I try to explain some common terms used in the number system.

## Key Questions:

What are the different types of number systems?

What are the applications of different number systems?/Why do we use different number systems?

Discuss counting in binary, counting in octal and counting in hexadecimal

## Types:

Some commonly used number systems are:

- Binary number system (base 2)
- Octal number system (base 8)
- Decimal number system (base 10)
- Hexadecimal number system (base 16)

## Number Base (Radix):

The base of any number system is defined by the number of different unique symbols possible in that number system.

Base 2 has only two unique symbols 0,1

,Base 8 has 8 unique symbols 0-7

following Base 10 has 10 unique symbols 0-9

and Base 16 has 16 unique symbols 0-9 A-F

## Positional Notation:

In a weighted system, each digit has its value multiplied by its place value/weight. Multiplying each digit with its place value or weight and summing up all, we get the original number. We all know about units, tens, hundreds and thousands, these are the positional notations which is mathematically represented by the POWER of BASE. The digit at tens position has more weight than the digit at a units place. Similarly, the digit at the hundreds place has more weight than the digit at tens place. The concept will be more clear after solved examples are later provided in the post.

## Weight:

The weight of numbers is determined by their position. The weight for whole numbers is the positive powers of base/radix that increase from right to left. For fractional numbers, the weights are negative powers of 10 decreases from left to right.

## Counting Technique:

While counting in any number system some points should be kept in mind. These are as follows:

- If we place a zero on the left side of a number it doesn’t change the number. For example, if I write 6576 or 06576 both are the same
- Units place updates at every iteration while the other places remain the same
- If the unit place can not upgrade further, it’s time to reset unit place and tens place upgrades this time
- If both unit and ten places can not upgrade further, it’s time to reset both places and upgrade the hundred place example 099)
_{10}units and tens places can not upgrade further, both are reset to 0 and hundreds place upgrades to 1. So 099 becomes 100

Binary | Decimal | Octal | Hexadecimal |

00 | 00 | 00 | 00 |

01 | 01 | 01 | 01 |

10 | 02 | 02 | 02 |

11 | 03 | 03 | 03 |

100 | 04 | 04 | 04 |

101 | 05 | 05 | 05 |

110 | 06 | 06 | 06 |

111 | 07 | 07 | 07 |

1000 | 08 | 10 | 08 |

1001 | 09 | 11 | 09 |

1010 | 10 | 12 | 0A |

1011 | 11 | 13 | 0B |

1100 | 12 | 14 | 0C |

1101 | 13 | 15 | 0D |

1110 | 14 | 16 | 0E |

1111 | 15 | 17 | 0F |

## 1. Decimal Number System:

The decimal number system with its ten digits is a base 10 system. We all are familiar with the decimal number system because we use it in our daily lives. But most of us are unfamiliar with **weights** and **positional notations**. The understanding of this concept is easy in the decimal system because all of us are familiar with it. Later on, the same concept will be applied to the other number systems.

### Largest possible value:

For single-digit numbers, the largest possible value is 9 = 10^{1}-1

For two digits number, the largest possible value is 99 = 10^{2}-1

For three digits number, the largest possible value is 999 = 10^{3}-1

For four digits number, the largest possible value is 9999 = 10^{4}-1

For five digits number, the largest possible value is 99999 = 10^{5}-1

Generalize,

For n digits number, the largest possible value is **10**^{n}**-1**

### Weight Structure:

10^{n-1}… 10^{3} 10^{2} 10^{1} 10^{0} 10^{-1} 10^{-2} 10^{-3}… 10^{-n}

**Example: The number is given ****4567**

** Determine its weight and positional notation**

Number | 4 | 5 | 6 | 7 |

Positional Notation | 3Thousands | 2Hundreds | 1Tens | 0Units |

Weight | 10^{3} | 10^{2} | 10^{1} | 10^{0} |

**Example: 4567 expresses it as sum of the values of each digit**

Remember: weight increases from right to left for whole numbers

4567=(4*10^{3})+(5*10^{2})+(6*10^{1})+(7*10^{0})

=(4*1000)+(5*100)+(6*10)+(7*1)

=4000+500+60+7

=4567

**Example:4567.89 determine its weight and positional notation and express it as sum of the values of each digit**

Number | 4 | 5 | 6 | 7 | . | 8 | 9 |

Positional Notation | 3Thousands | 2Hundreds | 1Tens | 0Units | -1Tenths | -2Hundredth | |

Weight | 10^{3} | 10^{2} | 10^{1} | 10^{0} | 10^{-1} | 10^{-2} |

Remember weight decreases from left to right after the decimal point.

4567.89=(4*1000^{3})+(5*100^{2})+(6*10^{1})+(7*10^{0}). (8*10^{-1})+(9*10^{-2})

= (4*1000)+(5*100)+(6*10)+(7*1). (8*0.1)+(9*0.01)

=4000+500+60+7.(0.8)+(0.09)

=4567.89

## 2. Binary Number System:

It is a counting system with only two bits 0 and 1. It is a weighted number system. The rightmost bit is the least significant bit (LSB) and has a weight of 2^{0}(weight is determined by POWER of BASE). While the left most bit is the most significant bit (MSB) and its weight depends upon the size of the binary number. When we are working with a particular number system we used to mention its base.

For example 0)_{2} 110)_{2}

The subscript ‘2’ shows base or radix.

### Largest possible value:

For a single bit number, the largest possible value is 1)_{2 }= 2^{1}-1)_{10}= 1)_{10}

For two bits numbers, the largest possible value is 11)_{2 }= 2^{2}-1)_{10}= 3)_{10}

For three bits numbers, the largest possible value is 111)_{2}= 2^{3}-1)_{10}= 7)_{10}

For four bits number, the largest possible value is 1111)_{2}= 2^{4}-1)_{10}= 15)_{10}

For five bits number, the largest possible value is 11111)_{2}= 2^{5}-1)_{10}=31)_{10}

Generalize,

For n bits number, the largest possible value is **2**^{n}**-1)**_{10}

### Weight Structure

2^{n-1}… 2^{3} 2^{2} 2^{1} 2^{0} 2^{-1} 2^{-2} 2^{-3}… 2^{-n}

**Example: 1011)**_{2}** express it as sum of the values of each digit, or convert the number in decimal equivalent.**

1011)_{2}= (1*2^{3})+(0*2^{2})+(1*2^{1})+(1*2^{0})

=(1*8)+(0*4)+(1*2)+(1*1)

=8+0+2+1

=11)_{10}

**Example: 1011.11 determine its weight and positional notation and express it as sum of the values of each digit or convert the number in decimal equivalent**

Number | 1 | 0 | 1 | 1 | . | 1 | 1 |

Positional Notation | 3Thousands | 2Hundreds | 1Tens | 0Units | -1Tenths | -2Hundredth | |

Weight | 2^{3} | 2^{2} | 2^{1} | 2^{0} | 2^{-1} | 2^{-2} |

1011)_{2}= (1*2^{3})+(0*2^{2})+(1*2^{1})+(1*2^{0}).+(1*2^{-1})+(1*2^{-2})

=(1*8)+(0*4)+(1*2)+(1*1). (1*0.5)+(1*0.25)

=8+0+2+1.+0.5+0.25

=11.75)_{10}

## 3. Octal Number System:

The octal number system is another type of numbering technique that is less common nowadays. It is a base 8 system that has 8 unique symbols. These are 0,1,2,3,4,5,6,7

### Largest possible value:

For single-digit numbers, the largest possible value is 7)_{8}= 8^{1}-1)_{10}= 7)_{10}

For two digits number, the largest possible value is 77)_{8}= 8^{2}-1)_{10}= 63)_{10}

For three digits number, the largest possible value is 777)_{8}= 8^{3}-1)_{10}=511)_{10}

For four digits number, the largest possible value is 7777)_{8}= 8^{4}-1)_{10 }= 4,095)_{10}

For five digits number, the largest possible value is 77777)_{8}= 8^{5}-1)_{10}=32,767)_{10}

Generalize,

For n digits number, the largest possible value is 8^{n}-1)_{10}

### Weight Structure:

8^{n-1}… 8^{3} 8^{2} 8^{1} 8^{0} 8^{-1} 8^{-2} 8^{-3}… 8^{-n}

**Example: 1267)**_{8 }**express it as sum of the values of each digit, or convert the number in decimal equivalent**

1267)_{8} = (1*8^{3})+(2*8^{2})+(6*8^{1})+(7*8^{0})

=(1*512)+(2*64)+(6*8)+(7*1)

=512+128+48+7

=695)_{10}

**Example: 1267.44)**_{8}** determine its weight and positional notation and express it as sum of the values of each digit or convert the number in decimal equivalent.**

Number | 1 | 2 | 6 | 7 | . | 4 | 4 |

Positional Notation | 3Thousands | 2Hundreds | 1Tens | 0Units | -1Tenths | -2Hundredth | |

Weight | 8^{3} | 8^{2} | 8^{1} | 8^{0} | 8^{-1} | 8^{-2} |

1267)_{8} = (1*8^{3})+(2*8^{2})+(6*8^{1})+(7*8^{0}).+(4*8^{-1})+(4*8^{-2})

=(1*512)+(2*64)+(6*8)+(7*1). +(4*0.125)+(4*0.015625)

=512+128+48+7+0.5+0.0625

=695.5625)_{10}

## 4. hexadecimal Number System:

The base 16 or hexadecimal system has 16 unique symbols. These are 0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F

### Largest possible value:

For single-digit numbers, the largest possible value is F)_{16} = 16^{1}-1)_{10}=15)_{10}

For two digits number, the largest possible value is FF)_{16} = 16^{2}-1)_{10}=255)_{10}

For three digits number, the largest possible value is FFF)_{16} = 16^{3}-1)_{10}=4095)_{10}

For four digits number, the largest possible value is FFFF)_{16} = 16^{4}-1)_{10}=65,535)_{10}

For five digits number, the largest possible value is FFFFF)_{16} = 16^{5}-1)_{10}=1,048,575)_{10}

Generalize

For n digits number, the largest possible value is ** 16**^{n}**-1)**_{10}

### Weight Structure:

16^{n-1}… 16^{3} 16^{2} 16^{1} 16^{0} 16^{-1} 16^{-2} 16^{-3}… 16^{-n}

**Example: 57FF)**_{16}** express it as sum of the values of each digit or convert the number in decimal equivalent**

57FF)_{16} = (5*16^{3})+(7*16^{2})+(F*16^{1})+(F*16^{0})

= (5*4096)+(7*256)+(15*16)+(15*1)

= 20480+1792+240+15

= 22527)_{10}

**Example:57FF.1A)**_{16 }** determine its weight and positional notation and express it as sum of the values of each digit or convert the number in decimal equivalent.**

Number | 5 | 7 | F | F | . | 1 | A |

Positional Notation | 3Thousands | 2Hundreds | 1Tens | 0Units | -1Tenths | -2Hundredth | |

Weight | 16^{3} | 16^{2} | 16^{1} | 16^{0} | 16^{-1} | 16^{-2} |

57FF)_{16} = (5*16^{3})+(7*16^{2})+(F*16^{1})+(F*16^{0}). (1*16^{-1})+(10*16^{-2})

=(5*4096)+(7*256)+(15*16)+(15*1) (1*0.0625)+(10*0.00390625)

=20480+1792+240+15.0.0625+0.0390625

= 22527.0.1015625)_{10}

## Applications:

- The computer uses a binary number system with ‘zero’ representing ‘off’ position and ‘one’ representing an ‘on’ position
- Digital circuits work only with binary values like logic 0’ and logic 1
- Computer use binary numbers in addressing memory but for memories in the range of gigabytes it is more appropriate to use hexadecimal numbers for addressing
- Hexadecimal numbers are used as a compact way of representing binary numbers and it is very easy to convert between binary and hexadecimal.
- Long binary numbers are difficult to write as it is easy to drop a bit. To overcome this problem hexadecimal and octal numbers are used.