Guest_imported
New member
- Jan 1, 1970
- 0
How do I convert a character string, in this case a message into a bit string(s)? Then generate some random bit string to simulate an error. Finally I have to correct the message to get rid of the errors, and come up with the original message. This should simulate an encryption and decryption program. I red something about (triple repetition) that repeats a message three times.If message is x1 x2,
we encode it as x1 x2 x3 x4 x5 x6 where x1=x3=x6 and so on.
A valid encoded message is 00010011. To decode the message use the simple majority rule. To determine x1 we look at x1 x3 x6. If two or three of this bits are 1 then we know that x1=1.For example if we receive 011 111 010 as
011111010 we know that the originl message was 011.
My biggest problem is how can I convert char into bit strings and then convert it back. If you have any suggestions I would be very thankful.
Thank you again Dani D!
we encode it as x1 x2 x3 x4 x5 x6 where x1=x3=x6 and so on.
A valid encoded message is 00010011. To decode the message use the simple majority rule. To determine x1 we look at x1 x3 x6. If two or three of this bits are 1 then we know that x1=1.For example if we receive 011 111 010 as
011111010 we know that the originl message was 011.
My biggest problem is how can I convert char into bit strings and then convert it back. If you have any suggestions I would be very thankful.
Thank you again Dani D!