原创 【笔记】《Finite State Machine Datapath Design》重要概念-3

2009-5-5 11:08 2603 5 5 分类: FPGA/CPLD

part3 无符号定点数的表示及转换方法


Finite State MachineWith Datapath Design


FIXED-POINT REPRESENTATION


Convert an unsigned decimal number to a X.Y fixed-point binary format


To convert an unsigned decimal number to a X.Y fixed-point format, multiply the decimal
number by 2^Y, drop any fractional remainder, and then convert this to its unsigned binary value using a N.0 format, where N = X + Y.


Convert an X.Y unsigned binary number to its decimal representation


To convert an X.Y unsigned binary number to its decimal representation, first convert the
number to its decimal representation assuming an N.0 format, where N = X + Y. Then divide this number by 2^Y to produce the final decimal result.


Example:


点击开大图


5.3 format


4.625*(2^3)(decimal) = 37(decimal) = 8'b00100101(binary)


8'b1000111(binary) = 143(decimal) = 143/(2^3)(decimal) = 17.875(decimal)


 

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
5
关闭 站长推荐上一条 /3 下一条