BCD Суматор

Задача 1

Променете схемата за генериране на реда на Фибоначи, така че числата да са в BCD код.

module fibo_counter(
   input 	 clock,
   input 	 reset,
   output [15:0] fn_out
   );

   reg [15:0] 	 fn_minus_1, fn_minus_2;
   wire [15:0]	 fn;

   assign fn_out = fn_minus_2; 
   //assign fn = fn_minus_2 + fn_minus_1;
   
   bcd_adder a1(
	.a(fn_minus_2),
	.b(fn_minus_1),
	.s(fn)
   );

   always @(posedge clock or posedge reset) 
     begin
	if(reset)
	  begin
	     fn_minus_2 <= 0;
	     fn_minus_1 <= 1;
	  end
	else
	  begin
	     fn_minus_2 <= fn_minus_1;
	     fn_minus_1 <= fn;
	  end
    end
endmodule
module bcd_adder(
    input [15:0] a,
    input [15:0] b,
    output [15:0] s
    );

// TODO

endmodule
module bcd_digit(
    input [3:0] a,
    input [3:0] b,
    input cin,
    output reg[3:0] s,
    output reg cout
    );
    
// TODO

endmodule