Error (10170):Verilog HDL syntax error at Verilog1.v(2) near text "74138"; expecting an identifier/*TTL module 74138*/module 74138(Y,A,G1,G2);output[7:0]Y;input[2:0]A;input G1,G2;reg[7:0]Y:wire G;assign G=G1&~G2;always@(A or G1 or G2);beginif(G)case(

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 06:45:50
Error(10170):VerilogHDLsyntaxerroratVerilog1.v(2)neartext"74138";expectinganidentifier/*TTLmodule741

Error (10170):Verilog HDL syntax error at Verilog1.v(2) near text "74138"; expecting an identifier/*TTL module 74138*/module 74138(Y,A,G1,G2);output[7:0]Y;input[2:0]A;input G1,G2;reg[7:0]Y:wire G;assign G=G1&~G2;always@(A or G1 or G2);beginif(G)case(
Error (10170):Verilog HDL syntax error at Verilog1.v(2) near text "74138"; expecting an identifier
/*TTL module 74138*/
module 74138(Y,A,G1,G2);
output[7:0]Y;
input[2:0]A;
input G1,G2;
reg[7:0]Y:
wire G;
assign G=G1&~G2;
always@(A or G1 or G2);
begin
if(G)
case(A)
3'd0:Y=8'b11111110;
3'd1:Y=8'b11111101;
3'd2:Y=8'b11111011;
3'd3:Y=8'b11110111;
3'd4:Y=8'b11101111;
3'd5:Y=8'b11011111;
3'd6:Y=8'b10111111;
3'd7:Y=8'b01111111;
endcase
else
Y=8'b11111111;
end
endmodule
module exam3(D8,D7,D6,K8,K7,K6);
output D8,D7,D6;
input k8,k7,k6;
wire[7:0]Y;
wire[2:0]A;
wire VCC,GND;
assign A[2]=K8;
assign A[1]=K7;
assign A[0]=K6;
assign VCC=1;
assign GND=0;
//module 138(Y,A,G1,G2);
74138u1(.Y(Y),.A(A),.G1(VCC),.G2(GND));
nand u2(D8,Y[6],Y[5],Y[4],Y[3]);
nand u3(D7,Y[3],Y[3],Y[1]);
nand u4(D6,Y[5],Y[3],Y[2]);
endmodule

Error (10170):Verilog HDL syntax error at Verilog1.v(2) near text "74138"; expecting an identifier/*TTL module 74138*/module 74138(Y,A,G1,G2);output[7:0]Y;input[2:0]A;input G1,G2;reg[7:0]Y:wire G;assign G=G1&~G2;always@(A or G1 or G2);beginif(G)case(
/*TTL module 74138*/
module a74138(Y,A,G1,G2);
output[7:0]Y;
input[2:0]A;
input G1,G2;
reg[7:0]Y;
wire G;
assign G=G1&~G2;
always@(A or G1 or G2)
begin
\x05\x05if(G)
\x05\x05case(A)
3'd0:Y=8'b11111110;
3'd1:Y=8'b11111101;
3'd2:Y=8'b11111011;
3'd3:Y=8'b11110111;
3'd4:Y=8'b11101111;
3'd5:Y=8'b11011111;
3'd6:Y=8'b10111111;
3'd7:Y=8'b01111111;
endcase
else
Y=8'b11111111;
end
endmodule
module exam3(D8,D7,D6,K8,K7,K6);
output D8,D7,D6;
input K8,K7,K6;
wire[7:0]Y;
wire[2:0]A;
wire VCC,GND;
assign A[2]=K8;
assign A[1]=K7;
assign A[0]=K6;
assign VCC=1;
assign GND=0;
//module 138(Y,A,G1,G2);
a74138 u1(.Y(Y),.A(A),.G1(VCC),.G2(GND));
nand u2(D8,Y[6],Y[5],Y[4],Y[3]);
nand u3(D7,Y[3],Y[3],Y[1]);
nand u4(D6,Y[5],Y[3],Y[2]);
endmodule
模块名不能为纯数字组合+若干低级错误
我改过编译通过了,你自己对照着看吧
望及时采纳!