LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Cores > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: Michael Hordijk<hoffbrinkle@h...>
    Date: Wed Apr 20 18:43:02 CEST 2005
    Subject: [oc] Re: Operations within a vector
    Top

    "Roberto Ammendola" <roberto.ammendola@r...> wrote in message
    news:42665168.3010505@r......
    > global_b <= b(0) or b(1) or ... or b(PARAMETER-1) or b(PARAMETER);
    >
    > So, how would you calculate global_b, keeping the parametric feature in
    > your code?

    You could always use the or_reduce function in std_logic_misc if you have
    the appropriate data types, or write your own which would be similar to the
    other reply already posted:

    ---------------

    function or_reduce ( vec : std_logic_vector ) return std_logic is
    variable result : std_logic := '0';
    begin
    for i in vec'range loop
    result := result or vec(i);
    end loop;
    end function or_reduce;

    ---------------

    global_b <= or_reduce(b);

    ---------------

    That's what I do, because I'm usually not working with std_logic_vector data
    types.

    - hoffer




     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.