Answer the question
In order to leave comments, you need to log in
How to form a byte of data from one bit of another byte?
I can not formulate an algorithm for the formation of one byte. It is necessary to read the bits from the foot of the MK and form a byte from them, but the hardware capability cannot be used. It simplifies the task, of course, that the bit to be read is always in the same place in the byte. Let
me explain with an example:
I have a variable For each
cycle , I receive
bytes andchar data;
there
will
be 8
pieces
in total , for
example :
I need to track the bit in bold and put it in the right place in the data variable, and as a result, the variable should be like this:
But I can’t make an algorithm, I hope the community can help data == 0b01100010
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question