本文介绍了如何将两个定点数相乘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在尝试找出如何在定点表示形式中将两个数字相乘.
I am currently trying to figure out how to multiply two numbers in fixed point representation.
说我的数字表示法如下:
Say my number representation is as follows:
[SIGN][2^0].[2^-1][2^-2]..[2^-14]
在我的情况下,为数字10.01000000000000 = -0.25
.
In my case, the number 10.01000000000000 = -0.25
.
例如,我该怎么做0.25x0.25
或-0.25x0.25
等?
How would I for example do 0.25x0.25
or -0.25x0.25
etc?
希望您能提供帮助!
推荐答案
乘以一个更大的变量,然后右移定点精度的位数.
Multiply into a larger sized variable, and then right shift by the number of bits of fixed point precision.
这篇关于如何将两个定点数相乘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!