More than 1 year has passed since last update.
高位合成言語アセンブラを作る。 その16
1
Last updated at Posted at 2020-12-06
概要
高位合成言語アセンブラを作る。
練習問題、フリップフロップ、やってみた。
コードを書く。
make 4
in 0 1
nor 0 2 3
nor 1 3 2
out 2 3
コンパイル結果
module x(input a, input b, output c, output d);
assign d = ~(a | c);
assign c = ~(b | d);
endmodule
module testbench;
reg a, b;
x u(.a(a), .b(b), .c(c), .d(d));
initial
begin
$display("a b c d ");
$monitor("%b %b %b %b ", a, b, c, d);
a = 0; b = 0; #10;
a = 0; b = 1; #10;
a = 1; b = 0; #10;
a = 1; b = 1; #10;
$finish;
end
endmodule
成果物
真理値表で確認する。
成果物
回路図で確認する。
動作せず。
成果物
実行結果
a b c d
0 0 x x
0 1 0 1
0 0 0 1
1 0 1 0
0 0 1 0
以上。
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
