キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Binary String to numerical binary array

Hello,

I initially created binary strings from numerical numbers using the
"%03b" command on the 'Format into String' block. I then concatenated
the various strings into one string that is now composed of 16bits.
However, I need to convert this string that I created back to a binary
numerical array for further processing.

Can you help me with this?

Thanks,
Rajesh.

0 件の賞賛
メッセージ1/4
3,404件の閲覧回数

Sounds very similar to a recent post.  Here is one solution:

Message Edited by tbob on 05-04-2007 05:49 PM

- tbob

Inventor of the WORM Global
0 件の賞賛
メッセージ2/4
3,399件の閲覧回数
Triniboy,
 
It is not good forum ettiquette to ask the same question twice.  You already asked for this in this thread
 
 
If you have more details or comments, please post them in the original message thread.
0 件の賞賛
メッセージ3/4
3,394件の閲覧回数


@triniboy wrote:
I initially created binary strings from numerical numbers using the
"%03b" command on the 'Format into String' block. I then concatenated
the various strings into one string that is now composed of 16bits.

In general, you are out of luck, because the number of characters for each value when formatted to binary with "%03b", will be variable. Any number greater than 7 will use more than 3 digits. (since you use "03" instead of 3", smaller numbers will have three digits with possible leading zeroes for padding).

After you concatenated all the formatted strings, you loose all boundary information unless ALL numbers are less than 8, but in this case they result would be a multiple of 3 and would not add up to 16 bits, right?

My best suggestion would be to NOT create a binary formatted string in this way, because it is a one-way operation and cannot be undone because you loose information in the process.

Back to square one! 😮

Maybe we can backup a few steps and you can explain to us what you really want to do with your original numbers. Why would you even consider formatting them this way? Do you need to save them to a file for later retrieval, for example?

0 件の賞賛
メッセージ4/4
3,390件の閲覧回数