|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
最简单的逻辑命令是if, ..., end,其基本形式为:
6 \/ ]) l, b b4 r4 Y+ Y/ T7 N6 K( c2 |& `/ d# z0 P5 n
if 条件式; ( D; X7 I l2 ~- P, C
/ `& Y; d/ ^& `# |" g# x
运算式;
- l) z8 f! A* g3 r: A) _; F& Y- s4 H0 F: c, _
end 4 ^3 ?7 ^8 L M0 r9 W4 D$ ~
9 e: }- s8 Z2 x; u Qif rand(1,1) > 0.5, 5 R8 E9 P* M% ]5 F" [4 X
/ t6 C9 ~' w& r, }0 x6 q7 c( hdisp('Given random number is greater than 0.5.'); 8 T4 f$ g! }3 I! J$ @) h3 J
5 f1 m5 x& O) rend 8 q! Z3 V- I! U3 R1 S0 {' V
+ o9 {0 c+ O+ x' v& FGiven random number is greater than 0.5. |
|