找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 664|回复: 2
收起左侧

如何AHDL编写4 bit Latch电路

[复制链接]
ID:140371 发表于 2023-1-31 18:49 | 显示全部楼层 |阅读模式
请问先进 如何用AHDL编写 4 bit Latch  电路 ,

回复

使用道具 举报

ID:94031 发表于 2023-2-1 14:25 | 显示全部楼层
为什么非要AHDL,用VHDL或Verilog HDL不行吗,后两者既通用资料还多。
回复

使用道具 举报

ID:155507 发表于 2023-2-2 08:11 | 显示全部楼层
这是将锁存器的输入连接到称为 data_in 的输入线的 AHDL 代码,
锁存器的输出到称为 data_out 的输出线,以及到输入的使能线
称为 latch_enable:

下面是指定八位锁存器的方法:
  1. Latch
  2. A latch in AHDL has two inputs – D and En, and one output Q. When En is low, the output
  3. Q does not change. When En is high, the output Q is equal to the input D. Thus, when En is
  4. low, it will hold the value which was on the D input when En went from high to low. To use
  5. a latch in AHDL, declare it in the VARIABLE section of the program:
  6. VARIABLE
  7. A : LATCH;
  8. will define a one-bit latch. To specify what should on the D input of A, use A.d. To specify
  9. what should on the En input of A, use A.ena. To use the Q output, refer to A.q.
  10. Here is the way to specify an eight-bit latch:
  11. VARIABLE
  12. A[7..0] : LATCH;
  13. Here is AHDL code to connect the inputs of the latch to input lines called data_in, the
  14. outputs of the latch to output lines called data_out, and the the enable lines to an input
  15. called latch_enable:

  16. SUBDESIGN my_latch
  17. (
  18. data_in[7..0] : INPUT;
  19. latch_enable : INPUT;
  20. data_out[7..0] : OUTPUT;
  21. )
  22. VARIABLE
  23. A[7..0] : LATCH;
  24. BEGIN
  25. A[].d = data_in[];
  26. A[].ena = latch_enable;
  27. data_out[] = A[].q;
  28. END;
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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