逻辑门作为持久状态任务 – 基于虚拟机的BCD解码器
我正在用Rust构建一个小型嵌入式虚拟机,其核心原语是一个具有自己状态和可执行字节码指令的任务。<p>最近我添加了一个新示例:实现Petzold的《代码》一书中的二进制编码十进制解码器——每个逻辑门(位开关、反相器、与门)都是一个携带自己指令的任务。<p>它的工作方式很简单:运行命令 cargo run 1001 -> 9,输出将显示带有输入和输出的与门。<p>bcd-decoder: https://github.com/tracyspacy/spacydo/tree/main/examples/bcd-decoder
查看原文
I'm building a tiny embeddable VM in Rust, where the core primitive is a Task with its own state and executable bytecode instructions.<p>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.<p>It works simple : cargo run 1001 -> 9 and as output it will show AND gate with inputs and output<p>bcd-decoder: https://github.com/tracyspacy/spacydo/tree/main/examples/bcd-decoder