Is there a way to convert binary with Don't care to corresponding decimal values in MATLAB?
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Stephen23
2022 年 3 月 8 日
"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.
回答 (1 件)
Jan
2022 年 3 月 8 日
You can ectract the wanted bits by bitget such that the ignored bits simply vanish.
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!