HQ-hexadecimal conversion

Source: Internet
Author: User


  二进制  是由 0和1 组成

【十进制转二进制】    如   23写成二进制为 10111


    11/2=5    1

    5/2=2     1

    2/2=1     0

  所以为  23写成二进制为10111



      例如 1011写成十进制为 1*2^0+1*2^1+0*2^2+1*2^3=11




    例如  48的八进制

        48/8=6 余0

      所以 48的八进制为60


【八进制转十进制】   (同二进制转十进制)


     60的十进制为     0*8^0+6*8^1=48






 【二进制转八进制】 ( 二进制从左往右,每三位一组,每组从右开始第一位为1,第二位为2,第二位4,分别于二进制数相乘,每组求和,最后得数左右互换位置。){为什么三个一组,因为 2的三次方为8。(1,2,4)}

       如   10110101

              10   110   101

          0*1+1*2=2    0*1+1*2+1*4=6    1*1+0*2+1*4=5




         如   72的二进制为     111010





【十六进制转二进制 】



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.