Advertisement
Home›Topics›Floating-Point in Flip-Flops
SILICON ARCHITECTURE · DIGITAL ARITHMETIC

How Floating-Point Numbers Are Stored in Flip-Flops
(And Where Does the Dot Go?)

By EcrioniX Research · 02 Oct 2026 · ~8 min read

Every digital hardware engineer knows this fundamental physical truth: a D Flip-Flop can only hold one of two states — 0 (ground, 0V) or 1 (supply voltage, 1.2V). There is no "half-voltage", no comma, and certainly no physical "dot" character stamped into silicon. So when your CPU processes 3.14159, where is the decimal point stored?

🤯 The Short Answer

The decimal point is nowhere in silicon. It is not stored in any flip-flop. Instead, it is phantom (implied). The hardware architecture agrees that a virtual dot sits permanently between an invisible "1" and the mantissa bits, and uses a dedicated digital gearbox — the Exponent and a Barrel Shifter — to slide the real-world dot left or right during calculations.

🔬 Interactive 32-Flip-Flop IEEE 754 Inspector
STANDARD SINGLE PRECISION (FLOAT32)
Enter Number:
13.625 (Classic) -6.75 (Negative) 0.1 (Repeating!) π (3.14159) 0.0 (Zero)
Physical D-Flip-Flop Standard Cell Row (32 Bits) 0x415A0000
Bit 31: Sign (1 FF)
Bits 30..23: Biased Exponent (8 FFs)
Bits 22..0: Fraction / Mantissa (23 FFs)
📍
Where is the Dot right now?
Notice that none of the 32 flip-flops store a dot! The ALU knows the mathematical value is 1.101101 × 23. The dot sits permanently to the right of the invisible hidden '1', and the exponent (+3) tells the hardware barrel shifter to move the point 3 places right in binary.

1. Two Ways Silicon Handles Fractions

To understand why floating-point is designed this way, you must understand the two ways digital chips represent non-integers:

1. FIXED-POINT (Q-FORMAT) The "Imaginary Dot" Approach 0 0 1 0 1 0 0 0 ▲ Dot exists ONLY in engineer's mind! Hardware is identical to standard integer logic. 2. FLOATING-POINT (IEEE 754) The "Dynamic Gearbox" Approach S EXP (8) MANTISSA (23) The Exponent slides the dot dynamically! Enables vast dynamic range: from 10&supmin;³&sup8; to 10³&sup8;.
Fixed-point fixes the dot at a hardwired wire boundary. Floating-point encodes the dot's position as an exponent number stored in flip-flops.

2. Inside the Silicon: 32 Physical D-Flip-Flops

In standard 32-bit single precision (IEEE 754), a chip places exactly 32 D-Flip-Flop cells in a row. Let's look at how the 32 transistors latch the information:

DFF Bit 31 0 SIGN 8 × DFF CELLS Bits 30 downto 23 1 0 0 0 0 0 1 0 BIASED EXPONENT (+127) 23 × DFF CELLS Bits 22 downto 0 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MANTISSA / FRACTION (F)
Every single bit is a physical circuit (master-slave transmission gates & inverters). None of them store a punctuation mark!

3. The Secret Trick: The "Invisible 1"

Engineers love efficiency. In the 1980s, when Professor William Kahan led the design of IEEE 754, he realized a brilliant trick:

In standard binary scientific notation, every non-zero number is written so that there is exactly one non-zero digit before the dot:

1.01101 × 23

