根据下列真值表,采用case语句描述一个8-3编码器,输入信号:x[7..0]时,输出y[2..0]。
输入X
输出Y
X0
X1
X2
X3
X4
X5
X6
X7
Y2
Y1
Y0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
1
0
1
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
0
1
1
1
1
输入X
输出Y
X0
X1
X2
X3
X4
X5
X6
X7
Y2
Y1
Y0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
1
0
1
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
0
1
1
1
1
举一反三
- 下列语句与y=(x>;0?1:x<;0?-1:0);语句功能相同是( ) A: if (x) if(x>;0) y=1; else if(x<;0) y=-1;else y=0; B: y=-1; if(x>;0) y=1; else y=-1; C: if (x>;0) y=1; else if(x<;0) y=-1; else y=0; D: y=0; if(x>;=0) y=1;else if(x==0) y=0; else y=-1;
- 表示下列分段函数的正确的C语言语句是?[img=130x65]1803bce86a99b5b.png[/img] A: if (x < 0) y = -1; else if (x > 0) y = 1; else y = 0; B: if (x < 0) y = -1; if (x = 0) y = 0; if (x > 0) y = 1; C: if (x < 0) y = -1; if (x == 0) y = 0; if (x > 0) y = 1; D: if (x <= 0) if (x < 0) y = -1; else y = 0; else y = 1;
- 能够完成如下函数计算的程序段是( )。[img=128x73]18038b85af5fc28.png[/img] A: y=1;if(x!=0) if(x>0) y=1; else y=0; B: if(x>=0) if(x>0) y=1; else y=0;else y=-1; C: y=0; if (x>=0) if (x>0) y=1; else y=-1; D: y=-1;if (x>0) y=1;else y=0;
- 若有说明 int x,y;不能实现以下函数关系的程序段是( )[img=145x83]1802ce1f44e61b4.png[/img] A: y=-1;if (x!=0)if(x>0) y=1;else y=0; B: if (x<0) y=-1; else if(x==0) y=0; else y=1; C: y=0; if (x>=0) { if (x>0) y=1; } else y=-1; D: if (x>=0) if(x>0) y=1; else y=0;else y=-1;
- 有一个分段函数,当x大于0时,y的值是1;当x为0时,y的值是0;当x A: if(x >= 0)if(x > 0) y = 1;else y = 0;else y = -1; B: if(x > 0) y = 1;else if(x == 0) y = 0;else y = -1; C: y = 0;if(x > 0) y = 1;else if(x D: y = 0; if(x >= 0); if(x > 0) y = 1; else y = -1;