| |||
记录下新学习到的内容
Verilog中case多状态同操作的简便写法
不方便的重复写法:
case(state)
'd0: begin
do something;
end'd1: begin
do something;
end'd2: begin
do something;
enddefault: begin
do otherthing;
end
endcase
简便写法:
case(state)
'd0, 'd1, 'd2: begin
do something;
end
default: begin
do otherthing;
end
endcase
与C语言的区别,是C语言多状态同一操作是:
switch(state)
{
case s1:
case s2://(不使用break即可)
case s3: do something;
default:break;
}
好害怕被各位大佬嫌弃