LoginSignup
0
0

More than 1 year has passed since last update.

順序回路の作法 その7

Last updated at Posted at 2022-10-03

概要

順序回路を理解する。
真理値表をプリントする、インタープリタを説明する。

文法

コマンドは、make, init, nand, xor, and, or とoutの7個。
コマンドには引数がある。
コマンドと引数はスペース2個で区切る。

make コマンド

make 3
3個の端子の真理値表を作る。

init コマンド

init 0 1
0から1の端子を初期化する。
以下の通り。

0 0
1 0
0 0
0 1
0 0

nand コマンド

nand 0 1 2
端子0と端子1の論理積の否を端子2に出力する。

nor コマンド

nor 0 1 2
端子0と端子1の論理和の否を端子2に出力する。

and コマンド

and 0 1 2
端子0と端子1の論理積を端子2に出力する。

or コマンド

or 0 1 2
端子0と端子1の論理和を端子2に出力する。

xor コマンド

xor 0 1 2
端子0と端子1の排他的論理和を端子2に出力する。

out コマンド

out 2 3
2から3を出力端子に宣言する。

サンプルコード

make 4
in 0 1
nor 0 2 3
nor 1 3 2
out 2 3

成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0