Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Errors in runing my codes in Quartus2

Dear all. I really appreciate your time in advance. It is the first time I am using this Quartus v2 software. I wrote the following codes in it but it gives me some errors when I run it. Could you please help me? here is my codes:

entity sensor is

port ( neededtemperature, realtemperature : IN integer range 0 to 100;

heater: out bit);

end entity sensor;

architecture behave of sensor is

begin

controlsystem: process (realtemperature , neededtemperature)

begin

if realtemperature < neededtemperature 2 then

heater <= '1';

elsif realtemperature > neededtemperature 2 then

heater <= '0';

end if;

end process controlsystem;

end architecture behave;

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi there,

    at least this are the syntax errors - while it compiles now, no guarantee it does what you intended...

    entity sensor is

    port ( neededtemperature, realtemperature : IN integer range 0 to 100;

    heater: out bit);

    end entity sensor;

    architecture behave of sensor is

    begin

    controlsystem: process (realtemperature , neededtemperature)

    begin

    if realtemperature < neededtemperature then

    heater <= '1';

    elsif realtemperature > neededtemperature then

    heater <= '0';

    end if;

    end process controlsystem;

    end behave;

    regards