What Is Number System
What Is Number System
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
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
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
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
(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.
STEP 1 – Divide the number with the given base of another number.
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