+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 4
    Points: 1,343, Level: 8

    Join Date
    Dec 2011
    Posts
    70
    Helped
    0 / 0
    Points
    1,343
    Level
    8

    Quartus not show the port size correctly

    There is a entity with 32 bit integers and the simulations on active-hdl student edition works fine. On Quartus however, I see that the port sizes are 5 which is shown as [4..0]. Please see the picture which I highlighted that.

    Code:
    package types is				 
    	constant bitWidth: integer := 32;
    end;
    entity cmp is 
    	port (x, y: in integer range 0 to bitWidth-1;
    		  s, b: out integer range 0 to bitWidth-1);
    end;
    What does that mean?

    •   Alt15th June 2017, 23:12

      advertising

        
       

  2. #2
    Super Moderator
    Points: 26,817, Level: 39
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    6,096
    Helped
    1495 / 1495
    Points
    26,817
    Level
    39

    Re: Quartus not show the port size correctly

    You don't seem to understand that you have defined the range of x, y, s, and b as 0 to 31. So the values of x, y, s, and b can only be 0-31 which means they only need to be 5-bits wide, i.e. 00000-11111.

    The constant being named bitWidth is poorly named. It's more of a endOfRange or maxValue, etc.


    1 members found this post helpful.

    •   Alt16th June 2017, 02:57

      advertising

        
       

  3. #3
    Advanced Member level 5
    Points: 33,920, Level: 44
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,209
    Helped
    1816 / 1816
    Points
    33,920
    Level
    44

    Re: Quartus not show the port size correctly

    Quartus has done its job exactly as you specified..
    If you want 32 bit integers, then remove the range specification from the ports.

    PS. Integers are limited to 32 bit integers in quartus an modelsim, so you cannot have integer range 0 to 2^32-1. Integers max out at 2^31-1


    1 members found this post helpful.

--[[ ]]--