Conversion between conversions (binary, octal, 16 decimal, binary)

Source: Internet
Author: User
Tags decimal to binary

The conversion of conversions is very often used in our lives.

We are more common in the system has

1. Binary

2, eight binary

3. Decimal

4. Hex

5, 12 binary

6, 24 binary

7 ...

One or two binary

We all know that binary is more used in computers because there are only two states in the computer (switch or high level low)

We generally use the base 0 and the representation, the binary operation is 2 in 1

In general, there are two ways we operate

1.1-In addition to the second method of taking the remainder

This approach is a solution

For example: (We are here to convert decimal into binary)

13 Conversion to Binary

13/2=6..........1

6/2=3.............0

3/2=1.............1

1/2=0.............1

The remainder is reversed to 1101, then 13 is converted to binary 1101 (B)

2, eight binary

Octal base is 0----7, every 8 in 1

The principle is the same as in binary

Here we have two ways to convert octal into binary.

2.1 Method 1:8 conversion to decimal, then decimal to binary

21 (8) =2*8^1+1*8^0=17

------Conversion to Binary 10001 (B)

2.2 Method 2:8 binary conversion to binary (octal binary of a corresponding binary three-bit)

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

Can be written in 10001

3. Decimal

Decimal the most used in our lives

123 = 1*10^2+2*10^1+3*10^1=100+20+3=123

4. Hex

Hexadecimal is the most used in a computer

Why use hex more
1, with the binary conversion convenient
2. Simpler than binary writing

The hexadecimal cardinality is 0-9 a-f

hexadecimal conversion to binary is a corresponding four-bit

0x33=00110011

The principle of other conversion and the similar above, we need to combine some of these methods or rules can be solved smoothly

Conversion between conversions (binary, octal, 16 decimal, binary)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.