- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i want to resize a sfixed number of size(9 downto -6) to sfixed/signed of size (9 downto 0):
here's the code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; library ieee_proposed; use ieee_proposed.fixed_pkg.all; USE ieee.numeric_std.all; ENTITY dwt IS END dwt; ARCHITECTURE dwt_behaviour OF dwt IS signal k : sfixed(9 downto -6) ; signal kk : signed(9 downto 0); BEGIN k <= "1100110011000010"; kk <= signed(resize(signed(k), kk'length)); -- error line END dwt_behaviour; error is: Index value -6 (of type std.STANDARD.NATURAL) is out of range 0 to 2147483647.Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Whats wrong with just using the resize function?
signal kk : sfixed(9 downto 0); kk <= resize(k, kk ); or to convert to signed kk <= to_signed(k, kk'length);- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks it worked
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page