Converting 4 bits to 5 bits
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Azzi Abdelmalek
le 29 Nov 2012
Modifié(e) : Azzi Abdelmalek
le 29 Nov 2012
use
a1 = dec2bin(mod(2^5+a,2^5),5)
0 commentaires
Plus de réponses (1)
John Petersen
le 29 Nov 2012
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.
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!