an error multiple sources

Discussion in 'VHDL' started by ViaTy, Feb 27, 2008.

  1. ViaTy

    ViaTy

    Joined:
    Feb 27, 2008
    Messages:
    1
    Hi, All,
    I encounter an error when comply with MAX+PLUS II

    -- part of the code as follow: --

    architecture bhv of calculator is
    signal a,b,c,d,oper1,oper2 : std_logic_vector(3 downto 0);
    signal x,y,tmp : std_logic_vector(7 downto 0);
    signal EQ : std_logic_vector(1 downto 0);

    --- another Process ---

    Calculate:process(EQ,oper1,oper2)
    variable tmp,tmp_x,tmp_y,tmp_ans : std_logic_vector(7 downto 0);
    begin
    tmp_x<=x;
    tmp_y<=y;
    if EQ="01" then

    if oper1="1010" then --- +
    tmp:=tmp_x+tmp_y;
    elsif oper1="1011" then --- -
    tmp:=tmp_x-tmp_y;
    elsif oper1="1100" then --- x
    tmp:=tmp_x*tmp_y;
    elsif oper1="1110" then --- /
    for i in 0 to 10 loop
    if tmp_x>=tmp_y then
    tmp_ans:=tmp_ans+"00000001";
    tmp_x:=tmp_x-tmp_y;
    tmp:=tmp_ans;
    end if;
    end loop;
    end if;

    elsif EQ=10" then
    if oper1="1010" then
    tmp:=tmp_x+tmp_y;
    elsif oper2="1010" then
    tmp:=tmp_x+tmp_y;
    elsif oper2="1011" then
    tmp:=tmp_x-tmp_y;
    end if;

    elsif EQ="11" then
    if oper2="1010" then
    tmp:=tmp_x+tmp_y;
    elsif oper2="1011" then
    if tmp_x>=tmp_y then
    tmp:=tmp_x-tmp_y;
    else
    null;
    end if;
    end if;

    else
    tmp:=(others=>'0');
    tmp_x:=(others=>'0');
    tmp_y:=(others=>'0');
    tmp_ans:=(others=>'0');
    end if;

    Ans<=tmp;
    end process;

    I don't find any multiple source for it. I can't understand. Can anyone
    help me explain it? please help me. This's my last chance.:-( Thank you

    Regards
    ViaTy
    ViaTy, Feb 27, 2008
    #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. Hamed
    Replies:
    3
    Views:
    3,309
    Richard Grimes [MVP]
    Feb 15, 2004
  2. Salman Sheikh

    Address muxing from multiple sources

    Salman Sheikh, Aug 28, 2003, in forum: VHDL
    Replies:
    0
    Views:
    564
    Salman Sheikh
    Aug 28, 2003
  3. Henk De Denktenk
    Replies:
    6
    Views:
    667
    wtx@umem.com
    Dec 7, 2004
  4. sudha
    Replies:
    0
    Views:
    602
    sudha
    Jan 3, 2005
  5. priya
    Replies:
    2
    Views:
    6,455
    Duane Clark
    Sep 28, 2005
Loading...

Share This Page