0

I recently came across this answer on stackoverflow.

With Verilog, once you take a part-select, the result is unsigned. Use the $signed system task on the part select to make it signed.

Is this method synthesizable (ie the system task $signed)

If it is not synthesizable, is there a different way to perform arithmetic shift on variables like a <= a>>>2 (this should give the quotient when a is divided by 4).

Parth K
  • 587
  • 5
  • 18

1 Answers1

0

It certainly is synthesizable. Whether your particular tool supports it is another question.

You can also use a cast in SystemVerilog.

res = signed'(registers[0][0]) >>> 2;
dave_59
  • 39,096
  • 3
  • 24
  • 63