{
  "slug": "gray-code",
  "term": "Gray code",
  "aliases": [
    "Gray labeling",
    "Gray-code labeling"
  ],
  "definition": "A Gray code orders distinct binary labels so that consecutive labels differ in exactly one bit.",
  "note": "In multibit NAND, labels associate threshold-voltage states with bits belonging to logical pages; they do not specify host LBA order or the programming schedule. [li2016]\n\nGray adjacency limits a mistaken neighboring state to one wrong label bit. It does not correct that bit, detect every substitution or give the same bound for a jump across several states. With all eight three-bit labels used, another valid label remains possible after corruption. [bailon2022]\n\nA finite illustration uses 000,001,011,010,110,111,101,100 in ascending state order. Across its seven boundaries the left, middle and right bits change 1, 2 and 4 times. The alternative 000,001,011,111,101,100,110,010 gives 2, 3 and 2. Both are Gray labelings. Seven changes cannot be divided equally among three integer counts. [hesela-labeling]\n\nThese counts describe label geometry, not measured page error rates, NAND read commands or SSD latency. State populations, voltage distributions, sensing and the ECC arrangement remain necessary for a reliability or performance claim. [bailon2022]",
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "related": [
    "tlc",
    "nand-page"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "bailon2022",
      "title": "Nicolas Bailon, Thiers and Freudenberger. Cell-Wise Encoding for TLC and QLC NAND. Electronics 11, 1585 (2022), sections 2-3, 5.",
      "url": "https://doi.org/10.3390/electronics11101585",
      "accessed": "2026-11-22"
    },
    {
      "id": "li2016",
      "title": "Li, En Gad, Jiang and Bruck. Data Archiving in 1x-nm NAND Flash Memories. IRPS 2016, section II.B-C and Figure 1.",
      "url": "https://people.engr.tamu.edu/ajiang/Publications/2016/IRPS2016.pdf",
      "accessed": "2026-11-22"
    },
    {
      "id": "hesela-labeling",
      "title": "Hesela - Gray coding changes labels, not the program contract; finite enumeration and executable tests.",
      "url": "https://hesela.com/analyses/nand-paired-pages-durability/#gray-labeling",
      "accessed": "2026-11-22"
    }
  ],
  "updated": "2026-11-22",
  "provenance": [
    "The 2022 paper separates fitted measured TLC distributions from idealized-channel code evaluation; neither is a fleet-wide failure rate.",
    "Label counts are an independently enumerated teaching example, not a recovered chip mapping. All 40320 assignments are checked with a separate XOR oracle.",
    "Gray-code labeling is distinct from gray failure, error-correcting redundancy and NAND program ordering."
  ]
}
