Verilog Arithmetic with 8 bits
The &lt;= operator can only be used within a procedural block.

A procedural block is begin with the keyword always or initial.

Since you haven't used either of these keywords, you can't use the &lt;= operator.

If you want x1 and x2 to change whenever the inputs change, you should use an assign statement, for example

assign x1 = n1 - n2;