best way to perform multiplies in vhdl

Oct 02, 2004 1 Replies

i am trying to implement an image convolution filter that has negative values in it on a spartan IIe fpga. So i need to perform (for instance) A*B + C*D where A,B,C,D are all signed numbers in the ieee std logic int range. what is the best way to implement this? It seems that the way i am doing it now (using std_logic_vector) fails for negative values of the filter coeffs. can anyone give a suggestion how to fix this (the best way to code it in vhdl). What is the best way to do a numerical comparison (ie. A < B in vhdl (that is also synthesizeable), where A,B are signed integers)


thanks


Geoffrey Wall Masters Student in Electrical/Computer Engineering Florida State University, FAMU/FSU College of Engineering wallge@eng.fsu.edu Cell Phone: 850.339.4157 ECE Machine Intelligence Lab http://www.eng.fsu.edu/mil MIL Office Phone: 850.410.6145 Center for Applied Vision and Imaging Science http://cavis.fsu.edu/ CAVIS Office Phone: 850.645.2257

Use the "numeric_std" type "signed" to represent the numbers. Then multiply them together.

Same thing, just use the "

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required