Re: [myhdl-list] shadow signal signals signed instead of unsigned
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2015-02-06 18:46:07
|
<snip> > After seeing the posting by Raman Muthukishnan > On shadow signals how would you modify the code to have an array of signed signals rather than unsigned. <snip> In [35]: x = Signal(intbv(-7, min=-32, max=32)) # bit access In [36]: x[4:0] Out[36]: intbv(9L) In [37]: x[4:0].signed() Out[37]: -7L # shadow signal In [39]: x(4,0) Out[39]: Signal(intbv(9L)) In [40]: x(4,0).signed() Out[40]: -7L Note, you would want to make the shadow signal: slc = x(4,0) and then when assigning get the signed vers #... y = slc.signed() Hope that helps, Chris |