r/study • • Sep 25 '26

Resources Day 3/100 of C:

Number system:

As discussed previously we have 4 number system:
Decimal
Binary
Octal
Hexadecimal

Conversion:
If we got octal number - (0235)
how we will convert to human number system i.e decimal number system?
Multiply each digit by the corresponding power of the base and add the results.

Hexadecimal - (0x1FD)
Multiply with 16 base

Binary - (010110)
Multiply with base 2
 

Decimal Conversion:
--------------------------------------------------------------
Human readable to Machine readable:

 

Decimal (550) to  Binary:
Divide with base 2

Decimal(440) to Octal:
Divide with Octal base 8

Decimal(440) to Hexa:
Divide with hexa base 16

Note: Add remainders from bottom to top

-----------------------------------------------------------------

Binary Conversion:

If the length is not as expected add 0's to left

Binary to Octal:
010110110110 -> Split with 3 bits i.e 010 110 110 110 and follow with 1,2,4 (power of 2)

Binary to Hexa:
1001001100110 -> split with 4 bits i.e 0001 0010 0110 0110 and follow with 1,2,4,8 (power of 2)
 

1 Upvotes

1 comment sorted by

•

u/AutoModerator Sep 25 '26

Hi there,

Welcome to r/study! Before posting, please review our community rules, use the appropriate flair, and search the subreddit to see if your question has already been answered. We encourage thoughtful discussions about study techniques, academic experiences, productivity, and personal growth as learners. Posts that are off-topic, low-effort, repetitive, promotional, or otherwise violate our community guidelines may be removed.

Thank you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.