Repository navigation
Add generic and/or with flexibel inputs & allow unconnected pins #4746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,30 +1,28 @@ | ||||||
| component and "Multi input AND gate"; | ||||||
| pin in bool in##[128:personality] = 1 "input pins, up to personality-1"; | ||||||
| component and_n "Compute the logical AND of up to 255 inputs."; | ||||||
| pin in bool in##[255:personality] = 1 "inputs (default is TRUE)"; | ||||||
| pin out bool out "output pin; the AND of all inputs"; | ||||||
|
|
||||||
| description """ | ||||||
| The *out* pin is set to *TRUE* if all the inputs are all *TRUE*; or *FALSE* if one or more are *FALSE*. | ||||||
|
|
||||||
| The value for a unconnected pin is TRUE; so it is fine to leave a pin unconnected. | ||||||
|
|
||||||
| Set the number of pins via personality. The default value is a single *AND* with 8 inputs; so personality=8. The maximum number of inputs is 128 (hardcoded). If there are no inputs specified (personality=0); then the output value | ||||||
| Set the number of pins via personality. The default value is a single *AND* with 8 | ||||||
| inputs; so personality=8. The maximum number of inputs is 255 (hardcoded). | ||||||
| If there are no inputs specified (personality=0); then the output value | ||||||
| is TRUE. | ||||||
| """; | ||||||
|
|
||||||
| function _ "Logical AND"; | ||||||
|
|
||||||
| see_also """ | ||||||
| *or*(9), | ||||||
| and2(9) | ||||||
| and | ||||||
| or2(9). | ||||||
| or(9), and2(9) and or2(9). | ||||||
| """; | ||||||
|
|
||||||
| option period no; | ||||||
| option default_personality 8; | ||||||
| option default_count 1; | ||||||
|
|
||||||
| license "ASLv2"; | ||||||
| license "GPL"; | ||||||
| author "Dirk-Willem van Gulik <dirkx(at)webweaving(punto)org"; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing the closing
Suggested change
|
||||||
| ;; | ||||||
| FUNCTION(_) { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,15 +1,15 @@ | ||||||
| component or "Arbitrary input OR gate"; | ||||||
| pin in bool in##[128:personality] = 0 "in"; | ||||||
| component or_n "compute the logical OR of up to 255 inputs."; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small things: "Compute" capitalised like and_n, and maybe a doc string on |
||||||
| pin in bool in##[255:personality] = 0 "in (default is FALSE)"; | ||||||
| pin out bool out "output pin; the OR of all inputs"; | ||||||
|
|
||||||
| description """ | ||||||
| The *out* pin is set to *TRUE* if any the inputs is *TRUE*; or *FALSE* if all are *FALSE*. | ||||||
|
|
||||||
| The value for a unconnected pin is FALSE; so it is fine to leave a pin unconnected. | ||||||
|
|
||||||
| Set the number of pins via personality. The default value is a single *OR* with 8 inputs; so personality=8. The | ||||||
| maximum number of inputs is 128 (hardcoded). If there are no input pins at all (personality=0); then | ||||||
| the output is *FALSE*. | ||||||
| Set the number of pins via personality. The default value is a single *OR* with 8 | ||||||
| inputs; so personality=8. The maximum number of inputs is 155(hardcoded). If there | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think 155 should be 255, or am I missing something?
Suggested change
|
||||||
| are no input pins at all (personality=0); then the output is *FALSE*. | ||||||
| """ | ||||||
| ; | ||||||
| function _; | ||||||
|
|
@@ -19,9 +19,8 @@ and(9), and2(9) and or2(9). | |||||
|
|
||||||
| option period no; | ||||||
| option default_personality 8; | ||||||
| option default_count 1; | ||||||
|
|
||||||
| license "ASLv2"; | ||||||
| license "GPL"; | ||||||
| author "Dirk-Willem van Gulik <dirkx(at)webweaving(punto)org"; | ||||||
| ;; | ||||||
| FUNCTION(_) { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
or_n(9)now, after the rename? Same forand(9)in or_n.comp see_also.