定点小数转换器Q格式

在Qa转换定点数字。b格式小数

673下载

更新2017年2月20日

查看许可协议

这个函数将在Qa定点数字。b格式小数where "a" is the number of bits to the left of the binary point not including the sign bit, and "b" is the number of bits to the right of the decimal point. The input format is either binary or hexadecimal (hex is the default). The function is called by the command "q2dec(x,a,b,format)" where x is a string representing the input number in Qa.b format, "a" is "a" is the number of bits to the left of the binary point not including the sign bit, "b" is the number of bits to the right of the decimal point, and format is either 'bin' or 'hex' (format is optional, 'hex' is the default).
例如,下面的命令可以转换十六进制数字0 x4000 Q0.15(也称为最喜欢)十进制格式:
> > q2dec (' 4000 ', 0, 15)
ans =
0.5000

下面的命令可以转换成二进制数1100000000000000 Q0.15(也称为最喜欢)十进制格式:
> > q2dec(' 1100000000000000 ', 0, 15日,“本”)
ans =
-0.5000

几个数字可以在一次调用转换通过将每个输入矩阵的行数:
> > x = [‘8000’;“C000”;“0000”;' 4000 ');
> > q2dec (x 0 15)
ans =
-1.0000
-0.5000
0
0.5000

看到我的其他提交dec2q小数转换为Qa。b格式。

引用作为

约瑟夫(2023)。定点小数转换器Q格式(//www.tianjin-qmedu.com/matlabcentral/fileexchange/61670-fixed-point-q-format-to-decimal-converter), MATLAB中央文件交换。检索

MATLAB版本兼容性
创建R2015a
兼容任何释放
平台的兼容性
窗户 macOS Linux

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!
版本 发表 发布说明
1.0.0.0