Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > 24 bit signed multiplier

Reply
Thread Tools

24 bit signed multiplier

 
 
Nemesis
Guest
Posts: n/a
 
      05-26-2005
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************** *****************

 
Reply With Quote
 
 
 
 
Neo
Guest
Posts: n/a
 
      05-26-2005
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.

 
Reply With Quote
 
 
 
 
Nemesis
Guest
Posts: n/a
 
      05-26-2005
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.

 
Reply With Quote
 
Alvin Andries
Guest
Posts: n/a
 
      05-26-2005

"Nemesis" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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.


 
Reply With Quote
 
Nemesis
Guest
Posts: n/a
 
      05-26-2005
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.

 
Reply With Quote
 
james
Guest
Posts: n/a
 
      05-31-2005
On 26 May 2005 03:48:05 -0700, "Nemesis" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 bit multiplier xiibweb@hotmail.com VHDL 6 06-11-2013 10:11 AM
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
32 bit floating point multiplier anil VHDL 2 01-28-2007 05:07 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd Computer Support 0 09-17-2004 08:15 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit,Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new! Ionizer Computer Support 1 01-01-2004 07:27 PM



Advertisments