fibonacci_series_report _
fibonacci_series_report _
Lab report
Aditya Kumar
System On Chip Design
IIT PALAKKAD
152402001@smail.iitpkd.ac.in
September 2024
Abstract
This paper presents the design and implementation of a Fi-
bonacci generator using Verilog, a hardware description lan-
guage widely used for digital circuit design
1 Introduction
The Fibonacci series is a famous sequence of numbers in which each number
is the sum of the two preceding ones. It typically starts with 0 and 1. The
sequence can be defined mathematically as follows:
• F(0) = 0
• F(1) = 1
• F(n) = F(n-1) + F(n-2) for n ≥ 2
A Fibonacci generator can be implemented in various programming languages,
allowing users to generate the sequence either as a list or as a series of numbers
on demand.Generators, in particular, are useful in programming because they
allow for memory-efficient computation. Instead of storing the entire sequence
in memory, a generator can yield one number at a time, making it suitable for
scenarios where only a portion of the sequence is needed or when working with
large values of n.By utilizing Fibonacci generators, programmers can efficiently
explore mathematical properties, create algorithms, or even model real-world
phenomena that follow the Fibonacci pattern.It also has applications in com-
puter science, economics, and art.
In this lab we are going to implement the n-bit fibonacci generator with both
synchronous reset and asynchronous reset and also we are going to get the
related waveforms.
1
Figure 1: Block Diagram of fibonacci generator
2 Implementation details
For implementing n-bit fibonacci generator,first we have to implement two n-bit
registers and a n-bit adder.To implement a n-bit register we have to first imple-
ment a D flip-flop and also we have to implement a full adder for implementing
a n-bit adder.Let us see the different components which we are using here to
implement fibonacci generator.
2.1 D Flip-Flop
D flip-flop operates based on the timing of clock signals and the value of the
data input.The characteristic equation of a D flip-flop describes the relationship
between the inputs and the output. It can be expressed as:
Q(t + 1) = D(t)
2
Figure 2: D flip-flop
3
2.2 Full Adder
A full adder is a digital circuit that performs addition of binary numbers. It
is capable of adding three inputs: two significant bits and a carry bit from a
previous less significant addition. The output consists of a sum bit and a carry-
out bit.
Characteristic equation :
Sum (s) = A ⊕ B ⊕ C
4
Figure 6: verilog code of n-bit register
5
Figure 8: verilog code of fibonacci generator
2.6 Testbench
To verify that the Fibonacci generator correctly computes the Fibonacci se-
quence for a range of input values, we need a testbench.
The testbench will typically include :
• A clock pulse of width 10 nanosecond.
• A width parameter ’n’ which is 8 here.
• A reset pulse and an end time for simulation to end here it is 1000 ns.
6
Figure 9: Testbench verilog code
7
3 Experiment results
This report presents the experimental results of a Fibonacci generator designed
with both asynchronous and synchronous reset functionalities. The primary
objectives were to validate the correct operation of the Fibonacci sequence gen-
eration and to assess the behavior of the reset mechanisms.
4 Conclusion
In this lab experiment, we successfully designed and implemented a parameter-
ized N-bit Fibonacci generator using Verilog.This lab highlights the capability
of Verilog to model and simulate combinational or sequential logic, allowing us
to generate Fibonacci numbers in real-time.