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

从F到0 - From F to 0

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

Quartus Verilog HDL/FPGA 实现 74HC04/74LS04 六非门反相器 芯片电路源码

[复制链接]
发表于 2022-3-1 07:13:19 | 显示全部楼层 |阅读模式
main.png
  1. module hc04(                //74HC04 六非门反相器 VCC:Pin14 GND:Pin7
  2.         input in1,                //Pin1
  3.         input in2,                //Pin3
  4.         input in3,                //Pin5
  5.         input in4,                //Pin13
  6.         input in5,                //Pin11
  7.         input in6,                //Pin9
  8.         output out1,        //Pin2
  9.         output out2,        //Pin4
  10.         output out3,        //Pin6
  11.         output out4,        //Pin12
  12.         output out5,        //Pin10
  13.         output out6                //Pin8
  14.         
  15. );

  16. assign {out1,out2,out3,out4,out5,out6} = ~{
  17.         in1,in2,in3,in4,in5,in6
  18. };
  19. endmodule

  20. module main(
  21.         input clk,
  22.         output reg led
  23. );
  24. wire [5:0] out;
  25. hc04 hc04(
  26.         .in1(1'b1),
  27.         .in2(1'b0),
  28.         .in3(1'b1),
  29.         .in4(1'b0),
  30.         .in5(1'b1),
  31.         .in6(1'b0),
  32.         .out1(out[0]),
  33.         .out2(out[1]),
  34.         .out3(out[2]),
  35.         .out4(out[3]),
  36.         .out5(out[4]),
  37.         .out6(out[5])
  38. );

  39. always @(posedge clk) begin
  40.         if(out == 6'b101010) begin
  41.                 led = 0;
  42.         end else begin
  43.                 led = 1;
  44.         end
  45. end
  46. endmodule
复制代码

相关帖子

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

本版积分规则

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

腾讯云安全认证

GMT+8, 2024-4-26 14:29 , Processed in 1.197068 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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