Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHow to pad or extend the most significant bit (bit 23) into bits 24 through 31
Hi, As suggested by forumer kflynn (http://www.alteraforum.com/forum/member.php?u=86819) in this link (http://www.alteraforum.com/forum/showthread.php?t=48398), the below issue can be resolved ...
Altera_Forum
Honored Contributor
11 years agoI think that C code should actually be:
value = (value & (0x1 << 23)) ?
value | (0xFF << 24 ) :
value;
Notice that you are checking bit 23 to see if it is a 1 or a 0 (not bit 24!).