RobertBaruch / nmigen-tutorial

A tutorial for using nmigen
Creative Commons Attribution Share Alike 4.0 International
303 stars 34 forks source link

Right Shift operator is arithmetic for signed values #12

Closed emeb closed 3 years ago

emeb commented 3 years ago

In the "Basic Operations" section, the description of the >> operator says that it is "Logical, not arithmetic". This is only true if the shifted operand is unsigned. For signed operands the result is an arithmetic shift which preserves the sign of the input.