The binary numbering system chart maps base-10 integers to base-2 (binary) and base-16 (hexadecimal) formats, serving as the foundational lookup for microcontroller register manipulation, digital logic states, and bitwise operations. While software engineers memorize these conversions, hardware makers and electrical technicians rely on this chart to decode I2C addresses, set GPIO pin masks, and troubleshoot logic analyzer traces. Below is the complete, bookmark-friendly reference for the most critical byte boundaries and nibble masks used in embedded systems.
The Core Binary Numbering System Chart (Complete 4-Bit Nibble Lookup)
How to read this table: This chart provides the complete 16-row sequence for a 4-bit nibble (0–15), which is the fundamental building block for hexadecimal conversion. The Decimal column is your human-readable base value. The Hex column is the shorthand used in C/C++ firmware (prefixed with 0x). The Binary (4-bit) column shows the raw logic states, while the Padded 8-Bit column shows how that nibble sits in the lower half of a standard microcontroller byte (like an ATmega328P PORT register). Standard base-2 arithmetic follows the mathematical conventions outlined in All About Circuits Digital Volume and ISO/IEC 80000-2.
| Decimal | Hex | Binary (4-bit) | Padded 8-Bit | Common Embedded Use Case |
|---|---|---|---|---|
| 0 | 0x0 | 0000 | 0000 0000 | Logic LOW / Clear all bits / I2C ACK |
| 1 | 0x1 | 0001 | 0000 0001 | Bit 0 set / LSB / Single GPIO HIGH |
| 2 | 0x2 | 0010 | 0000 0010 | Bit 1 set / I2C Read Bit |
| 3 | 0x3 | 0011 | 0000 0011 | Lower 2 bits set / UART Stop Bits |
| 4 | 0x4 | 0100 | 0000 0100 | Bit 2 set / SPI MISO line |
| 5 | 0x5 | 0101 | 0000 0101 | Alternating bits / 555 Timer Astable |
| 6 | 0x6 | 0110 | 0000 0110 | Bits 1-2 set / I2C Standard Mode |
| 7 | 0x7 | 0111 | 0000 0111 | Lower 3 bits set / 3-bit DAC max |
| 8 | 0x8 | 1000 | 0000 1000 | Bit 3 set / MSB of lower nibble |
| 9 | 0x9 | 1001 | 0000 1001 | Outer bits set / BCD digit 9 |
| 10 | 0xA | 1010 | 0000 1010 | Alternating bits / Hex A |
| 0xB | 0xB | 1011 | 0000 1011 | Hex B / 4-bit LCD command |
| 12 | 0xC | 1100 | 0000 1100 | Upper 2 bits of nibble / Hex C |
| 13 | 0xD | 1101 | 0000 1101 | Hex D / Stepper motor winding seq |
| 14 | 0xE | 1110 | 0000 1110 | Hex E / Clear LSB only |
| 15 | 0xF | 1111 | 0000 1111 | Lower nibble mask (0x0F) / Max 4-bit |
Which Column Applies to Your Firmware or Logic Circuit?
Knowing which column to use depends entirely on your installation environment and the specific peripheral you are addressing. Makers often default to decimal because it is what the Arduino digitalWrite() function expects for pin numbers, but decimal is virtually useless for register manipulation.
Use the Hex Column for I2C, SPI, and Memory:
When configuring an ESP32 to talk to an OLED display over I2C, you will use hex addresses (e.g., 0x3C or 0x3D). Hexadecimal directly maps to physical memory addresses and peripheral registers. If you are writing a driver for a sensor, the Espressif GPIO API documentation relies heavily on hex masks to configure pin direction and pull-up states simultaneously.
Use the Binary Column for Bitwise Masking:
When you need to flip a single bit in a hardware register without disturbing the others (e.g., setting the baud rate on a UART peripheral), you use the binary column to create a mask. To set Bit 3 HIGH, you use the binary 0000 1000 (Decimal 8, Hex 0x08) combined with a bitwise OR operator (|). To clear it, you invert that mask using a bitwise AND (&).
Use the Decimal Column for Human-Readable I/O: Decimal is reserved for PWM duty cycles (0–255 on an 8-bit timer), analog sensor readings, and pin assignments. If you are sizing a current-limiting resistor for an LED based on an analogRead() value, stick to decimal math.
How Logic Thresholds and Bit-Shifting Derate Base Values
In wire sizing charts, 'derating' rows reduce the base ampacity based on ambient temperature or conduit fill. In digital logic and binary math, your 'base value' (the ideal mathematical 1 or 0) is similarly derated by two physical and logical realities: voltage logic thresholds and bitwise overflow.
Voltage Threshold Derating (VIH and VIL): A binary '1' is not a universal voltage. According to JEDEC standards for CMOS logic, a microcontroller interprets a binary '1' based on its VCC (supply voltage). For a 5V Arduino Uno (ATmega328P), the Input High Voltage (VIH) threshold is typically 0.6 × VCC, meaning any signal below 3.0V might be derated to a binary '0' or, worse, cause undefined oscillation. For a 3.3V ESP32, the VIH drops to roughly 2.3V. If you are interfacing a 5V sensor to a 3.3V microcontroller without a logic level converter, the sensor's 'LOW' output (which might sit at 0.8V) could exceed the ESP32's Input Low Voltage (VIL) maximum, resulting in a phantom binary '1'. Always check the datasheet's VIH/VIL rows to see how your physical voltage derates your logical binary state.
Bit-Shifting and Overflow Derating:
When you manipulate binary values in code using left-shift (<<) or right-shift (>>) operators, you are mathematically multiplying or dividing by powers of two. However, if you left-shift a value past the 8-bit boundary (255), the value overflows and wraps around to 0. This is the binary equivalent of exceeding a component's maximum rating. If you are using signed 8-bit integers (which range from -128 to +127), pushing a value past 127 derates it instantly to -128 due to two's complement wrap-around. Always declare your variables as uint8_t (unsigned) when working with raw binary bitmasks to prevent signed overflow derating.
What This Chart Cannot Tell You: Endianness and Signed Math
While the binary numbering system chart perfectly defines the value of a single byte or nibble, it is completely blind to how multiple bytes are assembled in memory. This is where embedded developers encounter the most frustrating bugs.
Endianness (Byte Order):
If your logic analyzer captures a 16-bit value like 0x1234, the chart tells you that 0x12 is 0001 0010 and 0x34 is 0011 0100. But it cannot tell you which byte arrives first on the wire. In Big-Endian systems (like standard network packets or I2C protocols), the Most Significant Byte (0x12) is transmitted first. In Little-Endian systems (like ARM Cortex-M processors and AVR microcontrollers), the Least Significant Byte (0x34) is stored at the lower memory address. If you read a 16-bit temperature sensor over I2C and map it directly to a Little-Endian memory pointer without swapping the bytes, your binary chart won't save you from reading a wildly incorrect temperature.
Floating-Point Representation (IEEE 754):
This chart applies strictly to integers. If you attempt to view a 32-bit floating-point number (like 3.14) in binary using a logic analyzer, you will not see the integer '3' followed by a decimal representation. Instead, the hardware uses the IEEE 754 standard, which splits the 32 bits into a sign bit, an 8-bit exponent, and a 23-bit mantissa. To decode floating-point binary traces, you must use an IEEE 754 hex-to-float converter, as standard binary-to-decimal lookup charts will yield meaningless integers.






