Sum of n numbers 0..1

user_at_domain.invalid
Date: 10/21/04

  • Next message: Ernest: "Multiple errors recognition"
    Date: Thu, 21 Oct 2004 12:08:00 +0200
    
    

    There are n inputs, each having value 0 or 1, and I need to
    calculate the number of 1s (i.e. take the sum of n numbers
    in the range 0..1) and have the output in binary.
    The number n may be very high, thousands, tens of thousands.
    What are the smallest and most efficient circuits/formulas
    for doing this?
    (n inputs and about log2 n outputs for the sum in binary.)

    Alternatively, I just want to know whether the sum exceeds some
    threshold k with 0 <= k < n.

    Best regards,

    Jussi R.


  • Next message: Ernest: "Multiple errors recognition"

    Relevant Pages

    • Re: 50+50+17.5%=117.5
      ... If the government puts a 17.5% tax on every 100 pennies I spend at the point ... Regards ... >> Yep, my problem is that simple, I don't know how to put the sum above ...
      (microsoft.public.excel)
    • Re: 50+50+17.5%=117.5
      ... to buy something for 100 pennies I will need 117.5 penies. ... >>> Yep, my problem is that simple, I don't know how to put the sum above ... >>> Regards ... Dave Peterson ...
      (microsoft.public.excel)
    • Re: Code for SUM with duel criteria
      ... Regards, ... Tom Ogilvy wrote in message ... >> then sum the value. ... >> I can do it for one criteria but not for the two criteria. ...
      (microsoft.public.excel.programming)
    • Re: need to narrow down value
      ... and got the error: ORA-00909: invalid number of arguments ... Also, argument of SUM() may be an expression, but not the list. ... Best regards ... However, i wonder, how can one work with Oracle without having access to Oracle documentation. ...
      (comp.databases.oracle.server)
    • Re: Hourly volume calculation
      ... Best regards. ... "Tom Ellison" wrote: ... field consisting multiple volume entries. ... I need to sum up the volumes by ...
      (microsoft.public.access.queries)