Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
13 views

What Is Number System

Uploaded by

raroy67751
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

What Is Number System

Uploaded by

raroy67751
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

What is Number System ?

A number system is a method to represent numbers mathematically. It can use


arithmetic operations to represent every number uniquely. To represent a number, it
requires a base or radix.

Types of Number System


There are four common types of number systems based on the radix or base of the
number :

Decimal number system or Base 10 number system


Binary number system or Base 2 number system
Octal number system or Base 8 number system
Hexadecimal number system or Base 16 number system
Number System Conversion Methods
A number N in base or radix b can be written as:

(N)b = dn-1 dn-2 -- -- -- -- d1 d0 . d-1 d-2 -- -- -- -- d-m


In the above, dn-1 to d0 is the integer part, then follows a radix point, and then
d-1 to d-m is the fractional part.

dn-1 = Most significant bit (MSB)


d-m = Least significant bit (LSB)

1. Decimal to Binary Number System


To convert from decimal to binary, start dividing decimal number by 2, and whatever
the reminder getting, writing down from bottom to top, and that will be the binary
number representation of the decimal number. And the number contains fractional
part, then multiply 2 in the fractional part.

Example
(10.25)10

Note: Keep multiplying the fractional part with 2 until decimal part 0.00 is
obtained.
(0.25)10 = (0.01)2

Answer: (10.25)10 = (1010.01)2

2. Binary to Decimal Number System


To convert from binary to decimal, start multiplying the exponent of 2 with each
digit of the number in decreasing order. If the number contains fractional part
then will divide it by the exponent of 2.

Example
(1010.01)2
1x23 + 0x22 + 1x21+ 0x20 + 0x2 -1 + 1x2 -2 = 8+0+2+0+0+0.25 = 10.25
(1010.01)2 = (10.25)10
3. Decimal to Octal Number System
To convert from decimal to octal, start dividing decimal number by 8, and whatever
the reminder getting, writing down from bottom to top, and that will be the octal
number representation of the decimal number. And the number contains fractional
part, then multiply 8 in the fractional part.
Example
(10.25)10
(10)10 = (12)8
Fractional part:
0.25 x 8 = 2.00
Note: Keep multiplying the fractional part with 8 until decimal part .00 is
obtained.
(.25)10 = (.2)8

Answer: (10.25)10 = (12.2)8

4. Octal to Decimal Number System


To convert from octal to decimal, start multiplying the exponent of 8 with each
digit of the number in decreasing order. If the number contains fractional part
then will divide it by the exponent of 8.

Example
(12.2)8
1 x 81 + 2 x 80 +2 x 8-1 = 8+2+0.25 = 10.25
(12.2)8 = (10.25)10
5. Hexadecimal to Binary Number System
To convert from Hexadecimal to Binary, write the 4-bit binary equivalent of
hexadecimal.

Example
(3A)16 = (00111010)2

6. Binary to Hexadecimal Number System


To convert from Binary to Hexadecimal, start grouping the bits in groups of 4 from
the right-end and write the equivalent hexadecimal for the 4-bit binary. Add extra
0’s on the left to adjust the groups.

Example
1111011011
0011 1101 1011
(001111011011 )2 = (3DB)16
7. Binary to Octal Number System
To convert from binary to octal, start grouping the bits in groups of 3 from the
right end and write the equivalent octal for the 3-bit binary. Add 0’s on the left
to adjust the groups.

Example
111101101

111 101 101

(111101101)2 = (755)8

Conclusion
In the conclusion, number system provides a representation of a number with respect
to the given base or radix. Basically, we have common types of number system named
as binary number system, decimal number system, octal number system and hexadecimal
number system.

Number System and Base Conversions – FAQs


What is number system and its conversion?
A number system is a method to represent numbers mathematically. It can use
arithmetic operations to represent every number uniquely. To represent a number, we
convert it requires a base or radix.

How to do base conversions?


For this, first take the number and then divide it by the given base. Then note
down the remainder obtained after the division. Then, divide the quotient of the
division obtained by the given base.

How to calculate number system?


There are 3 required steps to calculate the number system.

STEP 1 – Divide the number with the given base of another number.

STEP 2 – Note down the resulting remainder

STEP 3 – Divide the quotient

Three 90 Challenge is back on popular demand! After processing refunds worth INR
1CR+, we are back with the offer if you missed it the first time. Get 90% course
fee refund in 90 days. Avail now!
"The DSA course helped me a lot in clearing the interview rounds. It was really
very helpful in setting a strong foundation for my problem-solving skills. Really a
great investment, the passion Sandeep sir has towards DSA/teaching is what made the
huge difference." - Gaurav | Placed at Amazon

Before you move on to the world of development, master the fundamentals of DSA on
which every advanced algorithm is built upon. Choose your preferred language and
start learning today:

DSA In JAVA/C++
DSA In Python
DSA In JavaScript
Trusted by Millions, Taught by One- Join the best DSA Course Today!

Kriti Kushwaha

115
Previous Article
Digital Electronics and Logic Design Tutorials
Next Article
1's and 2's complement of a Binary Number
Read More
Down Arrow
Similar Reads
Given a number N in decimal base, find number of its digits in any base (base b)
Given A Number n in a base 10, find the number of digits in its base b
representation. Constraints : [Tex]N \in \mathbb{W} [/Tex]Whole Examples : Input :
Number = 48 Base = 4 Output: 3 Explanation : (48)10 = (300)4 Input : Number = 1446
Base = 7 Output: 4 Explanation : (446)10 = (4134)7 A simple approach: convert the
decimal number into the given b
8 min read
Find the Nth digit from right in base B of the given number in Decimal base
Given a number A in decimal base, the task is to find the Nth digit from last in
base BExamples: Input: A = 100, N = 3, B = 4 Output: 2 Explanation: (100)4 = 1210
3rd digit from last is 2 Input: A = 50, N = 3, B = 5 Output: 2 Explanation: (50)5 =
200 3rd digit from last is 2 Naive Approach: The basic idea is to first convert the
decimal number A in
7 min read
Given a number N in decimal base, find the sum of digits in any base B
Given a number N in decimal base, the task is to find the sum of digits of the
number in any base B. Examples: Input: N = 100, B = 8 Output: 9 Explanation: (100)8
= 144 Sum(144) = 1 + 4 + 4 = 9 Input: N = 50, B = 2 Output: 3 Explanation: (50)2 =
110010 Sum(110010) = 1 + 1 + 0 + 0 + 1 + 0 = 3 Approach: Find unit digit by
performing modulo operation
6 min read
Convert a number from base A to base B
Given two positive integers A and B and a string S of size N, denoting a number in
base A, the task is to convert the given string S from base A to base B. Examples:
Input: S = "10B", A = 16, B = 10Output: 267Explanation: 10B in hexadecimal (base
=16) when converted to decimal (base =10) is 267. Input: S = "10011", A = 2, B =
8Output: 23Explanation
11 min read
Convert a number from base 2 to base 6
Given a binary integer N, the task is to convert it into base 6. Note: The number
of bits in N is up to 100. Examples: Input: N = "100111"Output: 103Explanation: The
given integer (100111)2 is equivalent to (103)6. Input: N = "1111111"Output: 331
Approach: The given problem can be solved by first converting the given integer to
decimal, thereafter
13 min read

You might also like