请将以下描述多路复用器的代码补充完整 module aMux_2(Out, In_a,In_b,S) input [4:0] In_a,In_b; input S; output[4:0] Out; assign Out=S? ; (答案不留空格) endmodule
请将以下描述多路复用器的代码补充完整 module aMux_2(Out, In_a,In_b,S) input [4:0] In_a,In_b; input S; output[4:0] Out; assign Out=S? ; (答案不留空格) endmodule
参考答案和解析
ABCD
相关考题:
阅读下列代码 public class Arrays{ public static void main(String[]args){ int[]a=new int[5]; for(int i=0;i<a. length; i=i+1){ a[i]=10+i; } for(int i=0; i<a. length; i=i+1){ System. out. println(a[i]); } String[]s={"Frank","Bob","Jim"}; for(int i=0; i<s. length; i=i+1){ System. out. println(s[i]); } S[2]="Mike"; System. out. println(s[2]); } } 代码运行结果正确的是A.10 11 12 13 14 Mike Bob Frank JimB.11 12 13 14 15 Frank Bob Mike JimC.10 11 12 13 14 Frank Bob Jim MikeD.11 12 13 14 15 Mike Jim Bob Frank
下面是一个字符界面的Java Application程序,它接受用户输入的一个浮点数,并将它的整数部分和小数部分分别输出。请勿改动原有代码,在下画线处填人适当语句,将程序补充完整。import java.io.*;public class test16_2{public static void main(String args[]) {String s;double d;int i;boolean b=false;do{try{System.out.println("请输入一个浮点数:");BufferedReader br=new BufferedReader(new lnputStreamReader(System.in));s=br.readLine();i=s.indexOf( );d=__________.parseDouble(s);System.out.println(d+"整数部分为:"+__________);if(i==-1)System.out.println(d+"小数部分为:0.0");elseSystem.out.println(d+"小数部分为:"+Double.parseDouble(((s.charAt(0)=='-')?"-":"")+"0."+s.substring(i+1,s.length())));b=false;}catch(NumberFormatException nfe) {System.out.prinfln("输入浮点数格式有误。\n");b=true;}catch(IOException ioe)b=false;}}while(b);}}
学生的记录由学号和成绩组成,N名学生的数据已在主函数中放入结构体数组s中,请编写函数fun(),它的功能是按分数的高低排列学生的记录,低分在前。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include<stdio.h>define N 16typedef struct{ char mum[10);int s;}STREC;int fun (STREC a[ ]){}main (){STREC s[N]={{“GA005”,88},{“GA003”,64},{“CA002”,77},{“GA004”,89},{“GA001”,54},{“GA007”,72},{“GA008”,72},{“GA006”,65},{“GA015”,83},{“GA013”,95},{“GA012”,55},{“GA014”,68},{“GA01l”,78},{“GA017”,53},{“GA018”,92},{“GA016”,82}};int i;FILE *out;fun(s);printf(“The data after sorted :\n”);for(i=0;i<N;i++){if((i)%4==0)/*每行输出4个学生记录*/printf(“\n”);printf(“%s %4d ”,s[i].num,s[i].s);}printf(“\n”);ut=fopen(“out21.dat”,“w”);for(i=0;i<N;i++){if((i)%4==0i)fprintf(out,“\n”);fPrintf(out,“%4d”,s[i].s);}fprintf(out,“\n”);fClose(out);}
下列Application程序输入一个整数,求出它的所有因子,请根据注释,将程序补充完整。public class test19_2 {public static void main(String args[])throws IOException {int n;//下面7行语句的作用是从键盘输入n的值InputStreamReader ir;BufferedReader in;ir=new lnputStreamReader(System.in);in=new BufferedReader(ir);System.out.println("Input n is:");String s=in.______;//读取1行字符n=Integer.parseInt(s);//下面求n的所有因子______(int i=1;i=n;i++) {if(n%i!=0)______;//跳过打印语句回到循环起始System.out.print(i+””);}System.out.print(“\n”);}
下列代码的执行结果是()。publicclasstest5{publicstaticvoidmain(Stringargs[]){Strings1=newString("hello");Strings2=newString("hello");System.out.prim(s1==s2);System.out.print(",");System.out.println(s1.equals(s2));}A.true,falseB.true,trueC.false,trueD.false,false
写异步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
请将下面程序补充完整。public class PowerCalc{public static void main(String[]args){double x=5.0;System. out. println(x+"to the power 4 is"+power(x, 4));System. out. println("7. 5 to the power 5 is"+power(7.5, 5));System. out. println("7.5 to the power 0 is"+power(7.5, 0));System. out. println("10 to the power -2 is"+power(10, -2));}static double【 】 (double x, int n){if(n>1)return x * power(x, n-1);else if(n<0)return 1.0/power(x, -n);elsereturn n==0 ? 1.0:x;}}
以下程序的功能是处理由学号和成绩组成的学生记录,N名学生的数据已在主函数中放入结构体数组s中,程序的功能是把分数最高的学生数据放在h所指的数组中。注意:分数高的学生可能不只一个,函数返回分数最高学生的人数。请填空。#include stdio.h#define N 16typedef struct{ char num[10]; int s;} STREC;int fun(STREC *a,STREC *b){ int i,j=0,max=a[0].s; for(i=0;iN;i++) if(maxa[i].s)max=a[i].s; for(i=0;iN;i++) if()b[j++]=a[i]; return j;}main(){ STREC s[N]={ {"GA005",85},{"GA003",76},{"GA002",69},{"GA004",85}, {"GA001",91},{"GA007",72},{"GA008",64},{"GA006",87}, {"GA015",85},{"GA013",91},{"GA012",64},{"GA014",91}, {"GA011",66},{"GA017",64},{"GA018",64},{"GA016",72}}; STREC h[N]; int i,n;FILE *out; n=fun(s,h); printf("The %d highest score :\n",n); for(i=0;in;i++) printf("%s %4d\n",h[i].num,h[i].s); printf("\n"); out=fopen("out15.dat","w"); fprintf(out, "%d\n",n); for(i=0;in;i++); fprintf(out, "%4d\n",h[i].s); fclose(out);}
下列代码的执行结果是( )。 public class test4{ public smile void main(string args[]){ int a=4,b=6,c=8; String s="abc"; Sy stem.out.println(a+b+s+e); System.out.pfinfin(); } }A.ababccB.464688C.46abc8D.10abc8
在J2EE中,下面的代码中出现编译错误的是()。A.Filef=newFile("/","autoexec.bat");B.DataInput Streamdin=new Data Input Stream(new File Input Stream("autoexec.bat"));C.Input Stream Readerin=new Input Stream Reader(System.in);D.Output Stream Writer out=new Output Stream Writer(System.in);
阅读以下说明,回答问题1至问题3。【说明】 Plug-gw是Linux配置中常带的通用代理程序,可用来代理POP3、HTTP等应用层服务。附图3为某网络结构图,内部网段上有一台POP3服务器和一台FTP服务器。代理服务器中使用ipchains包过滤技术来实现防火墙功能。ipchains的部分相关信息如下:/sbin/ipchains-A input-p tcp-s 0.0.0.0/0 1024:-d 192.168.11.2/32 ftp-I eth0 - j ACCEPT/sbin/ipchains-A input-p tcp-s (1) 1024:-d 192.168.80.2/32 (2) -I eth0 - j DENY/sbin/ipchains-A input-p tcp-s 0.0.0.0/0 1024:-d 192.168.11.2/32 ftp-data-I eth0 - j ACCEPT/sbin/ipchains-A input-p tcp-s 192.168.11.2/32 ftp-d 0.0.0.0/0 1024:-I eth1 - j ACCEPT/sbin/ipchains-A input-p tcp-s 192.168.11.2/32 ftp-data-d 0.0.0.0/0 1024:-I eth1 - j ACCEPT/sbin/ipehains-A input-p tcp-s 192.168.11.0/24 1024:-d 0.0.0.0/0 ftp-I eth1-j ACCEPT/sbin/ipchains-A input-p tcp-s (3) 1024:-d 0.0.0.0/0 ftp-data-I (4) - j DENY/sbin/ipchains-A input-p tcp-s 192.168.11.0/24 1024:-d 0.0.0.0/0 ftp-data-I eth1 - j ACCEPT/sbin/ipchains-A input-p tcp-s 0.0.0.0/0 ftp-d 192.168.11.0/24 1024:-I eth0-j ACCEPT/sbin/ipchains-A input-p tcp-s 0.0.0.0/0 ftp-data-d 192.168.11.0/24 1024:-I eth0 - j ACCEPT简述本题中POP3服务的实现过程。
下列代码的执行结果是( )。 int length="Hell0".length; System.OUt.println(length); A.5S 下列代码的执行结果是( )。 int length="Hell0".length; System.OUt.println(length);A.5B.2C.10D.6
下面程序的输出结果是( )。 public class Sun { public static void main(String args[]) { int[] a={1,2,3,4); int j=1,s=0; for(int i=3;i>=0;i--) { s=s+a[i]*j; j=j*10; } System.out.println(s); } }A.1234B.21C.43D.4321
本题读取用户输入的字符流,直到用户输入字符串quit后结束。importjava.io.*;public class javal{public static void main(String[]args){;BufferedReader in;ir=new InputStreamReader(System.in);in=new BufferedReader(ir);System.OUt.println("please input:");while( ){try{String s=in.readLine();System.out.println("echo:"+s);if(S.equals("quit"));)catch(Exception e){}}}}
下面代码输出结果是( )。inti=0,s=0;do{if(i%2==0){i++;continue;}i++;s=s+i;}while(i 下面代码输出结果是( )。inti=0,s=0;do{if(i%2==0){i++;continue;}i++;s=s+i;}while(iSystem.out.println(s);A、16B、12C、28D、21
下列代码的执行结果是( )。 public class Test { public static void main(String args[ ]) { int a =4,b=6,c=8; String s ="abc"; System.out.println(a+b+s+c); System.out.println(); } }A.ababccB.464688C.46abc8D.10abc8
下列程序运行后的输出结果是( )。 public class Sun { public static void main(String args[]) { int i,j,s; s=0; for(i=1;i<=3;i++) for(j=0;j<=i-1;j++) s=s+1; System.out.println(s); } }A.6B.5C.4D.3
Which three route filtering statements are true?() A. After the router ospf 10 and passive - interface s0/0 commands have been issued , the s0/0 interface will not send any OSPF updates, but will receive routing updates on that interfaceB. When you use the passive - interface command with RIPv2, multicasts are sent out the specified interfaceC. After the router rip and passive -interface s0/0 commands have been issued, the s0/0 interface will not send any RIP updates, but will receive routing updates on that interfaceD. When you use the passive - interface command with EIGRP, hel lo messages are not sent out the specified interfaceE. After the router eigrp 10 and passive - interface s0/0 commands have been issued, the s0/0 interface will not send any EIGRP updates, but will receive routing updates on that interfaceF. When you use the passive - interface command with OSPF, hello messages are not sent out the specified interface
下列程序的主要功能是()。 #include main( ) { FILE *in,*out; char ch,infile[10],outfile[10]; printf(“Enter the infile name:/n”); scanf(“%s”,infile); printf(“Enter the outfile name:/n”); scanf(“%s”,outfile); if((in=fopen(infile, “r”))==NULL){ printf(“Cannot open infile/n”); exit(0); } if((out=fopen(outfile, “w”))==NULL){ printf(“Cannot open outfile/n”); exit(0); } while(!feof(in)) fputc(fgetc(in),out); fclose(in); fclose(out); }
7360 show port(nt-a:xfp:1)后得到如下反馈Traffic Statistics =============================================================================== Input Output ------------------------------------------------------------------------------- Octets 0 0 Packets 0 0 Errors 0 0 以下说法正确的是:()A、Input代表下行方向流量B、Input代表上行方向流量C、Output代表下行方向流量D、Output代表上行方向流量
Which three route filtering statements are true?()A、After the router ospf 10 and passive - interface s0/0 commands have been issued , the s0/0 interface will not send any OSPF updates, but will receive routing updates on that interfaceB、When you use the passive - interface command with RIPv2, multicasts are sent out the specified interfaceC、After the router rip and passive -interface s0/0 commands have been issued, the s0/0 interface will not send any RIP updates, but will receive routing updates on that interfaceD、When you use the passive - interface command with EIGRP, hel lo messages are not sent out the specified interfaceE、After the router eigrp 10 and passive - interface s0/0 commands have been issued, the s0/0 interface will not send any EIGRP updates, but will receive routing updates on that interfaceF、When you use the passive - interface command with OSPF, hello messages are not sent out the specified interface
Examine the following configuration on Router R1. R1's show ip route 172.16.4.1 command list s a route with outgoing interface S0/1/1. Host 172.16.3.3 uses telnet to connect to host 172.16.4.1.What will Router R1 do with the packets generated by host 172.16.3.3 because of the telnet,assuming the packets enter R1's F0/0 interface?() interface Fastethernet 0/0 ip address 172.16.1.1 255.255.255.0 ip policy route - map Q2 ! route - map Q2 permit match ip address 101 set interface s0/0/1 ! access - list 101 permit tcp host 172.16.3.3 172.16.4.0 0.0.0.255A、The packet will be forwarded out S0/0 /1, or not at all.B、The packet will be forwarded out S0/0/1 if it is up.C、The packet will be forwarded out S0/1/1 if it is up.D、The packet will be forwarded out S0/1/1 if it is up, or if it is not up, out s0/0/1.E、The packet will be forwarded o ut S0/0/1 if it is up, or if it is not up, out s0/1/1.
public class SyncTest{ public static void main(String args) { final StringBuffer s1= new StringBuffer(); final StringBuffer s2= new StringBuffer(); new Thread () { public void run() { synchronized(s1) { s2.append(“A”); synchronized(s2) { s2.append(“B”); System.out.print(s1); System.out.print(s2); } } } }.start(); new Thread() { public void run() { synchronized(s2) { s2.append(“C”); synchronized(s1) { s1.append(“D”); System.out.print(s2); System.out.print(s1); } } } }.start(); } } Which two statements are true? ()A、 The program prints “ABBCAD”B、 The program prints “CDDACB”C、 The program prints “ADCBADBC”D、 The output is a non-deterministic point because of a possible deadlock condition.E、 The output is dependent on the threading model of the system the program is running on.
单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是( )。A****,4B****,13CTHIS,4DTHIS,13
填空题下列程序的主要功能是()。 #include main( ) { FILE *in,*out; char ch,infile[10],outfile[10]; printf(“Enter the infile name:/n”); scanf(“%s”,infile); printf(“Enter the outfile name:/n”); scanf(“%s”,outfile); if((in=fopen(infile, “r”))==NULL){ printf(“Cannot open infile/n”); exit(0); } if((out=fopen(outfile, “w”))==NULL){ printf(“Cannot open outfile/n”); exit(0); } while(!feof(in)) fputc(fgetc(in),out); fclose(in); fclose(out); }
多选题public class SyncTest{ public static void main(String args) { final StringBuffer s1= new StringBuffer(); final StringBuffer s2= new StringBuffer(); new Thread () { public void run() { synchronized(s1) { s2.append(“A”); synchronized(s2) { s2.append(“B”); System.out.print(s1); System.out.print(s2); } } } }.start(); new Thread() { public void run() { synchronized(s2) { s2.append(“C”); synchronized(s1) { s1.append(“D”); System.out.print(s2); System.out.print(s1); } } } }.start(); } } Which two statements are true? ()AThe program prints “ABBCAD”BThe program prints “CDDACB”CThe program prints “ADCBADBC”DThe output is a non-deterministic point because of a possible deadlock condition.EThe output is dependent on the threading model of the system the program is running on.