下面是对两个8位二进制数的大小进行比较的程序,该程序正确吗? module comparator (AGTB, AEQB, ALTB, A, B); output AGTB, AEQB, ALTB; input [7:0] A, B; always if (A>B) AGTB <=1 else if ((A 下面是对两个8位二进制数的大小进行比较的程序,该程序正确吗? module comparator (AGTB, AEQB, ALTB, A, B); output AGTB, AEQB, ALTB; input [7:0] A, B; always if (A>B) AGTB <=1 else if ((A

下面是对两个8位二进制数的大小进行比较的程序,该程序正确吗? module comparator (AGTB, AEQB, ALTB, A, B); output AGTB, AEQB, ALTB; input [7:0] A, B; always if (A>B) AGTB <=1 else if ((A

下面是对两个8位二进制数的大小进行比较的程序,该程序正确吗? module comparator (AGTB, AEQB, ALTB, A, B); output AGTB, AEQB, ALTB; input [7:0] A, B; always if (A>B) AGTB <=1 else if ((A
参考答案和解析
256

相关考题:

( 7 )有以下程序#include stdio.hmain (){ int a=1,b=2,c=3,d=0;if ( a==1 )if ( b!=2 )if ( c==3 ) d=1;else d=2;else if ( c!=3 ) d=3;else d=4;else d=5;printf ( " %d\n " ,d ) ;}程序运行后的输出结果是 【 7 】 。

以下程序段中,与语句: k=ab?(bc?1:0):0 ; 功能相同的是A)if((ab)(bc)) k=1;else k=0;B)if((ab)||(bc) k=1;else k=0;C)if(a=b) k=0;else if(b=c) k=1;D)if(ab) k=1;else if(bc) k=1;else k=0;

( 19 )若 x 和 y 是程序中的两个整型变量,则下列 if 语句中正确的是A ) if(x==0) y=1; else y=2;B ) if(x==0) then y=1 else y=2;C ) if(x==0) y=1 else y=2;D ) if x==0 y=1; else y=2;

下面程序段中正确的是()。A.If x=2 Then y=3B 下面程序段中正确的是( )。A.If x<0 Then y=0 If x<1 Then y=1 If x<2 Then y=2 If x>=2 Then y=3B.If x>=2 Then y=3 If x>1 Then y=2 If x>=0Then y=1 If x>0 Then y=0C.If x<0 Then y=0 Else If>=0Then y=1 Else y=3 End IfD.If x>=2 Then y=3 Else If>=1 Then y=2 Else y=0 End If

若x和y是程序中的两个整型变量,则下列if语句中正确的是( )。A.if(x==0)y=l;else y=2;B.if(x==0)theny=1 elsey=2C.if(x=0)y=l else y=2;D.ifx==0y=1 else y=2;

当a=1,b=3,c=5,d=4时,执行下面一段程序后,x的值为______。if (ad) x=1;else if(a 当a=1,b=3,c=5,d=4时,执行下面一段程序后,x的值为______。if (a<6) if(c>d) x=1; else if(a<c) if (b>l) x=2; else x=3; else x=6; else x=7;A.1B.2C.3D.6

以下程序段中与语句k=a>b?(b>c? 1:0):0;功能等价的是______。A.if((a>b(b>c))k=1 else k=0B.if((a>b)||(b>c))k=1; else k=0;C.if(a<=b)k=0; else if(b<=c)k=1;D.if(a>b)k=1; else if(b>c)k=1; else k=0;

当a=4,b=5,c=7,d=6时,执行下面一段程序: if(a<B)if(c<D)x=1; else if(a<C)if(b<C)x=2: else x=3; else x=4; else x=5; 程序执行后,x的值为( )。A.1B.2C.3D.4

写异步D触发器的verilog module。(扬智电子笔试) module dff8(clk , reset, d, q); input clk; 写异步D触发器的verilog module。(扬智电子笔试)module dff8(clk , reset, d, q);input clk;input reset;input [7:0] d;output [7:0] q;reg [7:0] q;always @ (posedge clk or posedge reset)if(reset)q = 0;elseq = d;endmodule

以下程序段中与语句k=a>b?(b>c?1:0):0;功能等价的是( )。A.if((a>B) (b:>C) )k=l; else k=0;B.if(a>B) ‖(b>C) k=1; else k=0;C.if(a<=B) k=0; else if(b<=e) k=1;D.if(a>B) k=1; else if(b>C) k=1; else k=0;

以下程序段中与语句k=ab?(bc?1:0):0;功能等价的是( )A.if((ab)(bc)) k=1; else k=0;B.if((ab)||(bc)) k=1 else k=0;C.if(a=b) k=0; else if(b=c) k=1;D.if(ab) k=1; else if(bc) k=1; else k=0;

以下程序段中,与语句:k=ab?(bc?1:0):0;功能相同的是A.if((aB)&&(bC))k=1;B.if((aB)II(bC))k=1; else k=0; else k=0:C.if(a=B)k=0;D.if(aB)k;1; else if(b=C)k=1; else if(bC)k=1; else k=0:

当a=1、b=2、c=3、d=4时,执行下面程序段后,x的值是( )。 if(a<B)if(c<D)x=1; else if(a<C)if(b<D)x=2: else x=3: else x=6: else x=7:A.1B.6C.3D.2

有一函数:以下程序段中不能根据x值正确计算出y值的是A.if(x0)y=1; else if(x= =0)y=0; else y=-1;B.y=0; if(x0)y=1; else if(x0)y=-1;C.y = 0; if (x = 0) if (x0) y = 1; else y = -1;D.if ( x = 0) if ( x0)y = 1; else y = 0; else y = -1;

以下程序段中,与语句“k—ab?(bc?1:O):0;”功能相同的是( )。A.if(ab)(bc)k=1; else k=0;B.if((ab)‖(bc))k=1; else k=0;C.if(a=b)k=0; else if(bc)k=1;D.if(ab)k=1; else if(b=c)k=1; else k=0:

当a=1、b=3、c=5、d=4时,执行下面一段程序: if(a<B) if(c<D) x=1; else if(a<C) if(b<D) x=2; else x=3; eles x=6; else x=7;程序执行后,x的值为( )A.1B.2C.3D.6

以下程序段中与语句k=a>b? (b>c? 1:0):0;功能等价的是( )。A.if((a>b)(b>c)) k=1; else k=0;B.f((a>b)||(b>c)) k=1; else k=0;C.if(a<=b) k=0; else if(b<=c) k=1;D.if(a>b) k=1; else if(b>c) k=1; else k=0;

以下程序段中与语句k=a>b?(b>c?1:0):0;功能等价的是______。A.if(a>b) (b>c) )k=1;else k=();B.if((a>b) ||(b>c) )k=1;else k=0;C.if(a<=b) k=0;else if(b<=c) k=1;D.if(a>b) k=1;else if(b>c) k=1;else k=0;

以下程序段中与语句k=a>b?(b>c?1:0):0;功能等价的是A.if((a>b)(b>c)) k=1; else k=0;B.iff(a>b)‖(b>c)) k=1; else k=0;C.iffa<=b) k=0; else iffb<=c) k=1;D.if(a>b) k=1; else if(b>c) k=1; else k=0;

