Skip to content
Weave templates

Half Adder (logic)

Two 1-bit inputs into an XOR gate (sum) and an AND gate (carry) — the building block of binary addition.

Template previewWeave
Rendering…

Make it your own.

{
  "nodes": [
    { "id":"a",     "type":"rounded",   "label":"A",     "x":60,  "y":90,  "fill":"#dbeafe" },
    { "id":"b",     "type":"rounded",   "label":"B",     "x":60,  "y":250, "fill":"#dbeafe" },
    { "id":"xor",   "type":"logic-xor", "label":"XOR",   "x":330, "y":120, "fill":"#e0e7ff" },
    { "id":"and",   "type":"logic-and", "label":"AND",   "x":330, "y":270, "fill":"#e0e7ff" },
    { "id":"sum",   "type":"rounded",   "label":"Sum",   "x":580, "y":130, "fill":"#dcfce7" },
    { "id":"carry", "type":"rounded",   "label":"Carry", "x":580, "y":270, "fill":"#fef3c7" }
  ],
  "edges": [
    { "id":"e1","source":"a","target":"xor" },
    { "id":"e2","source":"b","target":"xor" },
    { "id":"e3","source":"a","target":"and" },
    { "id":"e4","source":"b","target":"and" },
    { "id":"e5","source":"xor","target":"sum","label":"A⊕B" },
    { "id":"e6","source":"and","target":"carry","label":"A·B" }
  ]
}