设为首页收藏本站淘宝杂货铺

从F到0 - From F to 0

 找回密码
 注册已关闭
搜索
查看: 681|回复: 0
收起左侧

Quartus Verilog HDL/FPGA 实现 74HC00/74LS00 二输入四与非门 芯片电路源码

[复制链接]
发表于 2022-2-28 18:47:13 | 显示全部楼层 |阅读模式
main.png
  1. module hc00(                //74HC00 二输入四与非门
  2.         input inA1,
  3.         input inB1,
  4.         input inA2,
  5.         input inB2,
  6.         input inA3,
  7.         input inB3,
  8.         input inA4,
  9.         input inB4,
  10.         output out1,
  11.         output out2,
  12.         output out3,
  13.         output out4
  14. );

  15. assign {out1,out2,out3,out4} = ~(
  16.         {inA1,inA2,inA3,inA4} & {inB1,inB2,inB3,inB4}
  17. );

  18. endmodule

  19. module main(
  20.         input clk,
  21.         output reg led
  22. );
  23. wire [3:0] out;
  24. hc00 hc00(
  25.         .inA1(1'b0),
  26.         .inB1(1'b0),
  27.         .inA2(1'b0),
  28.         .inB2(1'b1),
  29.         .inA3(1'b1),
  30.         .inB3(1'b0),
  31.         .inA4(1'b1),
  32.         .inB4(1'b1),
  33.         .out1(out[0]),
  34.         .out2(out[1]),
  35.         .out3(out[2]),
  36.         .out4(out[3])
  37. );
  38. always @(posedge clk) begin
  39.         if(out == 4'b0111) begin
  40.                 led = 0;
  41.         end else begin
  42.                 led = 1;
  43.         end
  44. end
  45. endmodule
复制代码

相关帖子

您需要登录后才可以回帖 登录 | 注册已关闭

本版积分规则

QQ|手机版|Archiver|从F到0 ( 蒙ICP备17002595号-1 )
蒙公网安备15010402000325号

腾讯云安全认证

GMT+8, 2024-4-16 20:07 , Processed in 0.539031 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表