At each rising edge, sign-extend and shift d right by one bit when shift_eight is low or eight bits when it is high.