Bus reduction

P

Patrick

Hello everybody,

I'm very embarassed to reduce the width of a data bus from 14 to 12 bits...

I tried this

CONV_12 : process (RAZ,clock_dac1)
begin
if RAZ = '0' then
I_12 <= (others=>'0');
Q_12 <= (others=>'0');
elsif (clock_dac1'event and clock_dac1='1') then
I_12 <= I_filt(11 downto 0);
Q_12 <= Q_filt(11 downto 0);
end if;
end process CONV_12;

But like I_filt is signed, I forgot the sign in I_12 !!

Is there any theory about this ?

Thanks...
 
E

Egbert Molenkamp

I do not know which packages you are using but in case you use numeric_std
you have a function that can be used to resize objects of type unsigned and
type signed.
In your case where the length of the signed vector is reduced from 14 to 12
bits the sign bits will be the same:
I_12 <= resize(I_filt,12);

Egbert Molenkamp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top