I am not completely sure as to why this happens but it looks like (D[16] << 16) takes your sign bit and and assigns it to Q[16] . Since both your variables are signed, when Q is shifted by one, the MSB bit is maintained by 'ORing' it with (Q>>1). I'd be interested to know details about this if you find out more!