Sum of element array

Discussion in 'VHDL' started by VHDL_HELP, Mar 13, 2007.

  1. VHDL_HELP

    VHDL_HELP Guest

    hi every body ,

    please how to calculate the sum of array elements .
    for example an array of 5 elements with type std_logic_vector(3 down
    to 0) .
    thank you
     
    VHDL_HELP, Mar 13, 2007
    #1
    1. Advertisements

  2. VHDL_HELP

    Guest

    How about this?

    sum<= array(0) + array(1) + array(2) + array(3)+array(4);

    regards
    Anupam Jain
     
    , Mar 15, 2007
    #2
    1. Advertisements

  3. VHDL_HELP

    alireza95

    Joined:
    Jun 28, 2018
    Messages:
    2
    Likes Received:
    0
    what about n elements ?
     
    alireza95, Jun 28, 2018
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.