如何在vhdl中使用3输入逻辑门?

发布于 12-13 10:58 字数 118 浏览 3 评论 0原文

我刚刚学习 vhdl,并尝试使用 3 输入与非门。我的代码是:

G => (A nand B nand C) after 3 ns;

但这不能编译。

I am just learning vhdl, and am trying to use a 3-input nand gate. The code I have is:

G => (A nand B nand C) after 3 ns;

but this does not compile.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

扶醉桌前2024-12-20 10:58:46

我不是 VHDL 专家,但我认为你有几个错误 - 可能应该是:

G <= not (A and B and C) after 3 ns;

即分配方向错误,我不确定 nand 是否按照你需要的方式进行交换3 个输入,因此使用 and 作为输入,然后使用 not 反转输出。

I'm not an expert on VHDL but I think you have a couple of mistakes there - it should probably be:

G <= not (A and B and C) after 3 ns;

i.e. the assignment is in the wrong direction and I'm not sure that nand commutes in the way that you need it to for 3 inputs, hence the use of and for the inputs and then not to invert the output.

入画浅相思2024-12-20 10:58:46

哦,我想我可能知道。

G <= (A nand B nand C);

你把赋值运算符的符号颠倒了,是吗?

真正延迟的编辑:

VHDL 不会使用上面介绍的 A nand B nand C 语法进行编译,这会产生语法错误。最好按照保罗的建议去做,并将“不”排除在逻辑之外。

Oh I think I may know.

G <= (A nand B nand C);

You have the assignment operator sign reversed, yes?

Really delayed edit:

VHDL will not compile with the A nand B nand C syntax presented above, this gives a syntax error. Best to do what Paul suggests and pull the not out in front of the logic.

凉月流沐2024-12-20 10:58:46

您必须通过执行以下操作将三输入 NAND 门变成两输入 NAND 门:

Convert 3 input to 2 input NAND Gate

然后你可以只使用两个输入来编写VHDL,并且不会违法。如果您想编写复杂的 NAND 逻辑,您可以向架构添加一个进程,然后使用变量捕获逻辑的子部分,然后将 NAND 应用于这些子部分。使您更容易了解您在职能中所处的位置。

You would have to make your three input NAND gate into a two input NAND gate by doing the following:

Convert three input to two input NAND gate

Then you can write the VHDL using only two inputs and it won't be illegal. If you want to write complex NAND logic, you can add a process to your architecture and then use variables to capture sub parts of your logic and then apply NAND to those subparts. Makes it easier to understand where you're at in your function.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文