Figure 3.47 Primitive functions in the digital logic simulator.
Figure 3.50 A ripple-carry adder for $n$-bit numbers.

[1] A full-adder is a basic circuit element used in adding two binary numbers. Here $A$ and $B$ are the bits at corresponding positions in the two numbers to be added, and $C_{\mathit{in}}$ is the carry bit from the addition one place to the right. The circuit generates $\mathit{SUM}$, which is the sum bit in the corresponding position, and $C_{\mathit{out}}$, which is the carry bit to be propagated to the left.
[2] These procedures functions are simply syntactic sugar that allow us to use ordinary procedural functional syntax to access the local procedures functions of objects. It is striking that we can interchange the role of procedures functions and data in such a simple way. For example, if we write (wire 'get-signal) wire("get_signal") we think of wire as a procedure function that is called with the message get-signal "get_signal" as input. Alternatively, writing (get-signal wire) get_signal(wire) encourages us to think of wire as a data object that is the input to a procedure function get-signal. get_signal. The truth of the matter is that, in a language in which we can deal with procedures functions as objects, there is no fundamental difference between proceduresfunctions and data, and we can choose our syntactic sugar to allow us to program in whatever style we choose.
[3] The agenda is a headed list, like the tables in section 3.3.3, but since the list is headed by the time, we do not need an additional dummy header (such as the *table* symbol "*table*" string used with tables).
[4] Observe that the if expression in this procedure has no alternative expression. conditional statement in this function has an empty block as its alternative statement. Such a one-armed if expression one-armed conditional statement is used to decide whether to do something, rather than to select between two expressions. An if expression returns an unspecified value if the predicate is false and there is no alternative. statements.
[5] In this way, the current time will always be the time of the action most recently processed. Storing this time at the head of the agenda ensures that it will still be available even if the associated time segment has been deleted.
3.3.4   A Simulator for Digital Circuits