feature: add IEC gates #11

Merged
HEL merged 7 commits from bono/circuiteria:add_iec_gates into dev 2025-06-29 13:19:57 +00:00
10 changed files with 506 additions and 1 deletions
Showing only changes of commit ea8277ee5b - Show all commits

View File

@ -4,7 +4,7 @@
#set page(width: auto, height: auto, margin: .5cm)
#circuit({
element.gate-iec-buf(
element.iec-gate-buf(
x: 0,
y: 0,
w: 2,
@ -14,7 +14,7 @@
)
wire.stub("iec-buf-port-in0", "west")
element.gate-iec-not(
element.iec-gate-not(
x: 3,
y: 0,
w: 2,
@ -24,7 +24,7 @@
)
wire.stub("iec-not-port-in0", "west")
element.gate-iec-and(
element.iec-gate-and(
id: "iec-and",
x: 0,
y: -3,
@ -36,7 +36,7 @@
wire.stub("iec-and-port-in" + str(i), "west")
}
element.gate-iec-nand(
element.iec-gate-nand(
id: "iec-nand",
x: 3,
y: -3,
@ -48,7 +48,7 @@
wire.stub("iec-nand-port-in" + str(i), "west")
}
element.gate-iec-or(
element.iec-gate-or(
id: "iec-or",
x: 0,
y: -6,
@ -60,7 +60,7 @@
wire.stub("iec-or-port-in" + str(i), "west")
}
element.gate-iec-nor(
element.iec-gate-nor(
id: "iec-nor",
x: 3,
y: -6,
@ -72,7 +72,7 @@
wire.stub("iec-nor-port-in" + str(i), "west")
}
element.gate-iec-xor(
element.iec-gate-xor(
id: "iec-xor",
x: 0,
y: -9,
@ -84,7 +84,7 @@
wire.stub("iec-xor-port-in" + str(i), "west")
}
element.gate-iec-nxor(
element.iec-gate-nxor(
id: "iec-nxor",
x: 3,
y: -9,

View File

@ -12,9 +12,9 @@
#import "elements/logic/xor.typ": gate-xor, gate-xnor
#import "elements/logic/buf.typ": gate-buf, gate-not
#import "elements/logic/iec_gate.typ": iec-gate
#import "elements/logic/iec_and.typ": gate-iec-and, gate-iec-nand
#import "elements/logic/iec_buf.typ": gate-iec-buf, gate-iec-not
#import "elements/logic/iec_or.typ": gate-iec-or, gate-iec-nor
#import "elements/logic/iec_xor.typ": gate-iec-xor, gate-iec-nxor
#import "elements/logic/iec_and.typ": iec-gate-and, iec-gate-nand
#import "elements/logic/iec_buf.typ": iec-gate-buf, iec-gate-not
#import "elements/logic/iec_or.typ": iec-gate-or, iec-gate-nor
#import "elements/logic/iec_xor.typ": iec-gate-xor, iec-gate-nxor
#import "elements/group.typ": group

View File

@ -6,8 +6,8 @@
/// Draws an IEC-AND gate. This function is also available as `element.iec-gate-and()`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-and
#let gate-iec-and(
/// #examples.iec-gate-and
#let iec-gate-and(
x: none,
y: none,
w: none,
@ -40,8 +40,8 @@
/// Draws an IEC-NAND gate. This function is also available as `element.iec-gate-nand()`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-nand
#let gate-iec-nand(
/// #examples.iec-gate-nand
#let iec-gate-nand(
x: none,
y: none,
w: none,
@ -55,7 +55,7 @@
ports: false
),
) = {
gate-iec-and(
iec-gate-and(
x: x,
y: y,
w: w,

View File

@ -5,8 +5,8 @@
/// Draws an IEC buffer gate. This function is also available as `element.iec-gate-buf()`
bono marked this conversation as resolved
Review

Should be element.gate-iec-buf instead of element.iec-gate-buf

Should be `element.gate-iec-buf` instead of `element.iec-gate-buf`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-buf
#let gate-iec-buf(
/// #examples.iec-gate-buf
#let iec-gate-buf(
x: none,
y: none,
w: none,
@ -38,8 +38,8 @@
/// Draws an IEC NOT gate. This function is also available as `element.iec-gate-not()`
bono marked this conversation as resolved
Review

Should be element.gate-iec-not instead of element.iec-gate-not

Should be `element.gate-iec-not` instead of `element.iec-gate-not`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-not
#let gate-iec-not(
/// #examples.iec-gate-not
#let iec-gate-not(
x: none,
y: none,
w: none,
@ -53,7 +53,7 @@
ports: false,
),
) = {
gate-iec-buf(
iec-gate-buf(
x: x,
y: y,
w: w,

View File

@ -4,8 +4,8 @@
/// Draws an IEC-OR gate. This function is also available as `element.iec-gate-or()`
bono marked this conversation as resolved
Review

Should be element.gate-iec-or instead of element.iec-gate-or

Should be `element.gate-iec-or` instead of `element.iec-gate-or`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-or
#let gate-iec-or(
/// #examples.iec-gate-or
#let iec-gate-or(
x: none,
y: none,
w: none,
@ -37,8 +37,8 @@
/// Draws an IEC-NOR gate. This function is also available as `element.iec-gate-nor()`
bono marked this conversation as resolved
Review

Should be element.gate-iec-nor instead of element.iec-gate-nor

Should be `element.gate-iec-nor` instead of `element.iec-gate-nor`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-nor
#let gate-iec-nor(
/// #examples.iec-gate-nor
#let iec-gate-nor(
x: none,
y: none,
w: none,
@ -52,7 +52,7 @@
ports: false
)
) = {
gate-iec-or(
iec-gate-or(
x: x,
y: y,
w: w,

View File

@ -4,8 +4,8 @@
/// Draws an IEC-XOR gate. This function is also available as `element.iec-gate-xor()`
bono marked this conversation as resolved
Review

Should be element.gate-iec-xor instead of element.iec-gate-xor

Should be `element.gate-iec-xor` instead of `element.iec-gate-xor`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-xor
#let gate-iec-xor(
/// #examples.iec-gate-xor
#let iec-gate-xor(
x: none,
y: none,
w: none,
@ -37,8 +37,8 @@
/// Draws an IEC-NXOR gate. This function is also available as `element.iec-gate-nxor()`
bono marked this conversation as resolved Outdated
Outdated
Review

Should be element.gate-iec-xnor instead of element.iec-gate-xnor

Should be `element.gate-iec-xnor` instead of `element.iec-gate-xnor`
///
/// For parameters, see #doc-ref("gates.iec-gate")
/// #examples.gate-iec-nxor
#let gate-iec-nxor(
/// #examples.iec-gate-nxor
#let iec-gate-nxor(
x: none,
y: none,
w: none,
@ -52,7 +52,7 @@
ports: false
)
) = {
gate-iec-xor(
iec-gate-xor(
x: x,
y: y,
w: w,

View File

@ -4,7 +4,7 @@
#import "elements/logic/xor.typ": gate-xor, gate-xnor
#import "elements/logic/buf.typ": gate-buf, gate-not
#import "elements/logic/iec_gate.typ": iec-gate
#import "elements/logic/iec_and.typ": gate-iec-and, gate-iec-nand
#import "elements/logic/iec_or.typ": gate-iec-or, gate-iec-nor
#import "elements/logic/iec_buf.typ": gate-iec-buf, gate-iec-not
#import "elements/logic/iec_xor.typ": gate-iec-xor, gate-iec-nxor
#import "elements/logic/iec_and.typ": iec-gate-and, iec-gate-nand
#import "elements/logic/iec_or.typ": iec-gate-or, iec-gate-nor
#import "elements/logic/iec_buf.typ": iec-gate-buf, iec-gate-not
#import "elements/logic/iec_xor.typ": iec-gate-xor, iec-gate-nxor