Subject: Determining the shape of the intake pulse.
From: Rotary Engine
Date: 7/15/2005, 1:02 PM
To: AA-me


BTW This is for all you assemble language programmers out there
doing your own EFI system design.

If memory serves me correctly... if you take eight 10 bit (1024
decimal)
equally spaced samples during the time the intake port is open
and add them up that is 8,192 or a 13 bit number. No problem as most
microcomputers deal in 16 bits these days. If you then shift
one bit right four times (same as dividing by four) you will
then be back to a 10 bit number which should be roughly proportional
to the
total amount of air in the intake port. No need for any floating point
math.

10 bits 1024
11 bits 2048
12 bits 4096
13 bits 8192

Paul Lamar

Part One is correct:
... if you take eight 10 bit (1024 decimal) equally spaced samples
during the time the intake port is open and add them up that is 8,192
or a 13 bit number.

Which leads to Part Two, which is incorrect:
... If you then shift one bit right four times (same as dividing by
four) ...

----------------------------------------------------------
This would be dividing by 16.  Right shifting division:
/2  = first r-shift
/4  = second r-shift
/8  = third r-shift
/16 = fourth r-shift

To average samples:
If you added 2 numbers, right shift ONCE to divide by 2.
If you added 4 numbers, right shift TWICE to divide by 4.
If you added 8 numbers, right shift THREE TIMES to divide by 8.

*****

If you are going to average samples as a way of "integrating the
signal", then it makes sense to use a "power of 2" number of samples
(2^n samples).  That way division can be performed simply, and very
fast, by right-shifting.  It's fast even with very slow microprocessors.

Example:
1) 00001100 binary = 12 decimal
2) Right-shift to divide by two
3) 00000110 binary = 6 decimal

FWIW.

-Vince Orton


Then Vince sent this message quoting Russell  ------------


Oh so close.  Paul is describing simple 16-bit integer statistics
...
Unfortunately Paul wrote:
     Sum 8 integers
     8 is 2^3 so
     Right shift the sum *4* bits . . .OOPS!
...
Russell Kent


I really need to read ALL posts before responding.  I see that Russell
already addressed this.  Sorry for the noise.

-Vince Orton

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

No problem Vince.  Always good to read "In other words."

In case someone did not get it the first or second time.

Paul Lamar


-- 
The Rotary Engine NewsLetter.  Powered by Linux.
ACRE NL web site. http://www.rotaryeng.net
Copyright 1998-2005 All world wide rights reserved.