← ProblemsCircuits / Sequential Logic / Shift Registers

Left/right arithmetic shift by 1 or 8

15%shift-registersvectors

Build a 64-bit arithmetic shift register with parallel load. An arithmetic right shift replicates the sign bit (q[63]) into the vacated positions instead of shifting in zeros; an arithmetic left shift is identical to a logical left shift.

  • load — load data[63:0] (priority over shifting)
  • ena — perform a shift
  • amount[1:0] selects the shift:
    • 2'b00 — shift left by 1
    • 2'b01 — shift left by 8
    • 2'b10 — arithmetic shift right by 1
    • 2'b11 — arithmetic shift right by 8

There is no reset.