
Convert hexadecimal to binary in your head - QuadrupleA
http://lukerissacher.com/hexquiz
======
svachalek
I learned programming on a TI-99/4A which required you to enter graphics as
bitmaps in hex. I've never lost the ability to "see" hex numbers as binary.

I don't know if there's still a use for such a skill, but if you care, I
learned it as a set of 8 pairs: first, 0 and F are easy, right? 9 and 6 are
1001 and 0110, and a 9 looks like an upside-down 6 so hopefully you can
remember that pair.

That leaves 12 digits, and they come in mirror-image pairs: 1/8, 2/4, 3/C,
5/A, 7/E, B/D. You know which hex digit is larger, and the larger binary is
heavier on the left side, e.g. D is 1101 and B is 1011.

~~~
jasonmoo
This is great! Here's a demo of the full set to illustrate your point more
fully.

[http://play.golang.org/p/T1eJ4prBHM](http://play.golang.org/p/T1eJ4prBHM)

~~~
username3
Missing 9 and 6.

mirror pairs

(1) 0001/1000 (8)

(2) 0010/0100 (4)

(3) 0011/1100 (C)

(5) 0101/1010 (A)

(7) 0111/1110 (E)

(B) 1011/1101 (D)

(0) 0000/1111 (F)

Program exited.

------
ksenzee
Flippy Bit is another great way to practice this:
[http://flippybitandtheattackofthehexadecimalsfrombase16.com/](http://flippybitandtheattackofthehexadecimalsfrombase16.com/)

~~~
shmerl
Thanks :)

------
tdeck
All this talk about mental-math base conversions reminded me of the "double-
dabble" algorithm, which lets you quickly convert binary to decimal in your
head.

> In the 1960s, the term double dabble was also used for a different mental
> algorithm, used by programmers to convert a binary number to decimal. It is
> performed by reading the binary number from left to right, doubling if the
> next bit is zero, and doubling and adding one if the next bit is one.[4] In
> the example above, 11110011, the thought process would be: "one, three,
> seven, fifteen, thirty, sixty, one hundred twenty-one, two hundred forty-
> three," the same result as that obtained above.

[https://en.wikipedia.org/wiki/Double_dabble#Historical](https://en.wikipedia.org/wiki/Double_dabble#Historical)

~~~
pklausler
It's faster to just see 0xf3 and then compute 256 - 13.

------
tbabb
Cool. Many languages allow 0b11110000 style notation, though. If that's
available, it's much preferable to hex when the bit arrangement matters. One
should not ever force the reader to do the mental work of this quiz if it can
be helped.

------
hrrld
I giggled at `A/10` ... Thank you for that.

------
shmerl
[http://games.usvsth3m.com/binary/](http://games.usvsth3m.com/binary/)

UPDATE: seems like the game is broken now. It used to work and it was quite
fun.

~~~
raphman_
The archive.org version still works [1]. Thank you for the recommendation!

[1]
[https://web.archive.org/web/20150101030559/http://games.usvs...](https://web.archive.org/web/20150101030559/http://games.usvsth3m.com/binary)

~~~
shmerl
Ah, thanks for the pointer. Good to have Wayback machine around :)

------
agilo
If you're looking for an android app helping you master base conversions:
[https://play.google.com/store/apps/details?id=me.akeel.baseg...](https://play.google.com/store/apps/details?id=me.akeel.basegame&hl=en)

Free version:
[https://play.google.com/store/apps/details?id=me.akeel.baseg...](https://play.google.com/store/apps/details?id=me.akeel.basegamefree&hl=en)

------
Theodores
I do find it shocking that 'kids today' really do not appreciate knowing a
little bit of 'hex' and how that relates to 1's and 0's. Numbers like 384, 768
and other common multiples should be understood as computationally
significant. Same with numbers like 255, 16383 and so forth - people who work
with code should mentally have an image of lots of '1's with these numbers,
but they don't. One should not have to explain this stuff except to people,
and, this article kind of sums that up, there are a lot of people out there
that just were not brought up on the cusp of 8/16 bit computing!!!

For me this has been the case with images in particular. Why have some
Photoshop operative spend all day cropping images to (say) 2000 pixels square
when you could have Imagemagick just do all of them to 2048 pixels square in a
lot less time than it takes to have a cup of tea?

Many, many micro-managers prefer the former option, thinking that the
Photoshop operative will not have the ability to type '2048' on their Wacom
tablet. Sure, those images are not going to be OpenGL rendered but they might
be shown on a web page with OpenSeaDragon (what?) and those 8x8 pixel tiles in
the JPEG will survive making the thumbnails better. What is not to like? Why
go for the computing equivalent of 'imperial measurements'???

The odd thing about these scenarios is that these micro-manager types get hung
up on things like image dimensions whereas programmers just let the computer
do the work, to 'abstract out' those little details and let the code do it.

~~~
bschwindHN
What are you even ranting about? Plenty of 'kids today' appreciate knowing a
bit of hex. Are we talking about programmers, "micro-managers", or "Photoshop
operatives"? Most programmers today are familiar with hex. But if you're
expecting managers or Photoshop operatives to be able to convert hex to binary
in their head, then I feel you have the wrong expectations.

~~~
goldenkey
The photoshop operatives are following me.... They want my lucky charms (hex
digits!)

------
netaustin
This reminds me of a patience game I play. I count to 32 on one hand, with
each finger representing a bit. If I'm doing it repeatedly, I'll count in my
head in binary, octal, decimal, and hexadecimal. Works wonders when waiting
for the subway or rocking a screaming baby.

~~~
jquast
Have you ever considered this might be compulsive behavior?

