24 bit signed multiplier

Discussion in 'VHDL' started by Nemesis, May 26, 2005.

  1. Nemesis

    Nemesis Guest

    I'm trying to write a signed Multiplier in VHDL.
    I wrote the code and synthesized it with ISE6.3 but it is to slow
    for what I need, the synth. report says that the maximum clock speed
    is 84MHz on a xcv2p50-5 target, I'd need something close to 128 MHz.
    I also found some odd things, the report say that the XST inferred
    4 MULT18x18s blocks, but I would have expected that 2 block were
    sufficient.
    Moreover the clock pin of the MULT18x18s block is unconnected (or at
    least it seems to be looking at the "RTL Schematic View"), so why it
    didn't used a simple MULT18x18 (asynchronous)?

    Here is the VHDL code I wrote, please let me know if you have ideas
    to improve the speed.

    **********************multiplier.vhd*******************************
    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;

    entity multiplier is
    port (
    A : in std_logic_vector(23 downto 0);
    B : in std_logic_vector(23 downto 0);
    CLK : in std_logic;
    RESET : in std_logic;
    MULT : out std_logic_vector(47 downto 0)
    );
    end multiplier;

    architecture Behavioral of multiplier is
    signal A_signed : signed (A'high downto 0);
    signal B_signed : signed (B'high downto 0);
    begin
    ----------------------------------------------------------------
    process (CLK,RESET,A,B)
    --variable A_signed : signed (A'high downto 0);
    --variable B_signed : signed (B'high downto 0);
    variable MULT_signed : signed (A'high+B'high+1 downto 0);
    begin
    if RESET='1' then
    MULT <= ( others => '0');
    elsif rising_edge(CLK) then
    A_signed <=signed(A);
    B_signed <=signed(B);
    MULT_signed := A_signed * B_signed;
    MULT <= std_logic_vector(MULT_signed);
    end if;
    end process;
    ----------------------------------------------------------------
    end Behavioral;
    **********************multiplier.vhd*******************************
     
    Nemesis, May 26, 2005
    #1
    1. Advertising

  2. Nemesis

    Neo Guest

    Think about it. in any multipliction if you factor the multiplcand and
    the multiplier in then you'll have four effective multiplications to be
    done. thats why you have 4 mutipliers. The timing is not what you want
    because you have no pipelining there. the multiplication is done in a
    single clock cycle. instead if you split it into say, 3 clock cyles
    then you will drastically improve the frequency. you can specify this
    while instantiating the block multipliers.
     
    Neo, May 26, 2005
    #2
    1. Advertising

  3. Nemesis

    Nemesis Guest

    Neo wrote:

    > Think about it. in any multipliction if you factor the multiplcand and
    > the multiplier in then you'll have four effective multiplications to be
    > done. thats why you have 4 mutipliers.


    Thanks, now it's clear.

    > The timing is not what you want
    > because you have no pipelining there. the multiplication is done in a
    > single clock cycle. instead if you split it into say, 3 clock cyles
    > then you will drastically improve the frequency. you can specify this
    > while instantiating the block multipliers.


    That's not true, even if I didn't specified the pipiling XST has
    automatically created a multiplier with 3 pipeline stage. Now I'm doing
    tests with the Multiplier Core, with the basic settings I obtain the
    same timings (84MHz), if I set the core to use the "Maximum Pipelin" at
    least I reach 149MHz.
    But if I don't select the "Asynchronous Clear" then the spead goes up
    (but only in the case of "Maximum Pipeline"), I got 234MHz.
    I also saw that if I use luts instead of MULT18x18 the speed is higher,
    is there a way to obtain a lut based multiplicator without using the
    Core?
    I'd like to keep the VHDL code for portability issues.
     
    Nemesis, May 26, 2005
    #3
  4. "Nemesis" <> wrote in message
    news:...
    > I'm trying to write a signed Multiplier in VHDL.
    > I wrote the code and synthesized it with ISE6.3 but it is to slow
    > for what I need, the synth. report says that the maximum clock speed
    > is 84MHz on a xcv2p50-5 target, I'd need something close to 128 MHz.
    > I also found some odd things, the report say that the XST inferred
    > 4 MULT18x18s blocks, but I would have expected that 2 block were
    > sufficient.
    > Moreover the clock pin of the MULT18x18s block is unconnected (or at
    > least it seems to be looking at the "RTL Schematic View"), so why it
    > didn't used a simple MULT18x18 (asynchronous)?
    >
    > Here is the VHDL code I wrote, please let me know if you have ideas
    > to improve the speed.
    >
    > **********************multiplier.vhd*******************************
    > library ieee;
    > use ieee.std_logic_1164.all;
    > use ieee.numeric_std.all;
    >
    > entity multiplier is
    > port (
    > A : in std_logic_vector(23 downto 0);
    > B : in std_logic_vector(23 downto 0);
    > CLK : in std_logic;
    > RESET : in std_logic;
    > MULT : out std_logic_vector(47 downto 0)
    > );
    > end multiplier;
    >
    > architecture Behavioral of multiplier is
    > signal A_signed : signed (A'high downto 0);
    > signal B_signed : signed (B'high downto 0);
    > begin
    > ----------------------------------------------------------------
    > process (CLK,RESET,A,B)
    > --variable A_signed : signed (A'high downto 0);
    > --variable B_signed : signed (B'high downto 0);
    > variable MULT_signed : signed (A'high+B'high+1 downto 0);
    > begin
    > if RESET='1' then
    > MULT <= ( others => '0');
    > elsif rising_edge(CLK) then
    > A_signed <=signed(A);
    > B_signed <=signed(B);
    > MULT_signed := A_signed * B_signed;
    > MULT <= std_logic_vector(MULT_signed);
    > end if;
    > end process;
    > ----------------------------------------------------------------
    > end Behavioral;
    > **********************multiplier.vhd*******************************


    Hi,

    Just a note: the asynchrounous clear of your multiplication will prevent the
    use of the pipelined Xilinx multipliers because their register has only a
    synchrounous reset.

    Kind regards,
    Alvin.
     
    Alvin Andries, May 26, 2005
    #4
  5. Nemesis

    Nemesis Guest

    Alvin Andries wrote:

    > Hi,
    >
    > Just a note: the asynchrounous clear of your multiplication will prevent the
    > use of the pipelined Xilinx multipliers because their register has only a
    > synchrounous reset.


    I tried also with a synchronous reset and without the reset, but
    nothing changed.
     
    Nemesis, May 26, 2005
    #5
  6. Nemesis

    james Guest

    On 26 May 2005 03:48:05 -0700, "Nemesis" <> wrote:

    >I also saw that if I use luts instead of MULT18x18 the speed is higher,
    >is there a way to obtain a lut based multiplicator without using the
    >Core?

    *****

    Check constraint guides for the particular FPGA. In the Virtex line,
    Xilinx allows the selection of auto, block, or Lut. Not sure about the
    Spartan 3. In the Spartan 2 all multipliers are lut based.

    james
     
    james, May 31, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. 2 bit multiplier

    , Apr 12, 2005, in forum: VHDL
    Replies:
    6
    Views:
    13,130
    sergio
    Jun 11, 2013
  2. anil
    Replies:
    2
    Views:
    1,629
    HT-Lab
    Jan 28, 2007
  3. Kevin Neilson
    Replies:
    3
    Views:
    774
    Kevin Neilson
    Aug 25, 2008
  4. Fore
    Replies:
    29
    Views:
    15,276
    Rashad
    Sep 21, 2008
  5. charko
    Replies:
    2
    Views:
    623
    charko
    May 7, 2010
Loading...

Share This Page