When debugging an ESP32 GPIO register or parsing a raw byte from an I2C sensor, you need an immediate translation between Base-2 hardware states and Base-10 human logic. A chart of binary numbers maps discrete digital states (HIGH/LOW, 1/0) to their decimal and hexadecimal equivalents. While software engineers rely on IDE calculators, bench engineers and hardware hobbyists need these values memorized or pinned to their monitor to quickly spot bit-flips, mask errors, and sign-extension bugs on the oscilloscope.

The direct answer for the most common 4-bit nibble lookups is in the table below. For 8-bit, 16-bit, or 32-bit registers, you combine these nibbles. A binary 1010 1100 is simply the 1010 (Hex A) nibble shifted left by 4 bits, combined with 1100 (Hex C), yielding 0xAC (Decimal 172).

The Core Chart of Binary Numbers (Complete 4-Bit Nibble Standard)

The following table represents the complete foundational 4-bit nibble, governed by standard Two's Complement arithmetic and logic level definitions referenced in digital design standards like those published by All About Circuits and ANSI/IEEE logic standards.

How to read this table: The Binary column shows the raw bit pattern (MSB on the left, LSB on the right). The Decimal (Unsigned) column is your standard 0-15 count used for pin masks and positive sensor data. The Decimal (Signed) column applies Two's Complement, which is mandatory when reading negative temperatures or signed accelerometer axes. The Hex column is the shorthand used in C/C++ code (e.g., 0x0F). Use the quick-jump IDs to bookmark specific boundary rows.
Decimal (Unsigned) Binary (4-Bit) Hex Decimal (Signed / Two's Complement)
000000x00
100010x11
200100x22
300110x33
401000x44
501010x55
601100x66
701110x77
810000x8-8
910010x9-7
1010100xA-6
1110110xB-5
1211000xC-4
1311010xD-3
1411100xE-2
1511110xF-1

Which Column Applies to Your Hardware Installation?

In electrical wiring, you must choose the correct ampacity column based on your insulation temperature rating. In embedded systems, you must choose the correct binary column based on your microcontroller architecture and data type.

8-Bit Installations (Arduino Uno / AVR)

If you are manipulating direct port registers on an ATmega328P (like PORTD or PINB), you are working with 8-bit unsigned integers. You will exclusively use the Unsigned and Hex columns. For example, setting the top four pins HIGH and the bottom four LOW requires the binary 1111 0000. Looking at the chart, 1111 is 0xF and 0000 is 0x0, giving you the hex mask 0xF0 (Decimal 240). You would write PORTD = 0xF0; in your sketch.

32-Bit Installations (ESP32 / ARM Cortex)

The ESP32 Technical Reference Manual defines GPIO registers as 32-bit wide (e.g., GPIO_OUT_REG). If you are bit-shifting a 1 across a 32-bit register to toggle GPIO 27, the 4-bit chart still applies, but you are shifting it across eight nibbles. The Hex column becomes critical here, as counting 27 bits manually is error-prone. Hex 0x08000000 is instantly recognizable to a seasoned engineer as bit 27 set HIGH.

Signed Sensor Installations (I2C / SPI)

If you are reading the Z-axis from an MPU6050 accelerometer or a DS18B20 temperature sensor, the data is transmitted in Two's Complement. You must use the Decimal (Signed) column. If the sensor returns the byte 1111 1101, an unsigned read yields 253. But using the signed column logic, the MSB is 1 (indicating negative), and the two's complement of 1111 1101 is 0000 0011 (Decimal 3). The actual physical reading is -3.

How Data Modifiers and Bit-Shifting Alter the Base Value

In wire sizing charts, temperature and bundling derating rows modify the base current limit. In a binary chart, data-type modifiers, bit-shifting, and endianness act as the derating factors that modify the base decimal value.

  • Bit-Shifting (The Multiplier): Shifting a binary number left by one position (<< 1) multiplies the base decimal value by 2. Shifting 0001 (Decimal 1) left by 3 positions yields 1000 (Decimal 8). This is how microcontrollers handle fast multiplication without burning CPU cycles on math coprocessors.
  • Sign Extension (The Negative Derate): When casting an 8-bit signed integer to a 16-bit signed integer, the microcontroller performs sign extension. If your 8-bit value is 1000 0000 (-128), the 16-bit register doesn't just pad with zeros. It pads with ones: 1111 1111 1000 0000. If you fail to account for this modifier, your 16-bit unsigned read will incorrectly report 65408 instead of -128.
  • Endianness (Byte Order Swap): The ESP32 (Little-Endian) stores the least significant byte at the lowest memory address. If your chart lookup for a 16-bit value is 0x1234, the ESP32 will physically write 0x34 to the first memory register and 0x12 to the second. Big-Endian systems (like some network protocols or older Motorola chips) do the opposite. Always check your datasheet's endianness before parsing multi-byte SPI streams.

What the Chart Cannot Tell You

A chart of binary numbers is a mathematical abstraction. It cannot account for the physical realities of the silicon and copper on your workbench. Keep these limitations in mind when your code is correct but the hardware is failing:

  1. Logic Voltage Thresholds: The chart tells you that 1 is HIGH. It does not tell you what voltage constitutes a HIGH. On a 5V Arduino Uno (ATmega328P), a logic HIGH requires a minimum of 3.0V. On a 3.3V ESP32, a HIGH is typically anything above 2.3V. Feeding 5V into an ESP32 GPIO to achieve a '1' will destroy the silicon.
  2. Floating Pins: If a pin is unconnected, it is not a '0' or a '1'. It is floating, acting as an antenna picking up electromagnetic interference. The binary chart assumes defined states; your hardware requires pull-up or pull-down resistors to enforce them.
  3. Propagation Delay and Setup Times: When you flip a bit from 0 to 1 in a shift register (like a 74HC595), the physical output transistor takes nanoseconds to change state. If you clock the data too fast, you violate the setup/hold times, and the binary chart on your logic analyzer will show glitched, metastable states.

Frequently Asked Questions

How do I use a chart of binary numbers to read negative sensor values?

Look at the MSB (Most Significant Bit). If the MSB is 1, the number is negative in Two's Complement format. To find the decimal value, invert all the bits (change 1s to 0s and 0s to 1s), add 1 to the result, and apply a negative sign. For example, the 8-bit binary 1111 0110 inverted is 0000 1001 (Decimal 9). Add 1 to get 10. The final value is -10.

Why does my logic analyzer show inverted binary numbers compared to my code?

This is almost always a hardware configuration issue, not a math error. Many microcontrollers and sensors use active-low logic for chip select (CS) or reset lines. A '0' in your code physically drives the line HIGH (or allows it to be pulled HIGH), and a '1' drives it LOW. Additionally, check your logic analyzer's trigger edge; if you are sampling on the falling edge instead of the rising edge of the SPI clock, your captured binary bytes will appear bit-shifted or inverted.

What is the difference between a binary chart and a truth table?

A binary chart is a mathematical conversion tool mapping Base-2 numbers to Base-10/Base-16 values (e.g., 1010 = 10). A truth table maps logical inputs to logical outputs for a specific logic gate or Boolean function (e.g., Input A=1, Input B=0 yields Output=1 for an OR gate). You use a binary chart to decode data bytes; you use a truth table to design or debug combinational logic circuits.