I have a byte, whose value in binary is 11111111. I have to extend my byte to 16 bits 0101010101010101 according to these rules: if bit = 1, now is 01. If bit = 0, now is 10.
For example:
00001111 -> 1010101001010101
00000101 -> 1010101010011001
What is the operation to do this?