In decimal, that leading digit could be 1, 2, 3... up to 9. But in binary, what digits exist? Only 0 and 1. Since the leading digit cannot be 0 (otherwise you haven't normalized it yet), IT IS ALWAYS 1!

💡 Free Precision: The "Hidden Bit"

Since the digit before the dot is guaranteed to be 1, why waste a physical flip-flop storing it? Hardware engineers simply throw it away in storage and wire it back in during arithmetic!

This is called the Implicit One (or Hidden Bit). Even though you only build 23 flip-flops in silicon, your hardware computes with 24 bits of precision!

Advertisement

4. Step-by-Step: Storing 13.625 in Flip-Flops

Let's manually convert the number +13.625 into hardware flip-flops, exactly as a compiler does:

  1. Convert Integer Part to Binary:
    \(13 = 8 + 4 + 1 = 1101_2\)
  2. Convert Fractional Part to Binary:
    \(0.625 = 0.5 + 0.125 = \frac{1}{2} + \frac{1}{8} = 0.101_2\)
  3. Combine Both:
    \(13.625 = 1101.101_2\)
  4. Normalize (Slide the Dot):
    Move the dot 3 positions to the left so only one "1" remains in front:
    \(1101.101_2 = \mathbf{1.101101} \times 2^{\mathbf{3}}\)
  5. Determine the Sign Bit:
    Positive number → Bit 31 = 0.
  6. Calculate Biased Exponent:
    The real exponent is \(+3\). Hardware uses a bias of \(+127\) (so exponents can be negative without needing a two's complement sign bit):
    \(E = 3 + 127 = 130_{10} = \mathbf{10000010_2}\) → Stored in Bits 30..23.
  7. Store the Mantissa (Drop the leading 1!):
    We discard the bold \(1.\) and store only what comes after the dot:
    \(\mathbf{101101}\) followed by seventeen zeros → Stored in Bits 22..0.

5. How the ALU Does Math Without a Dot: The Barrel Shifter

If there is no dot inside the flip-flops, how does a Floating Point Unit (FPU) add 13.625 + 0.5?

To add two numbers, their decimal points must line up. In hardware, this is accomplished by an ultra-fast combinational block called a Barrel Shifter:

13.625 (Exp = 3) 1.101101 × 2³ 0.5 (Exp = -1) 1.000000 × 2&supmin;¹ Δ Diff = 4 BARREL SHIFTER Shift right by 4 wires INTEGER ADD Dots now match!
Hardware alignment: The FPU subtracts the two exponents (3 - (-1) = 4), then uses a barrel shifter to route the smaller number's mantissa right by 4 wires before doing a regular integer addition!

Verilog Code: Restoring the Hidden Bit in RTL

// Inside an FPGA/ASIC Floating Point Unit:
// Restoring the hidden 1 before entering the adder
wire [31:0] float_a = 32'h415A0000; // 13.625

wire        sign_a  = float_a[31];
wire [7:0]  exp_a   = float_a[30:23];

// Concatenate the invisible 1.0 back onto the 23-bit mantissa!
wire [23:0] full_mantissa_a = (exp_a == 8'd0) ? 
                              {1'b0, float_a[22:0]} : // Denormal number
                              {1'b1, float_a[22:0]}; // Normalized: 1.F restored!

6. High-Yield Interview Q&A

Q: Why can't computers store 0.1 exactly in binary?

A: In base-10, fractions like 1/3 cannot be represented as finite decimals (0.33333...). Similarly, in base-2, the fraction 0.1 (1/10) cannot be represented as a finite sum of negative powers of 2 (\(1/2, 1/4, 1/8...\)). It becomes an infinitely repeating binary pattern: 0.00011001100110011.... Because the flip-flops run out after 23 bits, it must be rounded, causing tiny precision errors (e.g. 0.1 + 0.2 = 0.30000000000000004).

Q: What is a "Subnormal" or "Denormalized" number?

A: When a number is extremely close to zero, the exponent drops to all zeros (`00000000`). At this point, the hardware disables the "hidden 1" rule and assumes a leading `0.` instead. This allows numbers to gradually underflow to zero rather than abruptly snapping to zero (known as graceful underflow).

Q: When should an ASIC designer choose Fixed-Point over Floating-Point?

A: A 32-bit floating-point adder requires roughly 10× to 20× more logic gates and silicon area than a fixed-point integer adder due to barrel shifters, normalizers, and rounding logic. In high-speed DSP, audio codecs, and edge AI accelerators where dynamic range is predictable, engineers almost always prefer Fixed-Point to save power and die area.

Advertisement