10
\$\begingroup\$

I am studying this book:

x64 Assembly Language Step-by-Step. Programming with Linux-Wiley (2024) JEFF DUNTEMANN

enter image description here

If I understand correctly, 1 in hexadecimal is equal to 1 in decimal. However, the table shows, for example:

1H = 16^0 = 1 x 16 = 10H

and that equality does not hold, I think.

Am I misreading this table ? How can I read it correctly ?

\$\endgroup\$
1
  • 3
    \$\begingroup\$ the table makes no sense ... the last column is messed up ... any number to the power of zero equals one ... 12345^0 = 1 \$\endgroup\$
    – jsotola
    Commented Jun 16 at 19:47

1 Answer 1

18
\$\begingroup\$

Simply, you are correct and the last column in that text, Decimal, is highly confusing and should not be in the same table. For example,

  • 1hex = 1hex x 16dec0 = 1dec

  • 10hex = (1hex x 16dec1) + (0hex x 16dec0) = 16dec

  • 2bhex = (2hex x 16dec1) + ([bhex = 11dec] x 160) = 32dec + 11dec = 43dec

Any number to the zeroth power (except zero) equals one.

The second statement is also true, but really belongs with the second line of the text, which itself is just a tautology:

  • 10hex = 1dec x 16dec1 = 1hex x 16dec = 10hex

You might write to Wiley about that blunder - when students in a class I taught found such an error, they got a free copy of the book with errata corrected.

And 2ahex = 42dec

\$\endgroup\$
5
  • 1
    \$\begingroup\$ 2B | ~2B... You might find this interesting. Further, this shows 0^0 can, sometimes, be defined to be 1. \$\endgroup\$
    – user378383
    Commented Jun 17 at 4:33
  • 2
    \$\begingroup\$ @Fe2O3, Yes, it can be made an arbitrary definition, but the domain of y = x/x includes all real and imaginary numbers except for zero. If a number to a negative exponent involves dividing by that number, 0^-1 makes no sense, either. And yes, 2B | ~2B poses a grave question. Perhaps the dolphins got it wrong? \$\endgroup\$ Commented Jun 17 at 6:04
  • 2
    \$\begingroup\$ Certainly "to be" and "to not be" is at the core of existentialism. One of the MANY mystical properties of 42 is its appearance as the sum of the values of the letters of "TOBE", when 'A' = 1, 'B' = 2, etc... It's getting way off topic, but it seems the dolphins have figured it out. "The Answer" is to be (for a while), and then to not be (for a while). Once one achieves the latter state, the difference in duration between eternity and this current passage is somewhat moot. Like the dolphins, one's left with favouring: "make hay while the sun shines." Cheers! \$\endgroup\$
    – user378383
    Commented Jun 17 at 6:20
  • 2
    \$\begingroup\$ The problem doesn't seem to be so much that the last column shouldn't be in that table (there's nothing wrong with a table showing both hexadecimal and decimal). Rather, it's the fact there's an "=" sign at the end of the 2nd column, yet all numbers in the last column are multiplied by 16. The last column would be fine if shifted by one row down. \$\endgroup\$
    – Bruno
    Commented Jun 17 at 8:30
  • 2
    \$\begingroup\$ @Bruno, well, except that the last column is also titled "DECIMAL" while it holds both decimal and hex numbers, so it could do some redoing even after possibly shifting the rows. (It'd seem to make more sense if it just listed 1, 16, 256, dropping everything after the x from each row, then the numbers would actually be on the right rows, too) \$\endgroup\$
    – ilkkachu
    Commented Jun 17 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.