Jump to content

Circular shift

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Dmesg (talk | contribs) at 22:05, 20 May 2005 (Initial entry). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In computer science, a circular shift is a shift operator that shifts all bits of its operand. Unlike an arithmetic shift, a circular shift does not preserve a number's sign bit or distinguish a number's exponent from its mantissa. Unlike a logical shift, the vacant bit positions are not filled in with zeros but are filled in with the bits that are shifted out of the sequence.

Circular shifts are used often in cryptography as part of the permutation of bit sequences.

Example

If the bit sequence 0110 1111 1010 0011 were subjected to a circular shift of four bit positions to the left, the resulting bit sequence would be 1111 1010 0011 0110

Note that the leftmost quartet of bits, 0110, was moved to the rightmost four bit positions.