module saturation_arith(A, B, C); input [7:0] A, B; output [7:0] C; reg [7:0] C; reg [8:0] temp; always@(A or B) begin temp = A + B; if( temp[8] == 1'b1) C = 8'b11111111; else C[7:0] = temp[7:0]; //if( A + B > 255 ) C = 255; //else C = A + B; end endmodule