PURPOSE: To obtain information for deciding whether an outputted result means data or not by adding a detecting circuit of overflow to be generated by shifting input data left to a shifter.
CONSTITUTION: A two-way barrel shifter having an overflow detecting circuit allowing 7-bit right shift and 8-bit left shift out of 16 bits of data width shown in the figure is constituted of an 1-bit right shifter or the like consisting of a 16-bit input and a 17-bit output. A barrel shifter control register 9 consisting of 4 bits controls whether respective shifters 1W3, 8 are to be actuated or not. Consequently, input data a0Wa15 are shifted by a number (b) expressing from the 2nd bit to the 0th bit of the control register 9 through respective shifter 1W3 and inputted to the 8-bit left shifter 8. Gates 4W6 detect all "1"s and all "0"s to decide the existence of effective bits and detect the overflow of the shifters.