/* 
(C) OOMusou 2008 http://oomusou.cnblogs.com

Filename    : Add2_always_good.v
Compiler    : Quartus II 8.0
Description : Demo how to write y = a + b;
Release     : 10/04/2008 1.0
*/

module Add2_always_good (
  input            iCLK,
  input            iRST_N,
  input      [7:0] iA,
  input      [7:0] iB,
  output reg [8:0] oSUM
);

reg [7:0] a, b;

always@(posedge iCLK, negedge iRST_N) begin
  if (!iRST_N) begin
    a    <= 0;
    b    <= 0;
    oSUM <= 0;
  end
  else begin
    a    <= iA;
    b    <= iB;
    oSUM <= a + b;
  end
end

endmodule