error in simulation of floating point adder

Discussion in 'VHDL' started by mostafa.khairy, Nov 13, 2009.

  1. mostafa.khairy

    mostafa.khairy

    Joined:
    Nov 13, 2009
    Messages:
    1
    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
     
    mostafa.khairy, Nov 13, 2009
    #1
    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. wallge
    Replies:
    0
    Views:
    1,427
    wallge
    Feb 20, 2006
  2. H aka N
    Replies:
    15
    Views:
    15,724
    Ben Jones
    Mar 2, 2006
  3. Motaz Saad
    Replies:
    7
    Views:
    6,515
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,374
    Saraswati lakki
    Jan 6, 2012
  5. teeshift
    Replies:
    2
    Views:
    274
    Chris Pearl
    Dec 1, 2006
Loading...

Share This Page