1

enter image description here

in this picture of an 8 bit right shifter, can someone please tell me what those 0's represent ? in the first row of MUX there is one zero connect, in the second row the first two have 0 connected, and in the third row there are 4 zeros connected?

GarudaAiacos
  • 161
  • 2
  • 17

1 Answers1

2

There are three shifting possibilities:

  • shift(0) is the bit0 of the shift amount. It weights 20 = 1.
    Setting that bit shift at least 1 bit.
  • shift(1) is the bit1 of the shift amount. It weights 21 = 2.
    Setting that bit shift at least 2 bits.
  • shift(2) is the bit2 of the shift amount. It weights 22 = 4.
    Setting that bit shift at least 4 bits.

When shifting the incoming bits must be set to zero for logical shifts ( 01001101 shifted left by 3 becomes 01101000) and that's the reason for those zeros.

The circuit (a barrel shifter) basically decomposes a shift amount into a sum of powers of two (e.g. 5 as 1 + 4) so that any amount in the range 0-7 (3-bit of a number) can be done using a fixed arrangement of wires in one clock.
A SISO (Serial In, Serial Out) register would require multiple clock cycles.

zx485
  • 28,498
  • 28
  • 50
  • 59
Margaret Bloom
  • 41,768
  • 5
  • 78
  • 124