# TorchAnvil > A free, browser-based workbench for logic gates, number systems, and Minecraft-style redstone. Built by Tiny Delights. ## Core tools - [Logic Gate Simulator](https://torchanvil.app/simulator): Drag and drop logic gates, wire them up, and watch signal flow. Free, no sign-up. - [Sample library](https://torchanvil.app/library): 30 working logic-gate circuits you can open in the simulator in one click. - [Base Converter](https://torchanvil.app/base-converter): Convert between binary, decimal, hex, octal, base 64, and custom bases. - [Circuit Collapsor](https://torchanvil.app/collapsor): Minimize any combinational circuit (Quine–McCluskey) and see the simpler equivalent. - [Guides](https://torchanvil.app/guides): Plain-English explainers for every logic gate, number system, and core concept. - [Redstone patterns](https://torchanvil.app/redstone): Canonical Minecraft redstone layouts for every logic gate. - [Learn](https://torchanvil.app/learn): A guided curriculum that teaches logic circuits by building them — gates, adders, registers, and a tiny ALU. ## Lessons - [A pocket calculator](https://torchanvil.app/learn/tiny-alu): Four operations on two bits, selected by two control bits. This is what a CPU does. - [Carrying forward](https://torchanvil.app/learn/full-adder): Three inputs, two outputs. Now you can chain adders to handle any number of bits. - [Clocked memory](https://torchanvil.app/learn/clocked-memory): Set the data, pulse the clock, and the bit gets latched. The cell behind every CPU register. - [Combining two inputs](https://torchanvil.app/learn/combining-inputs): Two levers, one lamp, four possibilities. Time to make decisions. - [Counting clock pulses](https://torchanvil.app/learn/toggle): Pulse the clock, the lamp toggles. The seed of every counter and divider. - [Either one](https://torchanvil.app/learn/either-one): If any single switch is on, the lamp lights. The friendliest two-input rule. - [Exactly one](https://torchanvil.app/learn/exactly-one): Not zero, not both. The rule that picks out "these two disagree". - [Picking with a switch](https://torchanvil.app/learn/multiplexer): One selector bit, two data lines, one output. The circuit every CPU uses a million times a second. - [Your first adder](https://torchanvil.app/learn/half-adder): Two inputs, two outputs. You're officially doing arithmetic now. - [Your first gate](https://torchanvil.app/learn/first-gate): A signal that flips. One lever, one lamp, one surprise. - [Your first memory](https://torchanvil.app/learn/memory): A circuit that remembers what you told it. Welcome to sequential logic. ## Guides - [AND gate](https://torchanvil.app/guides/and-gate): The gate that fires only when *all* its inputs are on. - [Binary](https://torchanvil.app/guides/binary): Base 2 — just two digits, and everything a computer thinks it knows. - [Buffer](https://torchanvil.app/guides/buffer): A gate that does "nothing" — on purpose, and usefully. - [Hex Display](https://torchanvil.app/guides/hex-display): Four bits in, one glowing hex digit out — watch binary become a number. - [Hexadecimal](https://torchanvil.app/guides/hexadecimal): Base 16 — ten digits plus A through F, and four bits per character. - [NAND gate](https://torchanvil.app/guides/nand-gate): AND with the answer flipped — and the only gate you ever really need. - [NOR gate](https://torchanvil.app/guides/nor-gate): OR with the answer flipped — on only when *everything* is off. - [NOT gate](https://torchanvil.app/guides/not-gate): One input, one output, and a permanent disagreement between them. - [OR gate](https://torchanvil.app/guides/or-gate): The gate that fires when *any* of its inputs is on. - [XNOR gate](https://torchanvil.app/guides/xnor-gate): The gate that fires when its inputs *agree* — the equality detector. - [XOR gate](https://torchanvil.app/guides/xor-gate): The gate that fires when *exactly one* of its inputs is on. ## Redstone patterns - [AND gate](https://torchanvil.app/redstone/and): Two torch-towers feeding a shared line — output lights only when both inputs are on. - [Buffer](https://torchanvil.app/redstone/buffer): A repeater sitting in a dust line. Refreshes the signal so it can travel further. - [NAND gate](https://torchanvil.app/redstone/nand): AND with the output inverted. Or — OR of the two inputs' negations. - [NOR gate](https://torchanvil.app/redstone/nor): Two inputs power a single block. A torch on its side is off if either input is on. - [NOT gate](https://torchanvil.app/redstone/not): One block, one torch on top. The simplest redstone logic there is. - [OR gate](https://torchanvil.app/redstone/or): Two dust lines walking toward each other, merging into one. The simplest gate in redstone. - [XNOR gate](https://torchanvil.app/redstone/xnor): On when the two inputs match. An XOR with one extra inverter on the output. - [XOR gate](https://torchanvil.app/redstone/xor): On when the two inputs differ. Needs four torches and a bit of patience. ## Sample circuits - [1-to-2 demultiplexer](https://torchanvil.app/library/one-to-two-demux): One signal in, two possible exits — a selector picks which one receives it. - [2-bit counter](https://torchanvil.app/library/two-bit-counter): Count 0, 1, 2, 3, 0, 1… every clock tick, with two T flip-flops. - [2-to-1 multiplexer](https://torchanvil.app/library/two-to-one-mux): Two signals walk into a circuit. A selector decides which one walks out. - [2-to-4 decoder](https://torchanvil.app/library/two-to-four-decoder): Two input bits, four output lines — exactly one fires at a time. - [4-bit counter](https://torchanvil.app/library/four-bit-counter): Counts 0 through 15 on every clock tick, then wraps back to zero. - [4-bit register](https://torchanvil.app/library/four-bit-register): Four bits of storage that all latch in on the same button press. - [4-bit ripple-carry adder](https://torchanvil.app/library/four-bit-adder): Four full adders in a chain — add two nibbles and watch the carry ripple. - [4-bit shift register](https://torchanvil.app/library/four-bit-shift-register): Bits march one position to the right on every clock tick. - [4-to-1 multiplexer](https://torchanvil.app/library/four-to-one-mux): Four inputs, two selector bits — pick any one and send it through. - [Blinker](https://torchanvil.app/library/blinker): A lamp that blinks at whatever rate you choose — with a master switch. - [Button toggle](https://torchanvil.app/library/button-toggle): Press once to latch the lamp on, press again to release it. - [D flip-flop capture](https://torchanvil.app/library/d-latch-enable): Flip the lever, press the button, and the lamp locks in the lever's value. - [De Morgan demo](https://torchanvil.app/library/de-morgan-demo): Two circuits, two expressions, one truth table — and two lamps that always agree. - [Door toggle](https://torchanvil.app/library/door-toggle): A button that only works while you're holding the key. - [Edge detector](https://torchanvil.app/library/edge-detector): A one-tick pulse every time the input changes — the trick behind every rising-edge trigger. - [Full adder](https://torchanvil.app/library/full-adder): Three bits in, a sum and a carry out — the block every adder is made of. - [Half adder](https://torchanvil.app/library/half-adder): Add two single bits and see the carry pop out. - [Half subtractor](https://torchanvil.app/library/half-subtractor): A minus B, with a borrow bit for when you run out of room. - [JK flip-flop in toggle mode](https://torchanvil.app/library/jk-toggle): The universal flip-flop, wired to flip its output on every click. - [Majority gate](https://torchanvil.app/library/majority-gate): Three inputs, one lamp — it lights when at least two of them agree. - [NAND as AND](https://torchanvil.app/library/nand-as-and): One NAND gives you the opposite of AND. Add another and you're back. - [NAND as NOT](https://torchanvil.app/library/nand-as-not): Tie a NAND's inputs together and it quietly becomes an inverter. - [NAND as OR](https://torchanvil.app/library/nand-as-or): Invert both inputs, NAND them, and De Morgan hands you an OR. - [One-bit comparator](https://torchanvil.app/library/one-bit-comparator): Is A greater, equal, or less than B? Exactly one lamp will tell you. - [One-shot](https://torchanvil.app/library/one-shot): Fire a single pulse on the rising edge, then stop — even if you hold the input. - [Priority encoder](https://torchanvil.app/library/priority-encoder): Four request lines in, a 2-bit index out — the highest-priority one wins. - [Pulse extender](https://torchanvil.app/library/pulse-extender): Stretch a short pulse into a long one with a delayer and an OR. - [SR memory cell](https://torchanvil.app/library/sr-memory): Press one button to remember a 1, another to forget it. - [Traffic light](https://torchanvil.app/library/traffic-light): A clock, a counter, and a decoder cycle three lamps like a street-corner signal. - [XOR identities](https://torchanvil.app/library/xor-identity): XOR with 0, with itself, or with 1 — three handy patterns in one picture. ## About - [About TorchAnvil](https://torchanvil.app/about) - [Changelog](https://torchanvil.app/changelog) - [Privacy](https://torchanvil.app/privacy) - [Contact](https://torchanvil.app/contact)