model And "And logic component with multiple input and one output"
import D = Modelica.Electrical.Digital;
import L = Modelica.Electrical.Digital.Interfaces.Logic;
extends D.Interfaces.MISO;
protected
D.Interfaces.Logic auxiliary[n](each start = L.'U');
D.Interfaces.Logic auxiliary_n(start = L.'U', fixed = true);
equation
for i in 1:n - 1 loop
auxiliary[i + 1] = Modelica.Electrical.Digital.Tables.AndTable[auxiliary[i],x[i + 1]];
end for;
y = pre(auxiliary_n);
auxiliary_n = auxiliary[n];
auxiliary[1] = x[1];
annotation (
Documentation(
info = "<html>\n<p>And component with multiple input values and one output.</p>\n<p>According to the standard logic and table (Tables.AndTable) the output value is calculated.</p>\n<p>To avoid loops in the numerical treatment, the pre operator is applied to the output.</p>\n</html>",
revisions = "<html>\n<ul>\n<li><em>September 15, 2004</em> vector approach used for all fixed numbers of inputs\n by Christoph Clauss<br>\n </li>\n<li><em>October 22, 2003</em>\n by Teresa Schlegel<br>\n initially modelled.</li>\n</ul>\n</html>"),
Icon(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Text(
extent = {
{-50, 40},
{50, 80}},
textString = "&"),
Text(
extent = {
{152, -160},
{-148, -100}},
textColor = {0, 0, 255},
textString = "%name")}));
end And;