BUF3SL

model BUF3SL "Tristate buffer with enable active low"
    parameter SI.Time tHL = 0 "High->Low delay";
    parameter SI.Time tLH = 0 "Low->High delay";
    parameter D.Interfaces.Strength strength = S.'S_X01' "output strength";
    D.Interfaces.DigitalInput enable annotation (Placement(
        transformation(extent = {
            {-100, 60}, 
            {-80, 80}}),
        iconTransformation(extent = {
            {-100, 60}, 
            {-80, 80}})));
    D.Interfaces.DigitalInput x annotation (Placement(
        transformation(extent = {
            {-100, -20}, 
            {-80, 0}}),
        iconTransformation(extent = {
            {-100, -20}, 
            {-80, 0}})));
    D.Interfaces.DigitalOutput y annotation (Placement(
        transformation(extent = {
            {80, -20}, 
            {100, 0}}),
        iconTransformation(extent = {
            {80, -20}, 
            {100, 0}})));
protected
    D.Interfaces.Logic nextstate(start = L.'U');
    D.Interfaces.DigitalOutput yy(start = L.'U');
    D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH = tLH, tHL = tHL);
algorithm
    nextstate := T.Buf3slTable[strength,T.UX01Conv[enable],T.UX01Conv[x]];
    yy := nextstate;
equation
    connect(yy,inertialDelaySensitive.x);
    connect(inertialDelaySensitive.y,y);

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-80, 70}, 
                        {0, 70}, 
                        {0, 14}},
                    color = {127, 0, 127},
                    thickness = 1), 
                Polygon(
                    points = {
                        {-40, 40}, 
                        {-40, -60}, 
                        {40, -10}, 
                        {-40, 40}},
                    lineColor = {127, 0, 127},
                    fillColor = {213, 170, 255},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-80, -10}, 
                        {-40, -10}},
                    color = {127, 0, 127},
                    thickness = 1), 
                Line(
                    points = {
                        {40, -10}, 
                        {82, -10}},
                    color = {127, 0, 127},
                    thickness = 1), 
                Text(
                    extent = {
                        {-54, -62}, 
                        {20, -84}},
                    lineColor = {0, 0, 255},
                    textString = "%name")}),
        Documentation(
            revisions = "<html>\n<ul>\n<li><em>January 22, 2010</em> created by Ulrich Donath<br>\n       </li>\n</ul>\n</html>",
            info = "<html>\n<p>Description in VHDL is given by http://www.cs.sfu.ca/~ggbaker/reference/std_logic/src/std_logic_entities.vhd</p>\n<p>and for tristate table http://www.cs.sfu.ca/~ggbaker/reference/std_logic/src/std_logic_misc.vhd</p>\n<p><strong>Truth Table</strong></p>\n<table border=1 cellspacing=0 cellpadding=2>\n  <tr><td><strong>DataIn</strong></td>\n      <td><strong>Enable</strong></td>\n      <td><strong>DataOut*</strong></td>\n  </tr>\n\n  <tr><td>*</td> <td>U</td> <td>U</td></tr>\n  <tr><td>*</td> <td>X</td> <td>UX</td></tr>\n  <tr><td>*</td> <td>0</td> <td>DataIn</td></tr>\n  <tr><td>*</td> <td>1</td> <td>Z</td></tr>\n  <tr><td>*</td> <td>Z</td> <td>UX</td></tr>\n  <tr><td>*</td> <td>W</td> <td>UX</td></tr>\n  <tr><td>*</td> <td>L</td> <td>DataIn</td></tr>\n  <tr><td>*</td> <td>H</td> <td>Z</td></tr>\n  <tr><td>*</td> <td>-</td> <td>UX</td></tr>\n</table>\n\n<pre>\n  UX: if dataIn == U then U else X\n  DataOut*: Strength map for DataOut according to tristate table Buf3slTable\n</pre>\n</html>"));
end BUF3SL;