verilog 实战 反向器

在这里我用的是iverilog 编译代码,用gtk来显示波形,纯linux开发

代码在git

inveter.v

//反相起器设计
`timescale 1ns/10ps
module inv(
           A,
           Y
            );
input       A;
output      Y;


assign      Y=~A;

endmodule 

stimulus_tb.v




//-------testbench of inv------------

module int_tb;

reg   aa;
wire  yy;
inv inv (
          .A(aa),
          .Y(yy)
           );

initial begin
    $dumpfile("test.vcd");
     $dumpvars(0,int_tb);
        aa<=0;
    #10 aa<=1;
    #10 aa<=0;
    #10 aa<=1;
    #10 $stop;
end 
endmodule
bash compile.sh

在这里插入图片描述

posted @ 2022-08-19 22:44  luoganttcc  阅读(79)  评论(0)    收藏  举报