Is there a way to convert binary with Don't care to corresponding decimal values in MATLAB?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Is there a way to express don't care binary in MATLAB and get the decimal value? For example, 011x can be either 6 or 7 since the LSB is a don't care.
An Example Application: Suppose, I have a truth table of 5 variables [ABCDE]. It has 2^5 = 32 states. Now, if I say that I only care about states [ABE] and the rest are don't cares. Then there will be 2^3= 8 states that I care. How do I group those 32 states into 8 states? If I had the don't care decimals I would be done.
3 commentaires
Stephen23
le 8 Mar 2022
"Is there a way to convert binary ... to corresponding decimal values in MATLAB?"
"...there can be as many as 250 binary digits"
There is no inbuilt numeric class that will be able to hold such an integer with its full precision.
Réponses (1)
Jan
le 8 Mar 2022
You can ectract the wanted bits by bitget such that the ignored bits simply vanish.
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!