Re: [myhdl-list] fixed-point thoughts : part one
Brought to you by:
jandecaluwe
From: Martin T. <mar...@tr...> - 2013-08-23 12:08:08
|
Christopher Felton <chr...@gm...> writes: <snip> This sounds like an excellent addition to MyHDL's capabilities... > Example: > s : sign bit > i : integer bits > f : fractional bits > > siii.ffff > I have in the past needed values of this form: s0.00fff i.e. three bits of precision representing a small range either side of zero when using Xilinx System Generator there was not a convenient way to represent them using their fixed-point types other than using integers and remembering to shift them. It would be nice if your proposal could represent these types of numbers too. Would an initialiser of this form work I wonder? x = fixbv(0.033, min=-0.25, max=0.25, res=0.001) Cheers, Martin -- mar...@tr... TRW Conekt - Consultancy in Engineering, Knowledge and Technology http://www.conekt.co.uk/capabilities/39-electronic-hardware |