Forum Discussion
Altera_Forum
Honored Contributor
14 years agosynthesis of several "if..if...if "sentence.
always @(posedge clk or negedge rst)begin if(!rst)begin ..... end else begin if(a) .... if(b) .... if(c) .... end end I found tha...
Altera_Forum
Honored Contributor
14 years agoYes by making multiple assignments in an if cascade you ended up coding priority into the assignment. You could do a one-hot mux like this assuming a, b, and c are asserted mutually exclusively:
always @ (a or b or c)
begin
case ({c, b, a})
3'b001: <expression>;
3'b010: <expression>;
3'b100: <expression>;
default: <expression>; // this case can never happen if only one of a, b, or c are ever enabled at any given time
endcase
end