Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Are 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 bits output the Most Significant Bits (MSBs), i.e. would it output [31 downto 16] bits of the total 32 bits?

Also, would the above reasoning be the same for the altmult_add MegaWizard block too?

Is it common for all the Quartus arithmetic in general (to output the MSBs)?

If not, how can I force only the MSBs to be outputted?

Thank you.

11 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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;