5 If we don't call the proc in the add-action! procedure then the outputs for the
6 given inputs will be in some undefined default states. They won't reflect the
7 logic that the function blocks are representing.
9 Let us take half adder example:
11 (define (half-adder a b s c)
12 (let ((d (make-wire)) (e (make-wire)))
19 If accept-action-proc! is defined without the call to proc, i.e.
21 (define (accept-action-proc! proc)
22 (set! action-procedures (cons proc action-procedures))
24 then, let us see what happens.
26 The or-gate definition will call add-action on both its inputs a and b. make-wire
27 by default sets the wire value as 0. So, for the default case, the inputs to the
28 half-adder will be 0 and 0 and the output of the or-gate and and-gate will be 0.
30 E will also be 0. So, S = 0 C = 0, irrespective of the initial values of a and b.