Search code examples
chisel

How to use arithmetic shift operator in Chisel


Implementing a logical shift is easy using the << or >> operator, but what about arithmetic right shift (sign extension) how to do it in Chisel?

In Chisel cheat sheet it is mentioned that >> operator is used for arithmetic right shift which is the same as logical right shift operator.


Solution

  • I think the sign will be extended if the type is SInt.