Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > I need a function to truncate a SIGNED vector efficiently

Reply
Thread Tools

I need a function to truncate a SIGNED vector efficiently

 
 
omara007 omara007 is offline
Junior Member
Join Date: Jun 2008
Posts: 10
 
      05-21-2009
Hi Folks

I am trying to find a function that can truncate a VHDL SIGNED vector efficiently. In other words, trim the extra sign-bit duplicates (if existing) then truncate the SINGED vector to a given new length.

For example :

If the input vector that needs to be efficiently truncated is:

"11111011"

After trimming it should look like this:
"1011"

And if we want to truncate it to only 2 bits, the final result should look like this:
"10"

This allows for better truncation precision.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a signed binary number into a signed one ? Rob1bureau VHDL 1 02-27-2010 12:13 AM
signed(12 downto 0) to signed (8 downto 0) kyrpa83 VHDL 1 10-17-2007 06:58 PM
Initializing vector<vector<int> > and other vector questions... pmatos C++ 6 04-26-2007 05:39 PM
Free memory allocate by a STL vector, vector of vector, map of vector Allerdyce.John@gmail.com C++ 8 02-18-2006 12:48 AM
Efficiently creating a vector<char> which is a copy of a char[] Steven Reddie C++ 5 02-09-2004 09:54 AM



Advertisments