search

Home  >  Q&A  >  body text

java - Three binary digits represent octal, and four binary digits represent hexadecimal. So how many binary digits represent decimal?

Three-digit binary represents octal, and four-digit binary represents hexadecimal. So how many binary digits represent decimal?

PHP中文网PHP中文网2776 days ago1202

reply all(2)I'll reply

  • 漂亮男人

    漂亮男人2017-05-16 13:30:36

    Very simple math problem~

    2^3 = 8
    2^4 = 16
    2^n = 10

    Then, n = log2(10) = 3.321928094887362. Not an integer.

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:30:36

    Based on your question "Three-digit binary represents octal, four-digit binary represents hexadecimal", it can be deduced that you should mean
    The minimum of three-digit binary is 000 and the maximum is 111. Its range is exactly 0-7, which constitutes octal. One digit, so One octal requires three binary digits
    And the minimum
    four digit binary is 000, the maximum is 1111, its range is exactly 0-15, which constitutes one hexadecimal digit, so One hexadecimal The system requires four binary digits
    And
    according to the above, there should be no such statement about how many binary digits correspond to one decimal digit. The decimal notation method based on 10 as the base is 0,1,2,3,4,5,6, 7,8,9
    while binary
    000->0
    001->1
    010->2
    011->3
    100->4
    101->5
    110->6
    111->7
    1000->8

    How many binary digits correspond to one decimal digit? It spans three and four digits
    So by inferring, you can know why three binary digits represent octal and four binary digits represent hexadecimal

    reply
    0
  • Cancelreply