Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > error in simulation of floating point adder

Reply
Thread Tools

error in simulation of floating point adder

 
 
mostafa.khairy mostafa.khairy is offline
Junior Member
Join Date: Nov 2009
Posts: 1
 
      11-13-2009
Hi all,
i'm trying to design a floating point adder using advantage pro and i simulating it using modelsim
this my code
Code:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;


ENTITY fp_adder IS
-- Declarations
port(a,b: in  std_logic_vector(31 downto 0);
	   c: out std_logic_vector(31 downto 0)
	);
END fp_adder ;

-- hds interface_end
ARCHITECTURE adder OF fp_adder IS
--declaration of sign 
signal sa,sb,sc: std_logic;
--declaration of exponent
signal ea,eb,ec: unsigned(7 downto 0);
--declaration of mantissa
signal ma,mb,mc: unsigned(22 downto 0);
BEGIN
--asignement of sign signals
sa <= a(31);
sb <= b(31);
--assignement of exponent signals
ea <= unsigned(a(30 downto 23));
eb <= unsigned(b(30 downto 23));
--assignement of mantissa signals
ma <= unsigned(a(22 downto 0));
mb <= unsigned(b(22 downto 0));
------------------------------------------------------------------------------------------------------
process(ea,eb,ec,ma,mb,mc,sa,sb,sc)
begin
	if(ea > eb)then loop
	eb <= eb+1;
	mb <= '0'& mb(7 downto 1);
	exit when ea=eb;
	end loop;
	elsif(eb > ea) then loop
	ea <= ea+1;
	ma <= '0'& ma(7 downto 1);
	exit when ea=eb;
	end loop;
	else
	mc<= ma+mb;
	ec<= ea;
	sc<=sa xor sb;
	end if;
end process;
	c(22 downto  0) <= std_logic_vector(mc);
	c(30 downto 23) <= std_logic_vector(ec);
	c(31)		    <= sc;
END adder;
and i found a problem which i couldn't recognize it
there is no error in compiling the code
but at simulation the o/p is UUUUUUUUUUUUUUUUUUUU

and there is some warnings at modelsim command window
this is the error massage
Code:
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 0  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 0  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 0  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 0  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 0  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 0  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 1  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 1  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 1  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 1  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 1  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 1  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 2  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 2  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 2  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 2  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 2  Instance: /fp_adder
# ** Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
#    Time: 0 ns  Iteration: 2  Instance: /fp_adder

can anyone kindly help me to solve the error
 
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
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
floating point problem... floating indeed :( teeshift Ruby 2 12-01-2006 01:16 AM
converting floating point to fixed point H aka N VHDL 15 03-02-2006 02:26 PM
building an adder tree for a pipelined fixed point dot product wallge VHDL 0 02-20-2006 10:34 PM
Fixed-point format for floating-point numbers Motaz Saad Java 7 11-05-2005 05:33 PM



Advertisments