Is there a way to convert binary with Don't care to corresponding decimal values in MATLAB?
7 views (last 30 days)
Show older comments
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 Comments
Stephen23
on 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.
Answers (1)
Jan
on 8 Mar 2022
You can ectract the wanted bits by bitget such that the ignored bits simply vanish.
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!