在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2740|回复: 4

[求助] 一段verilog程序求解

[复制链接]
发表于 2015-6-26 18:18:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

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. 这是什么问题,求大神解决
发表于 2015-6-26 20:39:31 | 显示全部楼层
单文件还是多文件?单文件的话 chip74x148 是什么鬼!
发表于 2015-6-27 16:52:54 | 显示全部楼层
chip74x148 u1(e1,~r_l,   //109行
               ~a,~avalid);
a是输出wire,怎么能取反连到chip74x148上呢?
试试模块例会时不要用逻辑运算符
发表于 2015-6-28 09:22:49 | 显示全部楼层
109行是哪一行呢,说明白好些
发表于 2016-3-14 13:49:07 | 显示全部楼层
回复 1# chang75161

"bianma2.v"是你那个文件的名字呀我也出现了相同的问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-20 21:26 , Processed in 0.018256 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表