From aa4eb5b17a5d4da25259a4163eb86400c4c4b52f Mon Sep 17 00:00:00 2001 From: henz Date: Mon, 1 Jul 2024 11:48:34 +0800 Subject: [PATCH 1/2] fixes #836 --- xml/chapter3/section3/subsection4.xml | 53 +++++++++++++++------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/xml/chapter3/section3/subsection4.xml b/xml/chapter3/section3/subsection4.xml index 9d5ca6f62..311d55674 100755 --- a/xml/chapter3/section3/subsection4.xml +++ b/xml/chapter3/section3/subsection4.xml @@ -570,21 +570,6 @@ function logical_and(s1, s2) { } - - logical_or - -function logical_or(s1, s2) { - return s1 === 0 && s2 === 0 - ? 0 - : s1 === 0 || s1 === 1 - ? s2 === 0 || s2 === 1 - ? 1 - : error(s2, "invalid signal") - : error(s1, "invalid signal"); -} - - - @@ -673,12 +658,32 @@ function and_gate(a1, a2, output) { and_gate. - - or_gate - get_signal - after_delay - logical_or - + + + From 4e0511ab0276858ce33b23245fd28adf7e0e294d Mon Sep 17 00:00:00 2001 From: henz Date: Mon, 1 Jul 2024 14:15:39 +0800 Subject: [PATCH 2/2] fixes #837 --- xml/chapter3/section3/subsection5.xml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/xml/chapter3/section3/subsection5.xml b/xml/chapter3/section3/subsection5.xml index ab5b57998..c20841f95 100755 --- a/xml/chapter3/section3/subsection5.xml +++ b/xml/chapter3/section3/subsection5.xml @@ -1561,6 +1561,53 @@ const answer = v_prod(v_sum("a", "b"), v_sum("c", "d")); expression-oriented style in terms of the imperative implementation, it is very difficult to do the converse. propagation of constraints