Electrical – syntax error near if in VHDL

errorvhdl

Hi I am trying to write a code in VHDL and I get syntax error near "end" / "if". I am not very good at nested if statements and have not figured out how to close those if statements in what order due to lack of internet sources. I am pretty sure that errors I receive are due to if statements, especially due to those which are not properly closed. How can I overcome this problem and continue my project? Here is a code segment I am getting error from. I wrote //ERROR HERE// to denote where an error occurs.

    SHOW : process (clk, rst) is
    begin  -- process SHOW
    if rst = '1' then
    processed_pic <= def_pic;
    cursor_pos_x <= 0;
    cursor_pos_y <= 0;
    elsif clk'event and clk = '1' then
    if (visible = '1') and ( pos_x < 250) and (pos_y <250) and (pos_x > -1) 
    and (pos_y > -1) then
    if((pos_y = cursor_pos_y) and ((pos_x > cursor_pos_x -1) or (pos_x < 
    cursor_pos_x + height ))) or ((pos_y = cursor_pos_y + height -1) and 
    ((pos_x > cursor_pos_x -1) or (pos_x < cursor_pos_x + height))) then
    vgaData <= "00000000000";
            data_r <= vgaData(3*COLOR_BIT-1 downto 2*COLOR_BIT);
            data_g <= vgaData(2*COLOR_BIT-1 downto COLOR_BIT);
            data_b <= vgaData(COLOR_BIT-1 downto 0)

   //ERROR HERE// if ((pos_x = cursor_pos_x) and ((pos_y > cursor_pos_y - 1) or (pos_y < 
    cursor_pos_y + height))) or ((pos_x = cursor_pos_x + height -1) and 
    ((pos_y > cursor_pos_y - 1) or (pos_y < cursor_pos_y + height))) then
    vgaData <= "00000000000";
            data_r <= vgaData(3*COLOR_BIT-1 downto 2*COLOR_BIT);
            data_g <= vgaData(2*COLOR_BIT-1 downto COLOR_BIT);
            data_b <= vgaData(COLOR_BIT-1 downto 0)
    //ERROR HERE //end if;
    else       
            vgaData <= processed_pic(pos_x,pos_y);
            data_r <= vgaData(3*COLOR_BIT-1 downto 2*COLOR_BIT);
            data_g <= vgaData(2*COLOR_BIT-1 downto COLOR_BIT);
            data_b <= vgaData(COLOR_BIT-1 downto 0)
    //ERROR HERE //if ((pos_x > 249) and (pos_y > -1)) or ((pos_y > 249) and ((pos_x > -1) 
    or (pos_x < 250))) then
            vgaData <= "000000001111"; -- mavi
            data_r <= vgaData(3*COLOR_BIT-1 downto 2*COLOR_BIT);
            data_g <= vgaData(2*COLOR_BIT-1 downto COLOR_BIT);
            data_b <= vgaData(COLOR_BIT-1 downto 0);
    end if;
    end if;
    end if;
    end process SHOW;

Best Answer

Each of the lines preceding an error is missing a semicolon at the end, e.g.

data_b <= vgaData(COLOR_BIT-1 downto 0)
                                      ^^^