Forum Discussion

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

addition of 2numbers with a "+" operator

could u please tell me whats wrong with the program below:

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

use IEEE.std_logic_arith.all;

entity part1 is

port(a: in integer range 0 to 9;

cut integer range 0 to 14);

end part1;

architecture behavioral of part1 is

begin

c<= a + 3;

end behavioral;

it gives an error. and am supposed to use only the "+" operator to complete a program ,this is like my test program .if this one works i can use this in the main program.

i am not sure abt the library packages used if thats of any help.

thanks

1 Reply

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

    --- Quote Start ---

    it gives an error

    --- Quote End ---

    Correct the syntax errors!

    cut integer range 0 to 14);
    should be

    c: out integer range 0 to 14);