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

从F到0 - From F to 0

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

Quartus Verilog HDL/FPGA 实现 CD4014/74HC4014 8位并行输入串行3输出同步移位寄存器

[复制链接]
发表于 2023-10-21 21:17:48 | 显示全部楼层 |阅读模式
本帖最后由 HDL 于 2023-10-22 08:04 编辑

main.png
  1. module cd4014(                //8位并行输入串行3输出同步移位寄存器 VCC:Pin16 GND:Pin8
  2.         input SIN,                        //级联串行输入 Pin11
  3.         input [7:0] D,                //[8位宽] 并行输入D Pin:1,15,14,13,4,5,6,7
  4.         input CLK,                        //CLK时钟 (上升沿触发) Pin10
  5.         input PS,                        //高电平:将D装入Q 低电平:Q移位(CLK上升沿触发) Pin9
  6.         output Q5,                        //串行输出Q5 Pin2
  7.         output Q6,                        //串行输出Q6 Pin12
  8.         output Q7                        //串行输出Q7 Pin13
  9. );

  10. reg [7:0] Q = 8'd0;
  11. assign {Q7,Q6,Q5} = Q[7:5];
  12. always @(posedge CLK) begin
  13.         if(PS) begin
  14.                 Q <= D;
  15.         end else begin
  16.                 Q <= {Q[6:0],SIN};
  17.         end
  18. end
  19. endmodule

  20. module main(
  21.         input SIN,
  22.         input [7:0] D,
  23.         input CLK,
  24.         input PS,
  25.         output Q5,
  26.         output Q6,
  27.         output Q7
  28. );

  29. cd4014 U1(
  30.         .SIN(SIN),
  31.         .D(D),
  32.         .CLK(CLK),
  33.         .PS(PS),
  34.         .Q5(Q5),
  35.         .Q6(Q6),
  36.         .Q7(Q7)
  37. );
  38. endmodule
复制代码

相关帖子

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

本版积分规则

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

腾讯云安全认证

GMT+8, 2024-4-27 21:03 , Processed in 1.945111 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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