Member-only story

Exploring Different Number Bases With a Hexadecimal Display

What the FFFFFF?

--

My Hexadecimal display is a Raspberry Pi Pico W project which uses Neopixel RGB LEDs and Micropython to show what actually happens when you count.

Purpose and design choices

There were three main aims for this project:

  • Build a display using addressable LEDs (NeoPixels) to demonstrate what happens when counting in different number bases.
  • Bring 6-digit hexadecimal colour codes to life so the colour for a given hex code is bounced off the wall.
  • Use a Raspberry Pi Pico W to host a small web server that would control the display and allow for user supplied data to affect what is displayed.

Alternatives to ten

We live in a decimal world where we count and represent numbers with the digits 0 to 9. We understand the digits to mean different things depending on where they are placed. So in the number 1849 we know that the digit 1 means 1000, the 8 means 800, the 4 means 40 and the 9 means 9 ones. As soon as we count to 9 in any place we’ve run out of room and need the next column. This is called base 10 as there are 10 digits.

Animation of counting to 42 in base 10
Counting to 42 in base ten

Each column is worth 10 times more than the column that came before; we have place values that increase by powers of 10.

Representing number like this feels normal, like a law of nature. Charles Petzold explains this feeling well in his book ‘Code: The hidden language of computer hardware and software’:

Ten is an exceptionally important number to us humans. Ten is the number of fingers and toes most of us have, and we certainly prefer to have all ten of each. Because our fingers are convenient for counting, we humans have adopted an entire number system that’s based on the number 10.

If we were cartoon characters with 8 fingers then we would run out of symbols for each digit after 7 and would count like this: 1, 2…

--

--

Russell Eveleigh
Russell Eveleigh

Written by Russell Eveleigh

A school teacher and family man in the UK who likes tinkering with code and who sometimes tries to write good.

Responses (7)

Write a response