Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Average in Binary Number System?

Status
Not open for further replies.

zia.newversion

Member level 5
Joined
Mar 28, 2010
Messages
83
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Pakistan
Activity points
2,188
Is there a simpler algorithm of calculating average in binary number system?
Other than adding all values up and dividing by number of values...
There must be such an algorithm. That must be how computers calculate averages...
 

No, the above algorythm is the only one method : - )
However, if we have 2 ^ n numbers (values)​​, then the fast 'shift right' instruction
can be used, instead of a dividing.
For example in case of 4 (2 ^ 2) values:
sum = v1 + v2 + v3 + v4 ; 4 numbers to add
Average = sum >> 2 ; sum/4
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top