Forum Discussion
Altera_Forum
Honored Contributor
15 years agoAre only MSBs outputted if bits are restricted?
Hi, Suppose I have a complex multiplier from the MegaWizard with inputs having 16 bits each and the outputs also having 16 bits. Because 16*16 equals 32 bits, would restricting the output to 16...
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- Suppose the 32-bit output is "00000011010100100000111100001010"...how would you ignore the first 6 0-bits and then output the 16 MSB "1101010010000011"? --- Quote End --- I think the thread has gone off track. It is very unrealistic supposition. Why multiply then discard 6 MSBs. It is more realistic to discard one or two bits.
-- discarding two MSBs
if data(31) = data(30) and data(31) = data(29) then
data_out <= data(29 downto 14);
elsif data(31) = '0' then
data_out <= x"7FFF";
else
data_out <= x"8001";
end if;