Converting 4 bits to 5 bits
7 次查看(过去 30 天)
显示 更早的评论
I have values
a=10 8 15
converted to decimal using
a1 = dec2bin(mod(2^5+a,2^5))
even after performing ,i get only 4 bit values ,where as i need 5 bit value
please asssit
0 个评论
采纳的回答
更多回答(1 个)
John Petersen
2012-11-29
you only need 4 bits for values under 16. The fifth bit in your case is 0. Try a=20. and you will see the fifth bit.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!