fpga - 使用 Altera Cyclone FPGA 在 quartus 中低逻辑电平打开 LED 和高逻辑电平关闭 LED
问题描述
我有一块带有 EP4CE6E22C8 FPGA 的开发板。我在 Quartus Prime 中有以下 verilog 代码:
module Test(out);
output [7:0] out;
assign out = 8'b00111100;
endmodule
引脚规划器已按照原理图所示进行配置。问题是0打开LED,1关闭LED。我认为这是一种奇怪的行为,因为典型的行为是 1=on 和 0=off。
任何人都知道是否有任何选项(在 pin planner、quartus prime 或其他)来改变这种行为?
谢谢。
解决方案
该行为取决于电路板以及 LED 如何连接到 PIN。在外部,需要一个低电平来激活 LED。
您可以通过总是有用的抽象来改变行为。
module Test(out);
output [7:0] out;
wire [7:0] my_led;
// The application layer
assign my_led = 8'b11000011; // All inverted from the original
// The hardware abstraction layer
assign out = ~my_led; // Bitwise invert make the polarity as you desire.
endmodule
推荐阅读
- vim - Vim 背景颜色不同
- java - Android Q - 通过 NFC 启动隐私更改活动
- r - 缩放函数返回:FUN(x, aperm(array(STATS, dims[perm]), order(perm)), ...) 中的错误
- python - 找不到具有您请求的功能的树生成器:xml
- docker - 在 docker 中使用 wine 进程而不附加到 shell
- python - 你如何停止python中的线程?
- android - 使用 onSlicePinned 更新 Android Slice 中的数据
- html - 如何在渲染模板之前运行函数?
- python - 更改占位符形状
- android - 如何在没有root权限的情况下以编程方式杀死另一个应用程序或活动