How to convert numbers between binary, octal, and hexadecimal number systems

⏱️ Estimated Reading Time: ~2 min read
0
(0)

Number systems: basic concepts

Basic concepts: digit, number, number systems, positional number systems, base of a number system.

A digit is a symbol used to write numbers, similar to letters used to write words.

For example, in the decimal system, the numbers are symbols: 0,1,2,3,4,5,6,7,8,9.

A number serves as a measure, determining the quantity of something. A number is written as a combination of digits. For example, the number 25 (a combination of the digits “2” and “5”).

Positional number systems are number systems where the position of a digit influences its value. For example, “3” is three, “30” is thirty, and “300” is three hundred. Depending on its position (ones, tens, hundreds), the digit “3” yields different numerical values.

The base of a number system is the number of digits used in the number system. For example, in the decimal system, the base is 10.

The most commonly used number systems in computer science are binary, octal, and hexadecimal. 

 

How to convert numbers between binary, octal, and hexadecimal number systems

The binary (bin), octal (oct), and hexadecimal (hex) number systems are closely related. One digit in the octal system corresponds to three digits (a triad) in the binary system. If the number of digits in the binary system is not a multiple of three, leading zeros are added.

The table shows the correspondence between numbers in the octal and binary systems:

Decimal
system
Binary
system
Octal
system
151111 ( 00 1 111 )1 7
1610000 ( 0 10 000 )2 0
1710001 ( 010 001 )2 1
3111111 ( 0 11 111 )3 7

One digit in the hexadecimal system corresponds to four digits (a tetrad) of a binary number. If the number of digits in the binary system is not a multiple of four, leading zeros are added.

The table shows the correspondence between numbers in the hexadecimal and binary systems:

Decimal
system
Binary
system
Hexadecimal
system
151111 ( 1111 )F
1610000 ( 0001 0000 )1 0
1710001 ( 0001 0001 )1 1
3111111 ( 0001 1111 )1 F
63111111 ( 0011 1111 )3 F
641000000 ( 0100 0000 )4 0

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Explore More IT Terms


Share this term: Facebook X LinkedIn WhatsApp Email

Leave a Reply

Your email address will not be published. Required fields are marked *