Story

Logic gates as persistent stateful tasks – a BCD decoder built on a VM

tracyspacy Tuesday, March 03, 2026

I'm building a tiny embeddable VM in Rust, where the core primitive is a Task with its own state and executable bytecode instructions.

Recently I added new example: Implementation of Binary Coded Decimal decoder from Petzold's "Code" book — every logic gate (bits switch, inverters, AND gates) is a task carrying its own instructions.

It works simple : cargo run 1001 -> 9 and as output it will show AND gate with inputs and output

bcd-decoder: https://github.com/tracyspacy/spacydo/tree/main/examples/bcd-decoder

1 0
Read on Hacker News