A column address is decoded by each column decoder, and an arrangement of
pixels to be written to a memory cell array is rotated by a rotation
circuit. The rotation result is written to the memory cell array in
accordance with the decoding result of the column address. Then, the
column address is decoded by each column decoder to a decoding result
which is different from the decoding result of the column address at the
time of writing. In accordance with the decoding result, pixels stored in
the memory cell array are read. The arrangement of the read pixels is
rotated by the rotation circuit and then outputted. Thus, rearrangement of
pixels constituting an image can be carried out quickly while avoiding any
increase in the size of the device.