逻辑覆盖法是设计白盒测试用例的主要方法之一,通过对程序逻辑结构的遍历实现程序的覆盖。针对以下由C语言编写的程序,按要求回答问题。int XOR(char * filename,unsigned long key){ FILE * input = NULL , *output =NULL; //i char * outfilename = NULL; int len = strlen(filename); unsigned char buffer; if( (filename[len-2] == '.') //4 strcpy(outfilename, filename); outfilename[len-2] = '\0'; } else{ //5 outfilename = new char[len+5]; strcpy(outfilename, filename); strncat(outfilename,".c",2); } input =fopen(filename,"rb"); if( input == NULL) { //6 cout << "Error opening file " << filename << endl; //7 delete [] outfilename; outfilename = NULL; return 1; } output =fopen(outfilename,"wb"); if( output == NULL ) { //8 cout << "Error creating output file " << outfilename << endl; //9 delete [] outfilename; outfilename = NULL; return 1; } while( ! feof(input) ) { //10 if(fread( //13 outfilename = NULL; fclose(input); fclose(output); return 1; } } else{ //14 buffer ^= key; fwrite( } } fclose(input); //15 fclose(output); delete [] outfilename; return 0; }请给出满足100%DC(判定覆盖)所需的逻辑条件。

阅读下列说明,回答问题。【说明】逻辑覆盖法是设计白盒测试用例的主要方法之一,通过对程序逻辑结构的遍历实现程序的覆盖。针对以下由C语言编写的程序,按要求回答问题。int XOR(char * filename,unsigned long key){ FILE * input = NULL , *output =NULL; //i char * outfilename = NULL; int len = strlen(filename); unsigned char buffer; if( (filename[len-2] == '.') //4 strcpy(outfilename, filename); outfilename[len-2] = '\0'; } else{ //5 outfilename = new char[len+5]; strcpy(outfilename, filename); strncat(outfilename,".c",2); } input =fopen(filename,"rb"); if( input == NULL) { //6 cout << "Error opening file " << filename << endl; //7 delete [] outfilename; outfilename = NULL; return 1; } output =fopen(outfilename,"wb"); if( output == NULL ) { //8 cout << "Error creating output file " << outfilename << endl; //9 delete [] outfilename; outfilename = NULL; return 1; } while( ! feof(input) ) { //10 if(fread( //13 outfilename = NULL; fclose(input); fclose(output); return 1; } } else{ //14 buffer ^= key; fwrite( } } fclose(input); //15 fclose(output); delete [] outfilename; return 0; }请画出上述程序的控制流图,并计算其控制流图的环路复杂度VG.

钢材力学性能抗拉强度的代表符号为()。A、AgtB、ReLC、RmD、A

钢材力学性能断后伸长率的代表符号为()。A、AgtB、ReLC、RmD、A

如要编程实现:“如果A大于或等于B,那么继续运行程序至某程序段,否则程序将跳过这些程序运行后面的程序段”,下面语句中正确的是()(华中系统)。A、WHILE[AGEB];…ENDWB、WHILE[ALTB];…ENDWC、IF[AGEB];…ENDIFD、IF[ALTB];…ENDIF

以下不能实现符号函数y=sgn(x)的程序段是()。A、if x0 then y=1 else if x=0 then y=0 else y= -1B、if x0 then y=1 else if x0 then y= -1 else y=0C、if x=0 then if x=0 then y=0 else y= -1 else y=1D、if x0 then if x0 then y= -1 else y= 1 else y=0

钢材力学性能下屈服强度的代表符号为()。A、AgtB、RelC、RmD、A

单选题若x和y是程序中的两个整型变量,则下列if语句中正确的是(  )。Aif(x==0)y=1;else y=2;Bif(x==0)then y=l else y=2;Cif(x==0)y=l else y=2;Dif x==0 y=1;else y=2;

单选题以下程序段中,与语句:k=ab?(bc?1:0):0;功能相同的是(  )。Aif((ab) (bc)) k=1;else k=0;Bif((ab)‖(bc)) k=1;else k=0;Cif(a=b) k=0;else if(b=c) k=1;Dif(ab) k=1;else if(bc) k=1;else k=0;