- Timestamp:
- 10/19/2007 02:48:05 PM (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Modelica/branches/maintenance/2.2.2/Modelica/Electrical/Digital.mo
r597 r719 2482 2482 constant Integer min=1; 2483 2483 constant Integer max=9; 2484 constant Integer 'U'=1 "U ninitialized";2485 constant Integer 'X'=2 " Forcing Unknown";2486 constant Integer '0'=3 " Forcing 0";2487 constant Integer '1'=4 " Forcing 1";2488 constant Integer 'Z'=5 " High Impedance";2489 constant Integer 'W'=6 "W eak Unknown";2490 constant Integer 'L'=7 " Weak 0";2491 constant Integer 'H'=8 " Weak 1";2492 constant Integer '-'=9 " Don't care";2484 constant Integer 'U'=1 "U Uninitialized"; 2485 constant Integer 'X'=2 "X Forcing Unknown"; 2486 constant Integer '0'=3 "0 Forcing 0"; 2487 constant Integer '1'=4 "1 Forcing 1"; 2488 constant Integer 'Z'=5 "Z High Impedance"; 2489 constant Integer 'W'=6 "W Weak Unknown"; 2490 constant Integer 'L'=7 "L Weak 0"; 2491 constant Integer 'H'=8 "H Weak 1"; 2492 constant Integer '-'=9 "- Don't care"; 2493 2493 annotation (Documentation(info="<html> 2494 2494 <p><b>Code Table:</b></p> … … 3395 3395 extends D.Interfaces.MISO; 3396 3396 extends D.Delay.DelayParams; 3397 D.Basic.And G1(final n ) annotation (extent=[-40, -20; 0, 20]);3397 D.Basic.And G1(final n=n) annotation (extent=[-40, -20; 0, 20]); 3398 3398 D.Delay.InertialDelaySensitive G2( 3399 3399 tLH=tLH, … … 3519 3519 Diagram, 3520 3520 DymolaStoredErrors); 3521 D.Basic.Nand G1(final n ) annotation (extent=[-40,-20; 0,20]);3521 D.Basic.Nand G1(final n=n) annotation (extent=[-40,-20; 0,20]); 3522 3522 D.Delay.InertialDelaySensitive G2( 3523 3523 tLH=tLH, … … 3537 3537 extends D.Delay.DelayParams; 3538 3538 extends D.Interfaces.MISO; 3539 D.Basic.Or G1(final n ) annotation (extent=[-40, -20; 0, 20]);3539 D.Basic.Or G1(final n=n) annotation (extent=[-40, -20; 0, 20]); 3540 3540 D.Delay.InertialDelaySensitive G2( 3541 3541 tLH=tLH, … … 3591 3591 extends D.Delay.DelayParams; 3592 3592 extends D.Interfaces.MISO; 3593 D.Basic.Nor G1(final n ) annotation (extent=[-40, -20; 0, 20]);3593 D.Basic.Nor G1(final n=n) annotation (extent=[-40, -20; 0, 20]); 3594 3594 D.Delay.InertialDelaySensitive G2( 3595 3595 tLH=tLH, … … 3651 3651 extends D.Delay.DelayParams; 3652 3652 extends D.Interfaces.MISO; 3653 D.Basic.Xor G1(final n ) annotation (extent=[-40, -20; 0, 20]);3653 D.Basic.Xor G1(final n=n) annotation (extent=[-40, -20; 0, 20]); 3654 3654 D.Delay.InertialDelaySensitive G2( 3655 3655 tLH=tLH, … … 3705 3705 extends D.Delay.DelayParams; 3706 3706 extends D.Interfaces.MISO; 3707 D.Basic.Xnor G1(final n ) annotation (extent=[-40,-20; 0,20]);3707 D.Basic.Xnor G1(final n=n) annotation (extent=[-40,-20; 0,20]); 3708 3708 D.Delay.InertialDelaySensitive G2( 3709 3709 tLH=tLH, … … 4113 4113 D.Interfaces.DigitalOutput y 4114 4114 annotation (extent=[90,-10; 110,10]); 4115 algorithm4116 if nperiod == 0 then4117 y := quiet;4118 elseif (nperiod >= np) or (nperiod < 0) then4119 when sample(startTime, period) then4120 T0 := time;4121 if (nperiod > 0) then4122 np := np + 1;4123 end if;4124 end when;4125 y := if (time < startTime or time >= T0 + ((width*period)/4126 100)) or not (nperiod >= np or nperiod <0) then quiet else pulse;4115 protected 4116 Boolean sampling; 4117 equation 4118 sampling = nperiod <> 0 and (nperiod >= pre(np) or nperiod < 0); 4119 4120 when sampling and sample(startTime, period) then 4121 T0 = time; 4122 np = if nperiod > 0 then pre(np) + 1 else pre(np); 4123 end when; 4124 4125 if sampling then 4126 y = if time < startTime or time >= T0 + ((width*period)/100) then quiet else pulse; 4127 4127 else 4128 y := quiet;4128 y = quiet; 4129 4129 end if; 4130 4130 4131 annotation (Documentation(info="<HTML> 4131 4132 <P>
