Version 10 of bwise applications and examples

Updated 2003-03-24 08:57:29

By Theo Verelst

This page refers to bwise, which can be downloaded via Bwise - a graphical programming setup.

http://195.241.128.75/Diary/Ldi6/flipflop1.jpg See this list of my diary pages [L1 ] and more recently the local diary pages (on a secure tclhttpd based server) [L2 ] (this [L3 ] is a recent one with pictures), while this one contains Bwise:

 http://195.241.128.75//Diary/ldiary6.html#bwise.

I'll start making a list of bwise examples and applications, the first being shown above as an important gedanken experiment. Don't think eigenvalues here, we're not getting into that now.

I made a generator block for AND gate blocks on the bwise canvas, which is a block that generates new blocks when it is fired (Eval-ed). This is the command (can be executed on the console or a bwise shell) for making the generator block:

 set n 1;
 newproc "newproc \"set proc\${genproc.n}.q \\\[expr !(\\\${proc\${genproc.n}.a} && \\\${proc\${genproc.n}.b})\\\]\" proc\${genproc.n} {a b} q  ;set genproc.nlast \${genproc.n}" genproc n nlast

Which (evaluated but not executed ends up in the genproc.bfunc as:

 newproc "set proc${genproc.n}.q \[expr !(\${proc${genproc.n}.a} && \${proc${genproc.n}.b})\]" proc${genproc.n} {a b} q  ;set genproc.nlast ${genproc.n}

Which can also be seen here:

http://195.241.128.75/Diary/Ldi6/genproc1.jpg

The proc1 and proc2 blocks were made by executing 'funprop' from the block menu (middle mouse button on the yellow part of a block), which evaluates the block, passes the current proc index from genproc.nlast to tcl variable Proc1.in, evaluates the Proc1 block function that is stored in tcl variable Proc1.bfunc, which sets Proc1.out to one higher, and finally transfers this values to genproc.n, at which point the funprop functional propagator function stops because it detects it is back where it started.

Of course more basic circuits with nand circuits can be made, such as just one, for instance with an alarm sensor at the door and a window, issueing a 1 when the door or window is open, and 0 otherwise, and a buzzer or siren or silent alarm connected to the output. For that, one would need to read signals from the outside world, and one would have to periodically or when one or more of those signals changes values, recompute the outcome of the AND function, and trigger following blocks dealing with the new alarm state. Of course simply filling in values in the infowindow (use the data popup menu on the and block)

One may want to arm or disable the alarm, or one of the inputs by using another and. At this terminal, I don't have bwise running, so the connections are left as an exercise to the reader.


As an illustration of the problems that also occur in let's call it real life large scale networks, when they are supposed to aid in the computation of things in which real people have interest, let's use the bwise 0.3 supplied procedure

 newarray 5 5

which generates an array of blocks with two inputs and a certain interconnection pattern, which basically concatenates the two inputs to the output.

I added a term (inal) block to generate input and read output from the block array, and which allows one to press a button or <return> to start a funprop (functional propagate), "firing" each block as its inputs become available from previous blocks.

http://195.241.128.75//Diary/Ldi7/array55.jpg

- Canvas after creating an array, a terminal and a shell -

Look at the firing pattern to understand how computation possibility numbers increase first when block connection patterns widen, and in the end narrow down until the final block is reached.

The reverse case, where first information is gathered to one central block, and then expands into many others depending on it is also thinkable, hang on, I'll cut and paste a bwise net for it when I made an example.

The array doesn't do anything particularly useful at the moment, but it could for instance do image processing (where the links indicate neighbouring communication in 2D), or stand for steps in a matrix multiplication or what else there is. One could also process a list in a piecewise way.