作者tkhan (脑侠)
看板Electronics
标题Re: [问题] verilog的问题
时间Tue Mar 21 17:16:02 2006
※ 引述《stevenf3 (Life)》之铭言:
: 下面是我写的多工器部分code..
: 不知道哪里错了..
: 一直出现Error: Lval 'result' cannot be a net
: 麻烦帮帮忙~_~...跟他非常不熟orz
: input[3:0] a,b,c,d,e,f,g,h;
: input[2:0] select;
: output[3:0] result;
reg [3:0] result;
always @(select or a or b or c or d or e or f or g or h)
begin
: case(select[2])
: 1'b0: begin
: result = (select[1]==0)?(select[0]==0?a:b):(select[0]==0?c:d);
: end
: 1'b1: begin
: result = (select[1]==0)?(select[0]==0?e:f):(select[0]==0?g:h);
: end
: endcase
end
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.66.243.100