尧图网络科技YAOTU DIGITAL 获取报价
获取报价
首页 / 资讯中心 / 文章详情

verilog HDLBits刷题[Finding bugs in code]“Bugs nand3”---NAND

发布时间:2026/9/5 9:40:41

资讯中心
01
ARTICLE

verilog HDLBits刷题[Finding bugs in code]“Bugs nand3”---NAND

verilog HDLBits刷题[Finding bugs in code]“Bugs nand3”---NAND
1、题目This three-input NAND gate doesnt work. Fix the bug(s).You must use the provided 5-input AND gate:module andgate ( output out, input a, input b, input c, input d, input e );2、分析1、题目中提供了一个5输入的与门模块2、而题目要求我们修复一个3输入的与非门所以我们先设计3输入的与门再取非便可3、在与门中子模块有5个输入而顶层模块有3个输入多出来的两个可以设置为1’b11与任何数相与都等于任何数4、有两种例化方式其一是按位置例化所以需要看子模块各端口排放顺序来其二是按名称例化3、代码//按位置例化 module top_module (input a, input b, input c, output out);// wire out1; assign out~out1; andgate inst1 ( out1,a, b, c, 1b1, 1b1 ); endmodule 或者 //按名称例化 module top_module (input a, input b, input c, output out);// wire out1; assign out~out1; andgate inst1 ( .a(a), .b(b), .c(c), .d(1b1), .e(1b1) ,.out(out1)); endmodule4、结果
02
RELATED NEWS

相关资讯

更多网站建设与数字化升级内容

03
WHY YAOTU

想打造同款高转化官网?

懂行业、懂生意,从建站到增长一站式陪跑

场景化定制

不做模板站,围绕你的业务场景量身设计,小众不撞款。

营销型架构

以转化目标组织内容与路径,让官网真正带来询盘。

全周期服务

设计、开发、运营、运维一体,上线只是开始。

免费获取你的建站方案

留下需求,专属顾问 24 小时内为你输出方案建议。