EmbDev.net

Forum: FPGA, VHDL & Verilog Multiplier using Vhdl


Author: Antros48 .. (antros48)
Posted on:

Rate this post
0 useful
not useful
Hi all. I am trying to make a vhdl program about a 4bit X 3 bit 
multiplier. I have made almost all of it but i get some strange results 
when i simulate it.

Author: jeans (Guest)
Posted on:

Rate this post
0 useful
not useful
aha

Author: nightowl (Guest)
Posted on:

Rate this post
0 useful
not useful
secret code?

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
nightowl wrote:
> secret code?
Sercet simulation results?

> a 4bit X 3 bit multiplier.
Something like this?
   signal y : unsigned (6 downto 0);
   signal a : unsigned (3 downto 0);
   signal b : unsigned (2 downto 0);
 

   y <= a*b;

Author: Antros48 .. (antros48)
Posted on:
Attached files:

Rate this post
0 useful
not useful
No the code is not secret :) It is attached to this reply.
Thank you for the reply

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
> No the code is not secret :)
And the testbench?
What results do you get?

> architecture behaviour2 of multiplier4X3 is ...
Your description ist AVSOLUTY NOT a behavioural description. Ist a 
completly STRUCTURAL description. So why is the name of your architectur 
"behaviour2"?

BTW:
Why does everybody around the world write a half adder and a full adder 
and a multiplier (and even a AND gate...) on their own?
Why not just using the VHDL operators + AND *?

Author: Antros48 .. (antros48)
Posted on:
Attached files:

Rate this post
0 useful
not useful
About the name that is correct my mistake, i should change it. Now about 
the half adder etc i wanted to do it like this so i can fresh my memory 
about vhdl.
About the code i tried to changed it a little and i added a new signal 
ztemp at the end of the code. The four lines named stage0-3 are replaced 
with
stage0: fulladder4 port map (x(3 downto 0)=>k(3 downto 0), y(3 downto 0)=> l(3 downto 0),ztemp(3 downto 0)=>(z(3 downto 1)=>n(3 downto 1), z(0)=>P(1), Cout=>Cout1);
Still i get errors and i can't get it simulated like before, at all.
But here are the results of the simulation before, attached
Thank u!

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Attached files:
    multiplier.vwf (8 KB, 0 downloads)
Could you pls attach screenshots as *.gif grphics?

> Still i get errors
What sort of ones?

Author: Antros48 .. (antros48)
Posted on:
Attached files:

Rate this post
0 useful
not useful
I only have it on bmp type. Can you open it?
It keeps saying "Error (10348): VHDL type mismatch error at 
multiplier4X3.vhd(57): type of formal parameter "ztemp" does not match 
port type of value"

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
> I only have it on bmp type. Can you open it?
Yes. And you are right: it looks like complete nonsense...

Does your full adder work properly?
Whats the theory behind your multiplier?
Do you have a schematic (with your signal names in it)?

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.