打印

请教一个Verilog问题!

[复制链接]
926|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
lake198664|  楼主 | 2007-8-27 01:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
小弟编写的这个程序是想让FPGA在高电平时输出一个数,而在低电平时输出另一个数,为什么在看仿真波形时只有低电平时的数呢?请各位大虾指点指点!


module ssj (
            //input
            clk1k,
            //output
            datan,
            dataa,
            datar
            );
input clk1k;
output [9:0]datan;
output [5:0]dataa;
output [2:0]datar;

wire [9:0]datan;
wire [5:0]dataa;
wire [2:0]datar;

reg [9:0]temp1;
reg [5:0]temp2;
reg [2:0]temp3;
/********************************/
always @(temp1 or temp2 or temp3)
    begin
      if(clk1k==1)
        begin
            temp1<=10'b00_0100_1110;
            temp2<=6'b11_0000;
            temp3<=3'b101;
        end
      else
        begin
            temp1<=10'b00_0100_1111;
            temp2<=6'b01_1000;
            temp3<=3'b101;
        end
    end
assign      datan=temp1;
assign        dataa=temp2;
assign        datar=temp3;
        
/**********************************/
endmodule

相关帖子

沙发
McuPlayer| | 2007-8-28 03:52 | 只看该作者

always的敏感列表

temp1 or temp2 or temp3,这不**生蛋蛋生**的问题了吗
改成clk就好了

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

44

主题

113

帖子

0

粉丝