Binary Architect

./cpu_data_viz

Back to Tools

Architecture & Data Representation

Visual tools to understand CPU logic. Toggle bits, see the flags (N, Z, C, V) light up, and decode Floats.
Updated: Includes ADD/SUB operations for flag analysis.

Input A
Input B
Result
Negative N
Zero Z
Carry C
Overflow V

The 4 Flags (NZCV)

  • N (Negative): 1 if the result is negative (MSB is 1). Used for signed comparison.
  • Z (Zero): 1 if the result is exactly 0. Used for equality checks (==).
  • C (Carry): 1 if an unsigned operation overflows (result > 32 bits) or for shifts.
  • V (Overflow): 1 if a signed operation makes no sense (e.g., Pos + Pos = Neg).

Bitwise Cheat Sheet

  • & (AND): Used to Mask (extract) bits.
    x & 0 = 0, x & 1 = x
  • | (OR): Used to Set (force) bits to 1.
    x | 0 = x, x | 1 = 1
  • ^ (XOR): Used to Toggle (invert) bits.
    x ^ x = 0, x ^ 0 = x
  • << (Shift): Multiply by 2. x << 1.
=
Sign (1) | Exponent (8) | Mantissa (23)
Value = (-1)S × 1.M × 2(E-127)
Calculation details here...