|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
module decoder
(
num, num_seg
);
input[3:0] num;
output[7:0] num_seg;
reg[7:0] num_seg;
always @(num)
begin
case(num[3:0])
4'd0 : num_seg = 8'b1100_0000;
4'd1 : num_seg = 8'b1111_1001;
4'd2 : num_seg = 8'b1010_0100;
4'd3 : num_seg = 8'b1011_0000;
4'd4 : num_seg = 8'b1001_1001;
4'd5 : num_seg = 8'b1001_0010;
4'd6 : num_seg = 8'b1000_0010;
4'd7 : num_seg = 8'b1111_1000;
4'd8 : num_seg = 8'b1000_0000;
4'd9 : num_seg = 8'b1001_0000;
endcase
end
endmodule
Warning (10240): Verilog HDL Always Construct warning at decoder.v(10): inferring latch(es) for variable "num_seg", which holds its previous value in one or more paths through the always construct
Warning: Latch decoder:u3|num_seg[0] has unsafe behavior
运行是没有问题,就是会有这个警告,有没有遇到过这个问题的朋友呢 |
|