当前位置:网站首页>FPGA里两个数的大小直接进行比较就可以吗?
FPGA里两个数的大小直接进行比较就可以吗?
2022-07-29 05:25:00 【qq_46475176】
定义了2个常量
parameter signed [15:0] hight_threshold = 500;
parameter signed [15:0] low_threshold = -500;
和一个寄存器比较
reg signed [15:0]data,
当data 为-80时使用下边的判断就是不行,总是成立
if(data > hight_threshold || data < low_threshold)
最后改成下边这种才正常
if($signed(data) > $signed(hight_threshold) || $signed(data) < $signed(low_threshold)
这种判断必需使用$signed定义有符号方向。
边栏推荐
- Redshift还原SP效果 - SP贴图导出设置及贴图导入配置
- 官方教程 Redshift 08 Light
- 进程与线程
- Leetcode notes 452. minimum number of arrows to burst balloons (medium) 452. detonate balloons with the minimum number of arrows (medium)
- Official tutorial redshift 04 rendering parameters
- LeetCode #876.链表的中间结点
- Linked list -------------------------- tail insertion method
- [beauty of software engineering - column notes] 20 | how to deal with the headache of requirement change?
- mavan中的plugin位置
- 寒假集训总结 (1.23~1.28) [第一梯队]
猜你喜欢

官方教程 Redshift 09 Camera

2022暑初二信息竞赛学习成果分享1
![[leetcode skimming] array 1 - double pointer](/img/c3/a671395e20fad58f1c7f6abc6e1a39.png)
[leetcode skimming] array 1 - double pointer

Leetcode 9. palindromes

Leetcode 876. Intermediate node of linked list

LeetCode #1.两数之和

LeetCode #14. 最长公共前缀

Redshift restore SP effect - SP map export settings and map import configuration

Traditional model predictive control trajectory tracking - circular trajectory (function package has been updated)

Ue5 texture system explanation and common problem setting and Solutions
随机推荐
LeetCode #19.删除链表的倒数第N个结点
Leetcode 557. reverse word III in string
[beauty of software engineering - column notes] 13 | how to break the rhythm of writing code during daytime meetings and overtime?
[beauty of software engineering - column notes] 16 | how to write project documents?
滑动窗口 Leetcode 76.最小覆盖子串(困难) 76.76. MinimumWindow Substring (Hard)
Eight sorts ----------- bubble sort
LeetCode #9.回文数
摊余成本最牛例子
Leetcode - Tips
官方教程 Redshift 08 Light
关于时间复杂度的个人看法
MySQL interview questions
Leetcode 14. longest public prefix
关于【链式前向星】的自学理解
LeetCode #283.移动零
SQL Developer图形化窗口创建数据库(表空间和用户)
Leetcode 283. move zero
c语言问题
Oracle10g出现Enterprise Manager 无法连接到数据库实例解决办法
IDEA 实用快捷键 新手必看