Direct Answer: When converting the standard 8-bit binary sequence 11010110 to denary (base-10), the exact answer is 214 (assuming an unsigned integer) or -42 (assuming a signed 8-bit two's complement integer).

Unlike AC power conversions—where voltage (120V vs 230V), power factor, and phase angle dictate the final wattage—converting binary to denary is a pure mathematical operation fixed entirely by digital assumptions: bit-width, signed/unsigned formatting, and endianness. If you are pulling raw hex or binary registers off an I2C sensor or debugging a microcontroller memory dump, knowing exactly how those bits map to base-10 is the difference between a working prototype and hours of chasing ghost bugs.

The Core Formula and Worked Example

The fundamental formula for converting an n-bit binary number to denary (D) is the sum of each bit (b) multiplied by 2 raised to the power of its positional index (i), starting from 0 on the far right (Least Significant Bit).

Formula:
D = (bn-1 × 2n-1) + ... + (b1 × 21) + (b0 × 20)

Substituting our 8-bit hero value (11010110):

  • Bit 7 (1): 1 × 27 = 128
  • Bit 6 (1): 1 × 26 = 64
  • Bit 5 (0): 0 × 25 = 0
  • Bit 4 (1): 1 × 24 = 16
  • Bit 3 (0): 0 × 23 = 0
  • Bit 2 (1): 1 × 22 = 4
  • Bit 1 (1): 1 × 21 = 2
  • Bit 0 (0): 0 × 20 = 0

Sum: 128 + 64 + 16 + 4 + 2 = 214.

Neighboring Values Reference Table (±20% Range)

When tuning PWM registers or DAC outputs, you rarely need just one value. Here is a spec-sheet-table of denary values bracketing our target (214) by roughly 20%, showing how the binary shifts as the base-10 number climbs.

Denary (Base-10)8-Bit BinaryHexadecimalCommon Use Case
175101011110xAF~68% PWM duty cycle
192110000000xC0Subnet mask octet (255.255.192.0)
214110101100xD6Target Value (~84% duty)
235111010110xEBHigh-threshold comparator trigger
255111111110xFF100% PWM / Max 8-bit unsigned

How Architecture Shifts the Denary Result (8-bit vs 16-bit vs 32-bit)

In AC theory, a calculation shifts drastically if you move from a 120V single-phase to a 230V or 400V 3-phase system. In digital logic, the equivalent architectural shift is moving between 8-bit, 16-bit, and 32-bit registers, and whether the system treats the data as signed or unsigned.

Let's look at how the denary answer for our raw byte 11010110 shifts depending on the microcontroller architecture reading it:

  • 8-Bit Unsigned (e.g., Arduino Uno ATmega328P uint8_t): The answer is firmly 214. The MSB (Most Significant Bit) is just another value bit.
  • 8-Bit Signed (Two's Complement): Because the MSB is 1, the number is negative. The formula shifts to D = -27 + (sum of remaining bits). Result: -128 + 86 = -42. (See the NIST Dictionary of Algorithms for the exact two's complement definition).
  • 16-Bit Little-Endian (e.g., reading a 16-bit ADC over I2C): If 11010110 is the low byte and the high byte is 00000001, the 16-bit binary is 00000001 11010110. The denary answer shifts to 470.
  • 32-Bit Sign-Extended (e.g., ESP32 32-bit registers): If an 8-bit signed value (-42) is cast to a 32-bit signed integer (int32_t) on an ESP32, the system pads the left side with 1s to preserve the negative sign: 11111111 11111111 11111111 11010110. The denary answer remains -42, but the binary footprint quadruples.

When Binary-to-Denary Conversion is Meaningless

Just as calculating real power (Watts) is meaningless if you don't know the power factor (PF) of an inductive load, converting raw binary to a simple denary integer is meaningless if the data format isn't a standard integer. You will get a mathematically correct number that is practically useless in the following scenarios:

  1. IEEE 754 Floating-Point Data: If your 32-bit binary sequence represents a float, standard positional addition fails. For example, the 32-bit binary for Pi (01000000 01001001 00001111 11011011) evaluates to 1,078,525,915 if treated as a standard unsigned integer, but it actually represents 3.14159 under the IEEE 754 standard. You must use a memory cast (like a C++ union or memcpy) to read it as a float.
  2. Binary-Coded Decimal (BCD): Many real-time clock (RTC) modules, like the ubiquitous DS3231, store time in BCD. In BCD, each 4-bit nibble represents a single denary digit (0-9). The binary 1001 0110 converts to 150 in pure math, but in BCD, it means 96 (e.g., 96 seconds/minutes). Treating BCD as pure binary will cause your clock logic to skip numbers and crash.
  3. ASCII / UTF-8 Text Strings: If you read 01000001 off a UART serial buffer, the denary value is 65. But in the context of the serial stream, it is the ASCII character 'A'. Converting it to 65 and trying to do math on it will corrupt your text parsing.

Frequently Asked Questions (FAQ)

How do I convert a binary string to denary in Arduino or ESP32 C++?

Do not write a custom for loop to parse string characters. Use the standard C library function strtol(). It is highly optimized and handles the base conversion natively.
const char* binStr = "11010110";
long denaryValue = strtol(binStr, NULL, 2); // The '2' specifies base-2
This safely outputs 214 and prevents buffer overflow errors common in manual parsing.

How do I handle binary fractions (radix point) in denary?

If your binary number has a radix point (e.g., 101.11), the bits to the right of the point use negative exponents. The first bit right of the point is 2-1 (0.5), the second is 2-2 (0.25), and so on. For 101.11:
(1 × 4) + (0 × 2) + (1 × 1) + (1 × 0.5) + (1 × 0.25) = 5.75. This is heavily used in fixed-point DSP (Digital Signal Processing) math on microcontrollers lacking hardware floating-point units.

Why does my 8-bit binary conversion give a negative denary number when I expect a positive one?

You are experiencing two's complement overflow. In an 8-bit signed integer (int8_t), the maximum positive value is 127 (01111111). If your sensor outputs a raw value of 128 (10000000), a signed variable interprets the leading 1 as a negative sign, yielding -128. To fix this, declare your variable as an unsigned 8-bit integer (uint8_t in Arduino/ESP32), which shifts the range from [-128 to 127] to [0 to 255].

What is the denary value of a 4-bit binary number?

A 4-bit binary number (a single nibble) has 16 possible states, ranging from 0000 to 1111. In denary, this maps to a range of 0 to 15. This is why a single hexadecimal character (0-F) perfectly maps to one 4-bit nibble, making hex the preferred shorthand for binary in embedded systems debugging.