Thanks to all who have responded to my email about my hobby circuit
simulator, all in a kind manner and instructive. Stephand de Gabrielle (to
whom many thanks too, of course) pointed me to section 3.3.4 of SICP, where
I learned how to deal with time by means of an agenda. After reading this
section of SICP I totally revised my simulator tools such as to use an
agenda, but in quite a different way than exposed in SICP. My agenda first
changes all signals to be changed and subsequently triggers the gates whose
inputs have changed, but every gate only once at a given time. For this
reason I don't need a queue. I use a hash that maps times to lists of
events. Because every gate is triggered only once at a time, the order in
which they are triggered is irrelevant. Furthermore my gates do not
schedule signal changes for their outputs if the new inputs do not change
the output. In my simulators all gates and all wires are distinct Racket
objects, like in a physical circuit all parts are distinct components. This
means that every subcircuit, and even every gate, has it's own internal
wires and gates. The documentation contains examples of flip-flops and
shows how to deal with vibration (such as when powering up a twin-flip-flop
(usually called a master-slave-flip-flop, but that's not a happy name) I am
aware of the fact that my simulators are very limited. For instance, they
change signals instantaneously and at the same time, which in a physical
circuit cannot be true, I think. Nevertheless, if you are interested, take
a look at joskoot <https://github.com/joskoot>/
circuit-simulation-after-SICP-3.3.4
<https://github.com/joskoot/circuit-simulation-after-SICP-3.3.4>*. *I hold
all files in the same directory. To make the documentation I open
file circuit-manual-scrbl with DrRacket and press button Scribble HTML. I
have tried to make it a package, but the documentation does not come out
well. Maybe I need more info in file info.rkt. I don't know. Help is very
welcome. Because I have Windows 10, I use the package manager in the file
menu of DrRacket. In Windows command line commands are almost impossible.
Well, a long story, sorry about that. Thanks very much.
Jos

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL6KNi0K8Z5xzdGhKEdF2kdML5xYhbHVk350PdW87a_B25W8mA%40mail.gmail.com.

Reply via email to