sweethomela8
Member level 4

Hi, whats the easiest way to transform a 12 bit unsigned variable into a 16 bit unsigned variable where the additional 4 bits equal to the 12th bit of the original variable? (sign extension)
ie. 0xF0A -> 0xFF0A
ie. 0xA12 -> 0xFA12
ie. 0x612 -> 0x0612
thanks.
In the C programming language.
ie. 0xF0A -> 0xFF0A
ie. 0xA12 -> 0xFA12
ie. 0x612 -> 0x0612
thanks.
In the C programming language.