找回密码
 注册
关于网站域名变更的通知
查看: 553|回复: 2
打印 上一主题 下一主题

FPGA --- Verilog基础知识(有符号数运算规则,加减运算,乘法运算中的符号位拓展...

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2019-7-30 15:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
rule of thumb/ c1 M8 W# x; \/ ?' F0 ^- w
# ~: R1 S6 {0 G3 x

: i; M# T4 D  S
  • The format of the signed type is two’s complement. 有符号数均为补码表示
  • If any operand in an expression is unsigned the operation is considered to be unsigned. 只有计算表达式右边有无符号数,整个计算式都按照无符号数规则运算
  • 只有算式右边全为有符号数,运算才会自动补齐所需的bit数,n+n=n+1.n*n=2n
  • The value -4 represented as a 3bit signed hex value would be specified as -3’sh4. A decimal number is always signed. verilog2001中用’s来特别声明有符号数,十进制的数都是有符号数
  • Type casting using $unsigned will make the operation unsigned. The operand will be sign extended with 0’s if necessary. $usigned()函数在高位补0
  • A=$signed(B) will extend using sign bit. $unsigned()函数会在高位补与符号位相同的bit
    1 o5 t+ l! e% J0 h) Q% U! m* a: @

9 f9 j( I, b. Z9 n0 i5 p  y% u3 B) J% B; r0 J& n( p
+ P' F5 `" Z# E( x
basic signed addition8 X) R! F$ {% K% r8 t! l) g* J
( r/ H$ `+ r1 J$ _- r
7 B& c0 w4 U3 I7 {' R+ F. V
游客,如果您要查看本帖隐藏内容请回复
* t' H3 q2 B4 n

% T7 _; c  v, i5 \1 q
/ r$ ?% h1 P# s  ^, I, t

该用户从未签到

2#
发表于 2019-7-30 16:24 | 只看该作者
看看FPGA都可以做什么用途
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-8-16 06:54 , Processed in 0.140625 second(s), 26 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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