module decoder7seg (c,hex0);
input[2:0] c;
output[0:6] hex0;
wire tmp0,tmp1,tmp2,tmp3,tmp4;
assign tmp0=(c==3'd0);
assign tmp1=(c==3'd1);
assign tmp2=(c==3'd2);
assign tmp3=(c==3'd3);
assign tmp4=(c>=3'd4);
assign hex0=(tmp0&(7'b1001000))|(tmp1&(7'b0110000))|(tmp2&(7'b1110001))|(tmp3&(7'b0000001))|(tmp4&(7'b1111111));
/*reg[0:6] hex0;
always@ *
begin
case(c)
3'd0:hex0<=7'b1001000;
3'd1:hex0<=7'b0110000;
3'd2:hex0<=7'b1110001;
3'd3:hex0<=7'b0000001;
default:hex0<=7'b1111111;
endcase
end*/
endmodule
上面代码就是一个简单的数码管的显示译码器Verilog程序,用always@过程语句实现时没有任何问题,但是使用assign+布尔逻辑表达式时,结果异常,warining提示:Warning: Output pins are stuck at VCC or GND
Warning: Design contains 1 input pin(s) that do not drive logic
——Warning (15610): No output dependent on input pin "c[0]"
Warning: Following 6 pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results
求帮忙,大家帮我分析下为什么,我个人认为问题应该出现在assign hex0=(tmp0&(7'b1001000))|(tmp1&(7'b0110000))|(tmp2&(7'b1110001))|(tmp3&(7'b0000001))|(tmp4&(7'b1111111));
但是不知道如何解决,请大家帮帮忙,急啊!
此帖出自
小平头技术问答
一周热门 更多>