逻辑门作为持久状态任务 – 基于虚拟机的BCD解码器

1作者: tracyspacy2 个月前原帖
我正在用Rust构建一个小型嵌入式虚拟机,其核心原语是一个具有自己状态和可执行字节码指令的任务。<p>最近我添加了一个新示例:实现Petzold的《代码》一书中的二进制编码十进制解码器——每个逻辑门(位开关、反相器、与门)都是一个携带自己指令的任务。<p>它的工作方式很简单:运行命令 cargo run 1001 -> 9,输出将显示带有输入和输出的与门。<p>bcd-decoder: https://github.com/tracyspacy/spacydo/tree/main/examples/bcd-decoder
查看原文
I&#x27;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&#x27;s &quot;Code&quot; book — every logic gate (bits switch, inverters, AND gates) is a task carrying its own instructions.<p>It works simple : cargo run 1001 -&gt; 9 and as output it will show AND gate with inputs and output<p>bcd-decoder: https:&#x2F;&#x2F;github.com&#x2F;tracyspacy&#x2F;spacydo&#x2F;tree&#x2F;main&#x2F;examples&#x2F;bcd-decoder