To convert the decimal fraction 0.625 to binary, the exact answer is 0.101. If you are working with a repeating fraction like 0.3, the exact mathematical answer is an infinitely repeating sequence (0.0100110011...), which forces you to truncate based on your hardware's bit-width. The foundational formula used is the 'Multiply by 2' method. Substituting our target value: 0.625 × 2 = 1.25 (record 1, carry 0.25); 0.25 × 2 = 0.5 (record 0, carry 0.5); 0.5 × 2 = 1.0 (record 1, carry 0). Reading the recorded integers top-to-bottom yields 0.101.

Quick Answer: Decimal 0.625 = Binary 0.101 (Exact) | Decimal 0.3 = Binary 0.01001100... (Repeating, requires truncation)

The Conversion Formula and Step-by-Step Execution

Converting the integer portion of a decimal number to binary relies on repeated division by 2. Converting the fractional portion requires the inverse: repeated multiplication by 2. This is formally known as the Radix-2 fractional conversion algorithm.

Here is the exact step-by-step execution for 0.6875 to demonstrate a slightly longer sequence:

  1. Step 1: Multiply 0.6875 by 2. Result is 1.375. The integer part is 1. Carry over the fractional part (0.375).
  2. Step 2: Multiply 0.375 by 2. Result is 0.75. The integer part is 0. Carry over 0.75.
  3. Step 3: Multiply 0.75 by 2. Result is 1.5. The integer part is 1. Carry over 0.5.
  4. Step 4: Multiply 0.5 by 2. Result is 1.0. The integer part is 1. The fractional part is now 0, so the process terminates.

Reading the integer parts from first to last (top to bottom) gives the binary fraction: 0.1011.

Bench Tip: When writing this binary fraction into an 8-bit microcontroller register (like an ATmega328P on an Arduino Uno), you must left-align or right-align the bits depending on your DAC (Digital-to-Analog Converter) hardware spec. A left-aligned 0.1011 in an 8-bit register is written as 10110000 (0xB0), while right-aligned it is 00001011 (0x0B). Always check the datasheet's MSB/LSB justification requirement.

Neighboring Values Reference Table (±20% Range)

When calibrating sensors or tuning PID loops, you rarely hit an exact terminating fraction. Below is a reference table for values within a ±20% range of our 0.625 baseline (spanning 0.500 to 0.750). Because microcontrollers cannot store infinite repeating fractions, these are truncated to an 8-bit fixed-point format (where the binary point is assumed to be at the far left).

Decimal FractionExact Binary Math8-Bit Truncated (Hex)Quantization Error
0.5000.100000000x800.000%
0.5500.10001100...0x8C+0.078%
0.6000.10011001...0x99-0.146%
0.6250.101000000xA00.000%
0.6500.10100110...0xA6-0.061%
0.7000.10110011...0xB3-0.055%
0.7500.110000000xC00.000%

What Assumptions Fix Your Binary Answer?

In AC power theory, assumptions like voltage, power factor (pf), and phase fix your real power answer, and the math shifts drastically for 120V vs 230V vs 3-phase systems. For example, converting a fractional multiplier (like 0.625 of peak voltage) into a physical measurement shifts based on the grid: a 120V RMS system (169V peak) yields 105.6V, whereas a 230V RMS system (325V peak) yields 203.1V, and a 3-phase system requires tracking three distinct phase-shifted fractional arrays simultaneously.

However, when you convert decimal fractions to binary for digital logic and embedded systems, the equivalent assumptions that fix your answer are bit-width, data format, and reference voltage (VREF).

  • 8-bit ADC (0-5V VREF): A fraction like 0.625 maps to an integer value of 159 (out of 255). The binary answer is strictly bound to 8 bits: 10011111.
  • 12-bit ADC (0-3.3V VREF, e.g., ESP32): The same 0.625 fraction of the 3.3V range yields 2.0625V. The 12-bit binary integer mapping is 101000000000 (2560 out of 4095).
  • 32-bit IEEE 754 Float: The fraction is stored as a sign bit, 8-bit exponent, and 23-bit mantissa. 0.625 is perfectly representable without quantization error as 0x3F200000.

When is the conversion meaningless? The conversion becomes mathematically and practically meaningless if you attempt to map an irrational number (like the fractional part of π, 0.14159...) or a repeating decimal (like 0.1) into a fixed-point binary register without defining a truncation or rounding rule. Without a defined bit-width limit and a rounding mode (e.g., round-half-up vs. round-to-even), the binary sequence is infinite and cannot be committed to physical silicon memory. Furthermore, if your ADC's VREF is unknown or floating, converting a physical voltage fraction into a binary register value is impossible, as the LSB (Least Significant Bit) weight is undefined.

Embedded Systems Decision Path: Which Format to Pick?

When programming microcontrollers (like an Arduino Nano or ESP32-WROOM-32), you must decide how to store and compute your binary fractions. Use this decision tree to select the correct data type and math library.

Condition / ConstraintRecommended FormatConcrete Implementation Pick
If you need maximum speed on an 8-bit MCU (no hardware FPU) and your fraction range is strictly 0.0 to 0.999...8-bit Fixed-Point (Q8)Use uint8_t where 1 LSB = 1/256 (0.0039). Multiply by 255 to encode, shift right by 8 to decode.
If you are doing audio DSP or motor control (FOC) on a 32-bit MCU (e.g., STM32, ESP32) and need high precision without float overhead...16-bit or 32-bit Fixed-Point (Q15 / Q31)Use the Arduino CMSIS-DSP library q15_t or q31_t types. 1 LSB = 1/32768.
If your application involves complex physics, GPS coordinates, or varying magnitudes where fixed-point scaling is too rigid...32-bit Floating Point (IEEE 754)Use standard float in C/C++. Ensure your MCU has a hardware FPU (ESP32 has one, ATmega328P does not) to avoid massive cycle penalties.
If you are transmitting fractional sensor data over I2C/SPI to a DAC...Hardware-Mapped IntegerScale the fraction to the DAC's exact bit-depth (e.g., multiply by 4095 for a 12-bit MCP4725) and send as a standard uint16_t.

Frequently Asked Questions

Why does 0.1 in decimal become a repeating fraction in binary?
Just as 1/3 becomes 0.333... in base-10 because 3 is not a factor of 10, the decimal 0.1 (which is 1/10) becomes a repeating fraction in base-2 because 10 has a prime factor of 5, which is not a factor of 2. In binary, 0.1 is 0.0001100110011.... This is why 0.1 + 0.2 == 0.3 often evaluates to false in standard floating-point C++ code on embedded systems.

How do I convert a mixed number like 5.625 to binary?
Split the number into integer and fractional parts. Convert the integer (5) using repeated division by 2 to get 101. Convert the fraction (0.625) using the repeated multiplication method to get 0.101. Combine them with a binary point: 101.101.

What is the 'Multiply by 2' method called in computer science literature?
It is formally referred to as the 'Radix-2 Fractional Conversion Algorithm' or the 'Successive Multiplication Method'. For hardware implementations, a similar iterative approach is used in Successive Approximation Register (SAR) ADCs to physically generate these binary bits from analog voltages in real-time. For deeper reading on ADC architectures, refer to Texas Instruments' application notes on SAR ADC basics.