To convert decimal fraction to binary, we use the successive multiplication-by-2 method. For the exact query benchmark of 0.625, the direct binary conversion is 0.101. The formula substitutes the fractional part sequentially: 0.625 × 2 = 1.25 (record the integer 1), 0.25 × 2 = 0.5 (record 0), and 0.5 × 2 = 1.0 (record 1). Unlike AC power calculations where assumptions like 120V vs 230V, 3-phase topology, or power factor (PF) dictate the real-world outcome, pure binary conversion assumes a fixed bit-depth precision. If you are mapping this 0.625 fraction to an 8-bit Analog-to-Digital Converter (ADC) reading a 5V reference, 0.625 of full scale is exactly 10100000 (160 in decimal, or 0xA0 in hex).

The Core Formula and Neighboring Values

The manual conversion process is straightforward for terminating fractions. You multiply the decimal fraction by 2. If the result is 1 or greater, you write down a '1' and carry the remainder. If it is less than 1, you write down a '0' and carry the whole result. You repeat this until the fractional part reaches zero or you hit your target bit-depth limit.

Below is a quick-reference table showing the target value (0.625) alongside its neighboring values within a ±20% range. This is particularly useful when calibrating analog sensors where slight voltage drops shift your expected binary output.

Decimal Fraction Binary Fraction Percentage of Full Scale 8-Bit ADC Value (0-255)
0.500 0.1000 50.0% 128 (0x80)
0.5625 0.1001 56.25% 144 (0x90)
0.625 0.1010 62.5% 160 (0xA0)
0.6875 0.1011 68.75% 176 (0xB0)
0.750 0.1100 75.0% 192 (0xC0)

When working with microcontrollers like the Arduino Uno (10-bit ADC) or the ESP32 (12-bit ADC), your binary output scales non-linearly with bit depth. Here is a data-dense mapping table for the 0.625 fraction across standard embedded resolutions:

Target Fraction 8-Bit (0-255) 10-Bit (0-1023) 12-Bit (0-4095) 16-Bit (0-65535)
0.625 160 639 2559 40959
Hex Equivalent 0xA0 0x27F 0x9FF 0x9FFF
Binary (Raw) 10100000 1001111111 100111111111 1001111111111111

Assumptions That Fix the Answer: Bit-Depth vs. AC Power Parameters

A common point of confusion for electrical hobbyists bridging AC mains and digital logic is understanding which variables lock in your final numbers. Let's break down the assumptions that fix the answer.

What assumption fixes the answer (voltage, pf, phase)?
In AC power systems, Power Factor (PF) and phase angle fix the real power fraction. In digital logic and ADC scaling, voltage and phase are irrelevant to the math itself. The assumption that fixes the binary answer is bit-depth (resolution) and the ADC Reference Voltage ($V_{ref}$). If your ESP32's $V_{ref}$ is 3.3V, a 2.0625V input yields the 0.625 binary fraction. If $V_{ref}$ drifts to 3.1V due to a poor onboard regulator, that same 2.0625V input now represents a 0.665 fraction, shifting your binary output entirely.

How the answer shifts for 120V vs 230V vs 3-phase?
The pure mathematical binary fraction (0.101) does not shift based on mains voltage. However, when converting a physical AC voltage fraction to binary via an ADC, the analog front-end scaling must shift drastically. A 120V RMS line (170V peak) requires a specific voltage divider to map safely to a 3.3V microcontroller pin. A 230V RMS line (325V peak) or a 3-phase 480V system requires much higher divider ratios and galvanic isolation (such as the ZMPT101B voltage transformer module). The binary output shifts in your code because the hardware scaling ratio changes to prevent frying your GPIO pins.

When is the conversion meaningless?
Converting an AC load's power fraction to a binary PWM control variable is meaningless if the power factor (PF) is unknown. Without PF, you only have apparent power (VA); any binary duty-cycle calculation for real-power (Watts) delivery will be fundamentally flawed. Similarly, in embedded systems, digitizing an analog sensor reading to binary is meaningless if the ADC's $V_{ref}$ is floating, uncalibrated, or if you are sampling below the Nyquist frequency.

Resolution Scaling: Shifting from 8-Bit to 32-Bit Float

When you move from raw integer ADC readings to floating-point math in your C++ or MicroPython code, you are relying on the IEEE 754 Standard for Floating-Point Arithmetic. This standard dictates how fractional binaries are stored in memory. While 0.625 is a neat, terminating fraction in binary (0.101), many common decimal fractions are not.

Decimal Fraction Binary Representation Terminating? IEEE 754 (32-bit) Hex
0.5 0.1 Yes 0x3F000000
0.625 0.101 Yes 0x3F200000
0.1 0.0001100110011... No (Repeating) 0x3DCCCCCD
0.2 0.0011001100110... No (Repeating) 0x3E4CCCCD

Maker Warning: Because 0.1 and 0.2 are repeating fractions in binary, comparing floats directly in Arduino code (e.g., if (sensorVal == 0.1)) will often fail due to rounding errors at the 7th decimal place. Always use an epsilon threshold: if (abs(sensorVal - 0.1) < 0.0001).

Frequently Asked Questions

Why does my ESP32 ADC return erratic binary fractions near 0V and 3.3V?
The ESP32's internal ADC (specifically on the original WROOM modules) is notoriously non-linear at the extreme ends of its range. Readings below 100mV and above 3.1V will not map to clean binary fractions. If your project requires precise fractional conversion across the entire 0-3.3V spectrum, bypass the internal ADC and use an external I2C ADC like the ADS1115 (16-bit).

How do I handle repeating binary fractions in limited memory?
If you are programming an 8-bit AVR (like the ATmega328P in an Arduino Uno), avoid floating-point math entirely. Instead of converting a decimal fraction to a float, scale your math to integers. To represent 0.625, multiply your sensor reading by 625, then divide by 1000 using uint16_t variables. This prevents the repeating binary fraction memory bloat and speeds up execution time.

Does endianness affect how my binary fraction is transmitted over UART?
Endianness (byte order) only matters when transmitting multi-byte integers or IEEE 754 floats over serial protocols like UART, SPI, or I2C. The mathematical binary fraction itself is universal. However, if you send a 32-bit float representing 0.625 (0x3F200000) from a little-endian ESP32 to a big-endian display controller, the receiving device will read the bytes in reverse, resulting in garbage data unless you explicitly pack and unpack the bytes in your firmware.