Thank you for being annoyed. I thought I was the only one who
was bothered by this.

8-) Barry

At 07:26 AM 1/15/03 -0700, Micro Eng wrote:
>Just pondering this on my way to work...after being annoyed by some of the
>new LED based taillights
>
>If you want to vary the brightness of an LED, would it be better to vary the
>voltage, say a PWM circuit driving a voltage-follower transitor, or adjust
>the circuit voltage (ie the resistor using a digital pot) ?

At 06:21 PM 1/15/03 -0600, you wrote:
>On Wed, 15 Jan 2003, Barry Gershenfeld wrote:
>
> > Thank you for being annoyed. I thought I was the only one who
> > was bothered by this.
>
>What about these new lights annoys you? I thought they were pretty cool,
>and frankly am suprised they didn't emerge earlier. Do you feel they're
>too bright? Just don't like 'em?

They are too directional, the brightness is too bright right on the
axis and dim off the axis. I saw some really neat LED-look incandescent
tail lamps on a KIA SUV or truck. The effect was as a result of the
design of the acrylic lens, it looks like large number of LEDs arranged
as radiating spokes.

It works by computing all the subproducts that have the same significance in
the output at the same time and then summing them:

First we need our values:

NSize = 32 ; Test case = 512 bits

cblock ?
A:MSize ; args
B:NSize
R:NSize+NSize ; result (the +1 byte will be zeroed!)
HITEMP ; temp for hi byte of current multiply group
endc

Note: values are stored 'little endian'

HugeMultiply:

; Do the first operation to get things started.

movf A+0,W
mulwf B+0
movff PRODL,R+0
movff PRODH,R+1

; Get ready to continue the summation

clrf R+2
clrf HITEMP

; Do operations 2 thru NSize to compute the least significant bytes.
;
; Operation 2 multiplies the two pairs:
; A<0> by B<1> and A<1> by B<0>
; to compute R<3:2:1>
;
; Operation 3 multiplies the three pairs:
; A<0> by B<2>, A<1> by B<1> and A<2> by B<0>
; to compute R<4:3:2>
;
; The NSize'th operation multiplies the NSize pairs:
; A<0> by B<NSize-1>, A<1> by B<NSize-2> ... A<NSize-1> by B<0>
; to compute R<NSize+1:NSize:NSize-1>
;
; Note that for the I'th operation the sum of the subscript for each pair of
A and B
; bytes multipled together is I-1

LFSR 2,R+1 ; Each operation will increment FSR2
I = 2
while I <= NSize
; point at start of A
LFSR 0,A
; point at first byte of interest in B
LFSR 1,B+NSize-I
; call into the correct location within the MultiplyVector routine
; to multiply I byte pairs, accumulating them in R<FSR2+1:FSR2>
RCALL MultiplyVector + 16 * (NSize-I)
I = I + 1
endw

while I <= NSize * 2 - 2
; point at first byte of interest in A
LFSR 0,A+I-NSize
LFSR 1,B+NSize-1
; call into the correct location within the MultiplyVector routine
; to multiply 2*NSize-I byte pairs, accumulating them in R<FSR2+1:FSR2>
RCALL MultiplyVector + 16 * (NSize-(2*NSize-I))
I = I + 1
endw

; Finally the last operation to multiply together A<NSize-1> and B<NSize-1>
and
; finish up computing the result