微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 一段verilog程序求解

一段verilog程序求解

时间:10-02 整理:3721RD 点击:
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. 这是什么问题,求大神解决

单文件还是多文件?单文件的话 chip74x148 是什么鬼!

chip74x148 u1(e1,~r_l,   //109行
               ~a,~avalid);
a是输出wire,怎么能取反连到chip74x148上呢?
试试模块例会时不要用逻辑运算符

109行是哪一行呢,说明白好些


"bianma2.v"是你那个文件的名字呀我也出现了相同的问题

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top