All four binary selections are covered; default handles values containing simulation unknowns. o_data also receives a default at the start of the block.
case compares all four states exactly, including x and z. casez treats z and ? as wildcards, including in the selector expression. casex also treats x as a wildcard and can hide unknown inputs. For first RTL decoders, prefer case with an explicit default.
Spot unintended storage
In this incomplete combinational block, o_data receives no value when i_enable is 0:
Retaining its previous value requires a latch. To output zero while disabled, describe that behavior:
always @* begin o_data = 8'h00; if (i_enable) o_data = i_data;end
A latch is valid hardware; it becomes a defect when an omitted branch introduces one into intended combinational logic.
Assign every output on every path, often through defaults at the beginning. Review branches and lint or synthesis warnings afterwards.
Read the clocked context
In an edge-triggered block, no assignment normally means register hold:
always @(posedge i_clk) begin if (i_load) o_data <= i_data;end
An omitted branch therefore has different consequences in always @* and always @(posedge i_clk). Identify the block model before concluding that a latch is present.