{
  "format": "automata-studio/workspace",
  "schema": 1,
  "app": "dev",
  "machine": "Mealy",
  "config": {
    "sym": {
      "eps": "ε",
      "any": "Σ",
      "blank": "⊔",
      "leftMarker": "⊢",
      "rightMarker": "⊣",
      "stackBottom": "Z",
      "lambda": "λ"
    },
    "transducerAccepts": false
  },
  "sigma": [
    "0",
    "1"
  ],
  "stackAlpha": [],
  "outputAlpha": [
    "0",
    "1"
  ],
  "tapeCount": 1,
  "states": [
    {
      "id": "s1",
      "x": 140,
      "y": 160,
      "name": "copy"
    },
    {
      "id": "s2",
      "x": 319,
      "y": 160,
      "name": "flip"
    }
  ],
  "transitions": [
    {
      "id": "t1",
      "from": "s1",
      "to": "s1",
      "symbol": "0",
      "output": "0"
    },
    {
      "id": "t2",
      "from": "s1",
      "to": "s2",
      "symbol": "1",
      "output": "1"
    },
    {
      "id": "t3",
      "from": "s2",
      "to": "s2",
      "symbol": "0",
      "output": "1"
    },
    {
      "id": "t4",
      "from": "s2",
      "to": "s2",
      "symbol": "1",
      "output": "0"
    }
  ],
  "startId": "s1",
  "accepts": [],
  "notes": [],
  "dividers": [],
  "blocks": [],
  "meta": {
    "title": "Two’s complement, least significant bit first",
    "blurb": "Negate a binary number as it streams in, low bit first: copy the bits up to and including the first 1, then flip every bit after it. Two states — before and after that first 1 — and the output keeps pace with the input.",
    "inputs": [
      {
        "w": "0",
        "out": "0"
      },
      {
        "w": "1",
        "out": "1"
      },
      {
        "w": "00",
        "out": "00"
      },
      {
        "w": "01",
        "out": "01"
      },
      {
        "w": "000",
        "out": "000"
      },
      {
        "w": "1111101100011000",
        "out": "1000010011100111"
      }
    ],
    "library": {
      "author": {
        "login": "thethinkmachine"
      },
      "license": "CC-BY-4.0",
      "tags": [
        "binary-numbers",
        "twos-complement",
        "serial-arithmetic"
      ],
      "difficulty": "intro"
    }
  }
}
