K
Kevin Neilson
Guest
In Verilog-2001, there is signed number support. However, I'm not sure what
any of it actually does. You can declare registers as signed, but I don't
know how they are treated differently. You can assign a number a signed
value, like 16'shFF, but I don't know how that is different that assigning
16'hFF. I don't think it's possible, even with the new features, to assign
negative numbers to a register, like A <= -16'shAB.
There are also the $signed and $unsigned functions, but I can't see that
they work. I have a signed number that I want to output to a DAC, so I
used the $unsigned function, but Synplify seemed to ignore it even though
the feature is supported. (I implemented the feature by hand by inverting
the sign bit to make an unsigned number.)
The only new feature I can see that does anything is the arithmetic right
shift, or >>>. This is a syntactically nice way of shifting a number and
sign-extending it. But other than that, what do all the other features do?
-Kevin
any of it actually does. You can declare registers as signed, but I don't
know how they are treated differently. You can assign a number a signed
value, like 16'shFF, but I don't know how that is different that assigning
16'hFF. I don't think it's possible, even with the new features, to assign
negative numbers to a register, like A <= -16'shAB.
There are also the $signed and $unsigned functions, but I can't see that
they work. I have a signed number that I want to output to a DAC, so I
used the $unsigned function, but Synplify seemed to ignore it even though
the feature is supported. (I implemented the feature by hand by inverting
the sign bit to make an unsigned number.)
The only new feature I can see that does anything is the arithmetic right
shift, or >>>. This is a syntactically nice way of shifting a number and
sign-extending it. But other than that, what do all the other features do?
-Kevin