Patent ID: 8504745

Claim:
A method of determining a shift pattern for generating an output data stream comprising output data words having a data width N from input data words having a data width M, where N is not equal to M, the method comprising: receiving an input data stream comprising words having the data width M; determining a value of (y*M)−N, where y is the ceiling of N/M; determining an initial shift value of the shift pattern using the determined value of (y*M)−N; generating subsequent shift values of the shift pattern until the determined initial shift value is generated, wherein each subsequent shift value is based upon an immediate previous shift value of the shift pattern, the data width N, and the data width M, and the shift pattern includes the determined initial shift value followed by subsequent shift values generated before the value of the determined initial shift value is generated; coupling a first input word of the input data stream to a first pipeline stage, wherein the first input word has a data width M; moving the first input word to a second pipeline stage when a second input word of the input data stream is coupled to the first pipeline stage, wherein the second input word has the data width M; coupling outputs of the first pipeline stage and the second pipeline stage to a barrel shifter; and transforming the input data stream to the output data stream by shifting input data words of the input data stream in the barrel shifter according to the shift pattern.