[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Drawing Things (was Re: [f-c» ¼ ½ ¾ e a little sketch.
> > It's good that you made the drawing! ;)
> it's so rare, because it's usually so long to do !
> doing a hand drawing takes less than one minute,
> a computer drawing is 100x slower.
There is a tool called "graphviz" to draw in an easy way things like FSM,
trees, flows and so on. (you are 100x faster than previous computer
drawing ;-))
It uses a C-like (or tcl-like) syntax and places nodes and connections
automatically in a right way.
There are two subtools, "dot" - to draw directed graphs (trees, or
FMS) and "neato" - to draw undirected graphs and weight them automatically
These are very useful to make complex things easier to understand.
Here a simple example (that draws a FSM-graph of a 2bit-counter):
digraph zaehler {
// 0 / 1
// E0: counter start/stop
// in future: E2: ring/saturate
// E1: forewards/backwards
// creating nodes
n1 [label="0"];
n2 [label="1"];
n3 [label="2"];
n4 [label="3"];
// forwards
n1 -> n2 [label="E0=1\nE1=0"];
n2 -> n3 [label="E0=1\nE1=0"];
n3 -> n4 [label="E0=1\nE1=0"];
n4 -> n1 [label="E0=1\nE1=0"];
// backwards
n1 -> n4 [label="E0=1\nE1=1"];
n2 -> n1 [label="E0=1\nE1=1"];
n3 -> n2 [label="E0=1\nE1=1"];
n4 -> n3 [label="E0=1\nE1=1"];
// E0 = 0, stop
n1 -> n1 [label="E0=0"];
n2 -> n2 [label="E0=0"];
n3 -> n3 [label="E0=0"];
n4 -> n4 [label="E0=0"];
}
If you want the graph as GIF or PS, do this:
dot -Tps counter.dot > counter.ps
or
dot -Tgif counter.dot > counter.gif
I hope that would help...
Bye Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7buMnClxplZklbgERAn2sAJ0UZAQ5OgUau+p4DY/uAysE3zS9owCcDSp4
0CZhXoX3kjBejdrV3iQGT88=
=eaK8
-----END PGP SIGNATURE-----
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu in the body. http://f-cpu.seul.org/