Introduction to Number System

**NUMBER SYSTEM **

ü It is a system for representing numeric values or quantities using different symbols (digits).

ü It deals with numbers and their representation in different systems.

ü Base of a system is equal to the number of symbols used in that system.

ü The base is also called the radix of the system.

**Type of Number System**

In Computer System there are 4 types of number system used. These are –

1.Decimal Number System

2.Binary Number System

3.Octal Number System

4.Hexa-Decimal Number System

1. Decimal Number System:

In real life we use Decimal Number System. Recently we used.

Base: 10 (Construct numbers combination of 10 digits)

Digits used: 0, 1, 2, 3, 4, 5 ,6, 7, 8, 9 All numbers can be represented by these digits.

Counting just like: 0,1,2, 3 …4,5… 10, 11 ……100, 101 … and so on.

Example: 1234, 4566, 10100, (1234)_{10}, (10100)_{10}

(a) NATURAL NUMBERS-

- In natural numbers are those used for counting and ordering.
- It denoted by N and defined as:

N = { 1, 2, 3, 4 . . . . . }

(b) WHOLE NUMBERS-

- If we include 0 with natural numbers then the set of natural numbers are called whole numbers.
- It denoted by W and defined as:

W = {0, 1, 2, 3, 4 . . . . . }

(c) INTEGERS –

- All natural numbers, 0 and negative of counting numbers together forms a set of integers.
- It is denoted by Z:

Z = { . . . -3, -2, -1, 0,1, 2, 3 . . . . . }

- The set of integers is also denoted by I

(d) RATIONAL NUMBERS-

- A number which can be expressed as a ratio of two integers is called a rational number.
- The set of rational number is denoted by Q.

Examples of rational numbers are:

(e) IRRATIONAL NUMBER –

- System of the number which cannot be represented in the form of p/q is called irrational number system.
- Examples of irrational numbers are:

√2, √3, pi(π), etc.

(f) REAL NUMBER-

- Real numbers include rational and irrational numbers.
- A
**real number**is any number that can be placed on a number line or expressed as in infinite decimal expansion. - They can be both positive or negative and are denoted by the symbol R.
- Examples of real numbers are:

√2, √3, pi(π), 5, -3/5, 0 etc.

(f) COMPLEX NUMBERS

- Complex Number is the most general set of numbers that include all types of numbers.
- All numbers are Complex Numbers.
- Complex Number having two parts (i) Real Part and (ii) Imaginary Part
- When the imaginary part is zero, we have only the real part.
- Real number is a subset of complex number.
- Complex number system is denoted by C and defined as:

Example: 2+3i , 4.5x + i 6y, 9i etc.

**(2) ****Binary Number System: ****Used in C**omputer Machine (Digital Circuits)

Base: 2 (Construct numbers combination of 2 digits)

Digits used: 0, 1 (only 2 digits not allowed other digits)

Example:(111.01)_{2}, (10100)_{2}, (.10100)_{2, }1111_{2}

Counting just like: 0, 1, 10, 11, 100, 101, 110, 111, 1000 … and so on.

Invalid Binary Number: 1111 (Base not indicate therefore it is decimal)

**(3) **Octal Number System: Used in Data Representation

Base: 8 (Construct numbers combination of 8 digits)

Digits used: 0, 1, 2, 3, 4, 5, 6, 7 (only 8 digits not allowed other digits)

Counting just like: 0, 1, 2 … 6,7, 10, 11, 12… 16, 17, 20, 21… and so on.

Example:(111.01)_{8}, (15601)_{8}, (.151)_{8, }1111_{8}

Invalid Octal Number: 1111 (Base not indicate therefore it is decimal)

(1078)_{8} (8 digit not allowed)

(3479)_{8 }(9 not allowed)

**(4) **Hexa-Decimal Number System: Used in Data Representation

Base: 16 (Construct numbers combination of 16 digits)

Digits used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (10 digits) +

A, B, C, D, E, F (6 digits as character form)

(F is largest digit and 0 is smallest digit in Hexa-Decimal)

Here A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15 in decimal number.

Counting just like: 0, 1, .. 9, A, B, …. E, F, 10, 11 …. 30, 31, 20, 21… and so on.

Example:(111.01)_{16}, (F0A9E)_{16}, (.151)_{16, }1111_{16}

Binary Representation for Signed Numbers

- Computers can handle both positive (unsigned) and negative (signed) numbers.
- The simplest method to represent negative binary numbers is called
**Signed****Magnitude**. - In signed magnitude method the left most bit is Most Significant Bit (MSB) is called
**parity bit or****sign bit**. - Bit means Binary Digit either 0 or 1 (single digit).
- The numbers are represented in computers in different ways:

(1) Signed Magnitude representation:

- The value of the whole numbers can be determined by the sign used before it.
- If the number has no sign or ‘+’ sign it will be considered as positive.
- If the number has ‘–’ sign it will be considered as negative.

**Example: **+27 or 27 is a positive number

–27 is a negative number

- In signed binary representation, the left most bit is considered as sign bit.
- If this bit is 0, it is a positive number and if it 1, it is a negative number.
- Therefore, if binary number stored in 8 bits then 7 bits used for storing values (Magnitude) and 1 bit is used for sign.

(2)1’s Complement representation-

- This is an easier approach to representation to signed numbers.
- This is for negative numbers only i.e. the number whose MSB is 1.
- The following steps used to find 1’s complement of a number:

Step 1: Convert given Decimal number into Binary

Step 2: Check if the binary number contains 8 bits/16 bits, if less add 0 at the left

most bit, to make it as 8 bits/16bits.

Step 3: Find 1’s Compliment (i.e. Change 1 as 0 and 0 as 1)

**Example: **Find 1’s complement for (–36)_{10}

(-36)_{10 }= ( )_{2}

= (1 0 0 1 0 0 )_{2}

= 0 0 1 0 0 1 0 0 (8-bit format)

1’s Compliment = 1 1 0 1 1 0 1 1

(subtract each digit from 1)

Therefore, (-36)_{10 }= (1 1 0 1 1 0 1 1 )_{2}

(3)2’s Complement representation

- The 2’s-complement method for negative number is as follows:

Step 1: Find 1’s Compliment (Subtract each digit from 1)

Step 2: Add 1 to the result to the Least Significant Bit (LSB).

**Example **2’s Complement represent of (-31)_{10}

Binary equivalent of +31 = 1 1 1 1 1

8 bit format = 0 0 0 1 1 1 1 1

1’s Compliment = 1 1 1 0 0 0 0 0

Add 1 to LSB = + 1

2’s Compliment 0f -31 = 1 1 1 0 0 0 0 1

University Exam Solved Questions for Number Systems

BCA Exam 2019

BCA Exam 2018

BCA Exam 2017

Greetings! Very helpful advice in this particular article! It is the little changes that will make the largest changes. Many thanks for sharing!

I love the efforts you have put in this, appreciate it for all the great posts.