Forum Discussion

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

16 bit vhdl multiplication

I am doing my engineering project based on 16-bit FIXED POINT ARITHMETIC USING VHDL,so i need a VHDL code for 16 bit vhdl binary multiplication..?

please anyone post me the vhdl code for the above topic..,

7 Replies

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

    Here you go:

    
    signal a : unsigned(31 downto 0);
    signal b,c : unsigned(15 downto 0);
    a <= b *c;
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    sir can you please post the full program for 16 BIT MULTIPLICATION IN VHDL, i find it tough creating the code comparing to verilog ..please sir ..i am eagerly waiting for your post ..,need to complete this task as early as possible,

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

    This is the full program. the * operator is a perfectly valid way of doing a multiplication in VHDL.

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

    here you go - a 16 bit multiplier module:

    
    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;
    entity mult_16 is
    port (
      a,b : in  unsigned(15 downto 0);
      c   : out unsigned(31 downto 0)
    );
    end entity mult_16
    architecture rtl of mult_16 is
    begin
      c <= a * b;
      
    end architecture rtl;
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    sir the one you hav posted is a simple code..,i expect a 16 bit BINARY MULTIPLICATION code..,plzz help me sir

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

    But this code does do 16 bit multiplication. Why would I do anything else? Its worked fine for me for over 8 years (and for many other people for many years before that).

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

    @pop parithi - I'm only a VHDL newbie but I assure you that the answer really is as simple as shown above.

    Two 16 bit unsigned values, "b" and "c", are multiplied and stored into a 32 bit unsigned value, "a".

    Perhaps if you could explain what it is that you believe is missing from the answers above, the Gurus could help you further. Is it that the values are defined as integers, and you are looking for fixed point reals? If so, some lateral thinking and your favourite search engine might be useful.