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

从F到0 - From F to 0

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

Quartus Verilog HDL/FPGA 实现 74HC27/74LS27 三组三输入端或非门 芯片电路源码

[复制链接]
发表于 2022-3-4 16:20:47 | 显示全部楼层 |阅读模式
main.png
  1. module hc27(                //74HC27 三组三输入端或非门 VCC:Pin14 GND:Pin7
  2.         input inA1,                //Pin1
  3.         input inA2,                //Pin2
  4.         input inA3,                //Pin13
  5.         input inB1,                //Pin3
  6.         input inB2,                //Pin4
  7.         input inB3,                //Pin5
  8.         input inC1,                //Pin9
  9.         input inC2,                //Pin10
  10.         input inC3,                //Pin11
  11.         output outA,        //Pin12
  12.         output outB,        //Pin6
  13.         output outC                //Pin8
  14. );
  15. assign {outA,outB,outC} = {
  16.         !(|{inA1,inA2,inA3}),
  17.         !(|{inB1,inB2,inB3}),
  18.         !(|{inC1,inC2,inC3}),       
  19. };

  20. endmodule

  21. module main(
  22.         input clk,
  23.         output reg led
  24. );
  25. wire [2:0] out;
  26. hc27 hc27 (
  27.         .inA1(1'b0),
  28.         .inA2(1'b0),
  29.         .inA3(1'b0),
  30.         .inB1(1'b1),
  31.         .inB2(1'b1),
  32.         .inB3(1'b1),
  33.         .inC1(1'b0),
  34.         .inC2(1'b1),
  35.         .inC3(1'b0),
  36.         .outA(out[2]),
  37.         .outB(out[1]),
  38.         .outC(out[0])
  39. );

  40. always @(posedge clk) begin
  41.         if(out == 3'b100) begin
  42.                 led <= 1'b0;
  43.         end else begin
  44.                 led <= 1'b1;
  45.         end
  46. end
  47. endmodule
复制代码

相关帖子

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

本版积分规则

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

腾讯云安全认证

GMT+8, 2024-3-29 02:45 , Processed in 0.462026 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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