Test_NandLogical Icon
Test_NandLogical
Usage
PrimitiveComponents.Test_NandLogical()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( step_{1_{+}y(t)}, nand_{logical\_1_{+}u1(t)} \right) \\ \mathrm{connect}\left( step_{2_{+}y(t)}, nand_{logical\_1_{+}u2(t)} \right) \\ \mathrm{connect}\left( step_{3_{+}y(t)}, nand_{logical\_2_{+}u1(t)} \right) \\ \mathrm{connect}\left( step_{4_{+}y(t)}, nand_{logical\_2_{+}u2(t)} \right) \\ \mathtt{nand\_logical\_1.c1}\left( t \right) = check\_with\_target\_value\left( \mathtt{nand\_logical\_1.u1}\left( t \right), \mathtt{nand\_logical\_1.target\_value}, \mathtt{nand\_logical\_1.abs\_tol} \right) \\ \mathtt{nand\_logical\_1.c2}\left( t \right) = check\_with\_target\_value\left( \mathtt{nand\_logical\_1.u2}\left( t \right), \mathtt{nand\_logical\_1.target\_value}, \mathtt{nand\_logical\_1.abs\_tol} \right) \\ \mathtt{nand\_logical\_1.y}\left( t \right) = ifelse\left( \neg \mathtt{nand\_logical\_1.c1}\left( t \right) \wedge \neg \mathtt{nand\_logical\_1.c2}\left( t \right), 0, 1 \right) \\ \mathtt{nand\_logical\_2.c1}\left( t \right) = check\_with\_target\_value\left( \mathtt{nand\_logical\_2.u1}\left( t \right), \mathtt{nand\_logical\_2.target\_value}, \mathtt{nand\_logical\_2.abs\_tol} \right) \\ \mathtt{nand\_logical\_2.c2}\left( t \right) = check\_with\_target\_value\left( \mathtt{nand\_logical\_2.u2}\left( t \right), \mathtt{nand\_logical\_2.target\_value}, \mathtt{nand\_logical\_2.abs\_tol} \right) \\ \mathtt{nand\_logical\_2.y}\left( t \right) = ifelse\left( \neg \mathtt{nand\_logical\_2.c1}\left( t \right) \wedge \neg \mathtt{nand\_logical\_2.c2}\left( t \right), 0, 1 \right) \\ \mathtt{step\_1.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_1.start\_time}, \mathtt{step\_1.height} + \mathtt{step\_1.offset}, \mathtt{step\_1.offset} \right) \\ \mathtt{step\_2.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_2.start\_time}, \mathtt{step\_2.height} + \mathtt{step\_2.offset}, \mathtt{step\_2.offset} \right) \\ \mathtt{step\_3.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_3.start\_time}, \mathtt{step\_3.height} + \mathtt{step\_3.offset}, \mathtt{step\_3.offset} \right) \\ \mathtt{step\_4.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_4.start\_time}, \mathtt{step\_4.height} + \mathtt{step\_4.offset}, \mathtt{step\_4.offset} \right) \\ \end{array} \right] \end{equation} \]
Source
component Test_NandLogical
nand_logical_1 = PrimitiveComponents.LogicGates.Logical_NAND(target_value = 0.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 154, "y1": 43, "x2": 254, "y2": 143, "rot": 0}
},
"tags": []
}
}
nand_logical_2 = PrimitiveComponents.LogicGates.Logical_NAND(target_value = 1.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 412, "y1": 43, "x2": 512, "y2": 143, "rot": 0}
},
"tags": []
}
}
step_1 = BlockComponents.Step(start_time = 2, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
},
"tags": []
}
}
step_2 = BlockComponents.Step(start_time = 5, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 140, "x2": 120, "y2": 240, "rot": 0}
},
"tags": []
}
}
step_3 = BlockComponents.Step(start_time = 2, height = 1.05, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 278, "y1": 20, "x2": 378, "y2": 120, "rot": 0}
},
"tags": []
}
}
step_4 = BlockComponents.Step(start_time = 5, height = 1, offset = 0.05) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 278, "y1": 140, "x2": 378, "y2": 240, "rot": 0}
},
"tags": []
}
}
relations
connect(step_1.y, nand_logical_1.u1) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(nand_logical_1.u2, step_2.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 140, "y": 115}, {"x": 140, "y": 190}], "E": 2}],
"renderStyle": "standard"
}
}
connect(nand_logical_2.u1, step_3.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(nand_logical_2.u2, step_4.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 398, "y": 115}, {"x": 398, "y": 190}], "E": 2}],
"renderStyle": "standard"
}
}
metadata {
"Dyad": {
"experiments": {"Test_NandLogical_": {"stop": 10}},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["nand_logical_1.y", "nand_logical_2.y"]}
}
}
}
}
end
Flattened Source
component Test_NandLogical
nand_logical_1 = PrimitiveComponents.LogicGates.Logical_NAND(target_value = 0.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 154, "y1": 43, "x2": 254, "y2": 143, "rot": 0}
},
"tags": []
}
}
nand_logical_2 = PrimitiveComponents.LogicGates.Logical_NAND(target_value = 1.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 412, "y1": 43, "x2": 512, "y2": 143, "rot": 0}
},
"tags": []
}
}
step_1 = BlockComponents.Step(start_time = 2, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
},
"tags": []
}
}
step_2 = BlockComponents.Step(start_time = 5, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 140, "x2": 120, "y2": 240, "rot": 0}
},
"tags": []
}
}
step_3 = BlockComponents.Step(start_time = 2, height = 1.05, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 278, "y1": 20, "x2": 378, "y2": 120, "rot": 0}
},
"tags": []
}
}
step_4 = BlockComponents.Step(start_time = 5, height = 1, offset = 0.05) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 278, "y1": 140, "x2": 378, "y2": 240, "rot": 0}
},
"tags": []
}
}
relations
connect(step_1.y, nand_logical_1.u1) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(nand_logical_1.u2, step_2.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 140, "y": 115}, {"x": 140, "y": 190}], "E": 2}],
"renderStyle": "standard"
}
}
connect(nand_logical_2.u1, step_3.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(nand_logical_2.u2, step_4.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 398, "y": 115}, {"x": 398, "y": 190}], "E": 2}],
"renderStyle": "standard"
}
}
metadata {
"Dyad": {
"experiments": {"Test_NandLogical_": {"stop": 10}},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["nand_logical_1.y", "nand_logical_2.y"]}
}
}
}
}
endTest Cases
Test Case case1
pltpltRelated
- Examples
- Experiments
- Analyses