Skip to content

Commit

Permalink
Merge pull request #253 from mrberman87/AFix-QFormat-Example
Browse files Browse the repository at this point in the history
Update AFix.rst
  • Loading branch information
Dolu1990 authored Apr 30, 2024
2 parents 29e24f1 + 8db54f2 commit 8d2014c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions source/SpinalHDL/Data types/AFix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ AFix can be created using bit sizes or exponents:

.. code-block:: scala
AFix.U(12 bits) // U12.0
AFix.UQ(8 bits, 4 bits) // U8.4
AFix.U(8 exp, 12 bits) // U8.4
AFix.U(8 exp, -4 exp) // U8.4
AFix.U(8 exp, 4 exp) // U8.-4
AFix.S(12 bits) // S11 + sign
AFix.SQ(8 bits, 4 bits) // S8.4 + sign
AFix.S(8 exp, 12 bits) // S8.3 + sign
AFix.S(8 exp, -4 exp) // S8.4 + sign
AFix.U(12 bits) // U12.0
AFix(QFormat(12, 0, false)) // U12.0
AFix.UQ(8 bits, 4 bits) // U8.4
AFix.U(8 exp, 12 bits) // U8.4
AFix.U(8 exp, -4 exp) // U8.4
AFix.U(8 exp, 4 exp) // U8.-4
AFix(QFormat(12, 4, false)) // U8.4
AFix.S(12 bits) // S11.0 + sign
AFix(QFormat(12, 0, true)) // S11.0 + sign
AFix.SQ(8 bits, 4 bits) // S8.4 + sign
AFix.S(8 exp, 12 bits) // S8.3 + sign
AFix.S(8 exp, -4 exp) // S8.4 + sign
AFix(QFormat(12, 4, true)) // S7.4 + sign
These will have representable ranges for all bits.
Expand Down

0 comments on commit 8d2014c

Please sign in to comment.