打印

module nand_gate_4bits(A, B, Y)

[复制链接]
43|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
34af9uc|  楼主 | 2024-3-25 00:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 34af9uc 于 2024-3-29 18:55 编辑
<div class="blockcode"><blockquote>/*************************与非门*************************/
/**************************************************/
/**************************************************/
`timescale 1ns/10ps
module nand_gate_4bits(A, B, Y);
input[3:0]                A;
input[3:0]                B;
output[3:0]                Y;

assign                Y=~(A&B);

endmodule
/*******************testbench of nand_gate******************/
module nand_gate_4bits_tb;
reg[3:0]                aa, bb;
wire[3:0]                yy;

//nand_gate nand_gate(.A(aa), .B(bb), .Y(yy));
nand_gate_4bits        nand_gate_4bits(.A(aa), .B(bb), .Y(yy));
initial
        begin
                        aa<=4'b0000;bb<=4'b0000;
        #10                aa<=4'b1111;bb<=4'b0000;
        #10                aa<=4'b0000;bb<=4'b11_00;
        #10                aa<=4'b0011;bb<=4'b0000;
        #10                aa<=4'b1100;bb<=4'b0011;
        $stop;
        end

endmodule
/**************************************************/
/**************************************************/



屏幕截图 2024-03-25 001240.png (411.8 KB )

屏幕截图 2024-03-25 001240.png

3.zip

12.91 KB

使用特权

评论回复

相关帖子

发新帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

284

主题

441

帖子

55

粉丝