John Drake | 3 Nov 2006 21:21
Picon
Favicon

SEAForth questions again

I've been trying to write my first SEAForth demo.
To try and exploit the parrallelism I settled on
matrix multiplication as a test program.  
I'm trying to multiply a 2 row matrix by a two
column matrix.  These are the steps I'm attempting.

1) Data initially is in node 12
2) Row1 is passed to node 18
3) Row2 is passed to node 13
4) Column1 is passed to nodes 18 and 13 
simultaneously
5) Multiplications R1*C1 and R2*C1 done simultaneously
6) Column2 is passed to nodes 18 and 13 simultaneously
7) Multiplications R1*C2 and R2*C2 done simultaneously
8) Results R1*C1, R1*C2, R2*C1, R2*C2 are returned to
   node 12

 
____________________________________________________________________________________
Get your email and see which of your friends are online - Right on the New Yahoo.com 
(http://www.yahoo.com/preview) 

John Drake | 3 Nov 2006 22:31
Picon
Favicon

SEAForth questions again

I've been trying to write my first SEAForth demo.
To try and exploit the parrallelism I settled on
matrix multiplication as a test program.  
I'm trying to multiply a 2 row matrix by a two
column matrix.  These are the steps I'm attempting.

1) Data initially is in node 12
2) Row1 is passed to node 18
3) Row2 is passed to node 13
4) Column1 is passed to nodes 18 and 13 
   simultaneously
5) Multiplications R1*C1 and R2*C1 done 
   simultaneously
6) Column2 is passed to nodes 18 and 13 
   simultaneously
7) Multiplications R1*C2 and R2*C2 done 
   simultaneously
8) Results R1*C1, R1*C2, R2*C1, R2*C2 are 
   returned to node 12

I looked at the code runvmram.f as an
example.  It uses these steps.

1) Data initially in node 12
2) Data passed through node 13 to node 14
3) Node 14 does a difference between the
   previous and current data value and passes
   result to node 15
4) Node 15 does a "running average" and passes
   result to node 16
(Continue reading)

Charles Shattuck | 5 Nov 2006 20:51

Re: SEAForth questions again

I think I can answer one of your questions.  The comments around the
definition of f*f say that it is for multiplying fixed point fractions,
not integers.  These fractions are represented, according to the
comment, as follows:

ss ifff fff ffff ffff

where ss are sign bits (not sure why there are two at this point), i is
an integer, either 0 or 1, and the f's are the bits that represent a
fraction.  For example, the number $8000 would represent 1.0.  $4000
would represent 0.5.  $2000 would be 0.25.  When you multiplied 2 by 5
you were really multiplying a very small fraction by another very small
fraction, and the answer was so small that it was truncated to zero.

I added this:

: asFraction ( num den - fraction) $8000 rot rot */ ;

to help me enter fractions and watch the results of f*f.  This
definition needs to come outside the 'machine' '[' pair, it is not
machineforth.  It is used as follows:

machine
: test-f*f
   [ 1 2 asFraction ]# [ 1 2 asFraction ]# . .
   f*f test-f*f -;

You should see $4000 (0.5) pushed onto the data stack twice, and the
result of f*f is $2000, meaning 0.25.

(Continue reading)

John Drake | 6 Nov 2006 17:51
Picon
Favicon

Re: SEAForth questions again


--- Charles Shattuck <cshattuck <at> surewest.net> wrote:

> I think I can answer one of your questions.  The
> comments around the
> definition of f*f say that it is for multiplying
> fixed point fractions,
> not integers.  These fractions are represented,
> according to the
> comment, as follows:
>
> ss ifff fff ffff ffff
> 
> where ss are sign bits (not sure why there are two
> at this point), i is
> an integer, either 0 or 1, and the f's are the bits
> that represent a
> fraction.  For example, the number $8000 would
> represent 1.0.  $4000
> would represent 0.5.  $2000 would be 0.25.  When you
> multiplied 2 by 5
> you were really multiplying a very small fraction by
> another very small
> fraction, and the answer was so small that it was
> truncated to zero.

Thanks!  I guess this is another example of "when
all else fails, read (and understand) the comments."
I looked it the comp.lang.forth archives where
Jeff had explained the F21 multiply step and the
(Continue reading)

John Drake | 14 Nov 2006 21:42
Picon
Favicon

Question. Best place for VentureForth posts?

Hello all.  I've been experimenting a bit with
VentureForth lately (more so than with ColorForth)
and I was wondering which list is best for posting
about what I'm doing?  Is everyone here subscribed
to the NOSC and machineforth lists?  Also which
list is better between the two?  According to
http://www.ultratechnology.com/maillist.htm 
NOSC seems to be about design issues and 
machineforth about programming, but with 
programming and chip design being so intertwined
with NOSC chips (especially the SEAForth) I don't
see how you can seperate the two.  (Or am I
thinking about this too much?)

Regards,

John M. Drake

 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

Roger Ivie | 15 Nov 2006 02:57
Favicon

Re: Question. Best place for VentureForth posts?

On Tue, 14 Nov 2006, John Drake wrote:
>  Is everyone here subscribed
> to the NOSC and machineforth lists?

Machineforth definitely, NOSC, I think so. I saw your post about the 
initial blog entry come through on the machineforth list. I'm looking 
forward to reading the rest of your adventures.
--

-- 
roger ivie
rivie <at> ridgenet.net


Gmane