Patent ID: 7461108

Claim:
A barrel shift device for receiving input data having a predetermined bit width, shifting the input data to the right or left by a total shift amount obtained by combining a first shift amount and a second shift amount, and outputting the resultant data as output data after a desired shift, comprising: a first shift section of receiving the input data, shifting the input data based on a first control signal for controlling the first shift amount, and outputting the resultant data as intermediate data; an intermediate data holding section for holding the intermediate data from the first shift section; a control signal holding section of holding and outputting a second control signal for controlling the second shift amount; a second shift section of receiving the intermediate data held in the intermediate data holding section, shifting the received intermediate data based on the second control signal output from the control signal holding section, and outputting the resultant data as the output data after the desired shift; and a decoding section of receiving the second control signal, and based on the second control signal, detecting digit positions in the intermediate data of data elements excluding the whole or a part of data elements other than data elements to be output as the output data after the desired shift from the second shift section, among all data elements constituting the intermediate data from the first shift section, wherein the intermediate data holding section newly holds data elements at digit positions including at least the data elements to be output as the output data after the desired shift from the second shift section, excluding the whole or a part of data elements other than the data elements to be output as the output data after the desired shift from the second shift section, among the intermediate data, based on the digit positions detected by the decoding section.