{"id":331,"date":"2023-05-26T17:09:40","date_gmt":"2023-05-26T15:09:40","guid":{"rendered":"https:\/\/bowfinger.de\/blog\/?p=331"},"modified":"2023-05-26T17:09:41","modified_gmt":"2023-05-26T15:09:41","slug":"interesting-details-of-ieee-fixed_pkg","status":"publish","type":"post","link":"https:\/\/bowfinger.de\/blog\/2023\/05\/interesting-details-of-ieee-fixed_pkg\/","title":{"rendered":"Interesting details of ieee.fixed_pkg"},"content":{"rendered":"\n<p>Today I learned that in order to assign a negative <code>sfixed<\/code> (signed fixed-point) signal or variable to another signal or variable, I have to use <code>resize<\/code>. <\/p>\n\n\n\n<pre title=\"VHDL-2008 example of assigning a negated sfixed value to another.\" class=\"wp-block-code\"><code class=\"\">process\n    variable x0: sfixed(7 downto -8) := to_sfixed(1, 7, -8);\n    constant val: sfixed(7 downto -8) := to_sfixed(10, 7, -8);\nbegin\n    -- does not work:\n    x0 := -val;\n    \n    -- this does work:\n    x0 := resize(-val, x0);\nend process;<\/code><\/pre>\n\n\n\n<p>So, it seems, internally this is an actual multiplication and not a manipulation on the signed value.<\/p>\n\n\n\n<p>This holds for GHDL 3.0 using the VHDL-2008 standard. No idea yet what other tools do with this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I learned that in order to assign a negative sfixed (signed fixed-point) signal or variable to another signal or variable, I have to use resize. So, it seems, internally this is an actual multiplication and not a manipulation on the signed value. This holds for GHDL 3.0 using the VHDL-2008 standard. No idea yet&hellip;<\/p>\n","protected":false},"author":1,"featured_media":334,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[40,84],"tags":[41,87,86,85],"class_list":["post-331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fpga","category-vhdl","tag-fpga","tag-ghdl","tag-vhdl","tag-vhdl-2008"],"_links":{"self":[{"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":2,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/posts\/331\/revisions"}],"predecessor-version":[{"id":333,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/posts\/331\/revisions\/333"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/media\/334"}],"wp:attachment":[{"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/media?parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/categories?post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bowfinger.de\/blog\/wp-json\/wp\/v2\/tags?post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}