|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
module chip74ls138(sta,stb,stc,a,
y);
//port declarations
input sta,stb,stc; //When sta is 1 and stb and stc are 0,the output y is valid.
input [2:0] a;
output [7:0] y;
//signal declarations
reg [7:0] y;
//body
always @(*)
begin
if((!sta)|stb|stc)
y=8'bx;
else
begin
case(a)
3'b000 : y=8'b00000001; //low power is effective
3'b001 : y=8'b00000010;
3'b010 : y=8'b00000100;
3'b011 : y=8'b00001000;
3'b100 : y=8'b00010000;
3'b101 : y=8'b00100000;
3'b110 : y=8'b01000000;
3'b111 : y=8'b10000000;
default : y=8'bx ;
endcase
end
end
endmodule
module dual_priority_encoder(e1,r_l,e2,e3,e4,
a,b,avalid, bvalid);
//port declarations
input e1,e2,e3,e4; //ei is effective for high power. ei for low power ,74x148 start working.
input[7:0] r_l; // r_l for 8-bit input
output avalid,bvalid; //eo and bvalid are equivalent to eo and 74x148 in gs
output [2:0] a,b; //b for 3-bit output.
//signal declarations
wire eo;
wire [7:0]y;
wire [7:0] r_l_n=~r_l; //r_l is effective for high power.
wire [7:0] r_l_nand=(r_l_n & (~y)) ; //r_l_nand is the result of r_l_n and y with nand.
chip74x148 u1(e1,~r_l, //109行
~a,~avalid);
chip74ls138 u2(~avalid,e2,e3,a,
y);
chip74x148 u3(e4,r_l_nand,
~b,~bvalid);
endmodule
ERROR:Xst:872 - "bianma2.v" line 109: Unsupported target. 这是什么问题,求大神解决 |
|