Posts

Showing posts with the label Fibonacci number

Program in HDL to generate nth Fibonacci number Where n is the input?

Image
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: Weekendvlsi.blogspot.com // Engineer: Weekendvlsi //  // Create Date: 27-11-2021 // Design Name:  // Module Name:  // Project Name: Printing nth Fibonacci // Target Devices:  // Tool Versions:  // Description:  //  // Dependencies:  //  // Revision: // Revision 0.01 - File Created // Additional Comments: //  ////////////////////////////////////////////////////////////////////////////////// module nth_fibonacci_num( input clk,  input rst,   input [7:0] nth_fibonacci_req, output [19:0] nth_fibonacci_value     ) ;  reg [19:0] previous_value, present_value;     reg [7:0] ctr;     reg output_valid;  assign nth_fibonacci_value = present_value ; always @( posedge clk) begin         if (rst) begin             previous_value...