Conversion between binary and binary

Source: Internet
Author: User

B (binary) binary, O (Octet) octal, D (decimal) Decimal, H (hex) hex

Binary conversions:

1, decimal to n binary

in decimal number/n, the result is again/n until the result is 0, then the remainder of each division result is taken from the back.

Example: 20000 ext. 16 binary

20000/16=1250 Yu 0,

1250/16=78 Yu 2,

78/16=4 (E)

4/16=0 Yu 4

So the result is: 4e20h

2, N to decimal (because decimal is more in line with ordinary people's understanding of data)

The current number of bits per digit *n-1 (calculated from the low) and.

Example: 1011B to decimal 1*2^3+0*2^2+1*2^1+1*2^0 =11

81O Turn Decimal 8*8^2+1*8^1+0*8^0=520

1c4h Turn Decimal 1*16^2+12*16^1+4*16^0=452

3, 2 N-time conversion between the binary

Need to be converted into binary to do transit steps

Example: octal to hexadecimal

(327) o= (D7) H

327o=011 010 111=0000 1101 0111 =d7h

Conversion between binary and 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.