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

从F到0 - From F to 0

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

Quartus Verilog HDL/FPGA 实现 74HC32/74LS32 二输入端四或门 芯片电路源码

[复制链接]
发表于 2022-3-1 08:02:24 | 显示全部楼层 |阅读模式
main.png
  1. module hc32(                //74HC32 二输入端四或门 VCC:Pin14 GND:Pin7
  2.         input inA1,                //Pin1
  3.         input inB1,                //Pin2
  4.         input inA2,                //Pin4
  5.         input inB2,                //Pin5
  6.         input inA3,                //Pin9
  7.         input inB3,                //Pin10
  8.         input inA4,                //Pin12
  9.         input inB4,                //Pin13
  10.         output out1,        //Pin3
  11.         output out2,        //Pin6
  12.         output out3,        //Pin8
  13.         output out4                //Pin11
  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. hc32 hc32(
  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'b1110) 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-19 22:06 , Processed in 0.618035 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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