0
13kviews
Write VHDL code for Fibonacci Series Generator.
1 Answer
0
2.1kviews

Diagram:-

enter image description here

Simulation Output:-

enter image description here

Code:-

------------------------------------------------------------
ENTITY fibonacci IS
GENERIC (N: INTEGER := 16); ------number of bits
PORT (clk, rst : IN BIT;
fibo_series : OUT INTEGER RANGE 0 TO 2**N-1);
END fibonacci;
------------------------------------------------------------
ARCHITECTURE fibonacci OF fibonacci IS
SIGNAL a,b,c: INTEGER RANGE 0 TO 2**N-1;
BEGIN
PROCESS (clk,rst)
BEGIN
IF (rst='1') THEN
b <= 1;
c <= 0;
ELSIF (clk'EVENT AND clk-'1') THEN
c <= b;
b <= a;
END IF;
a <= b +c;
END PROCESS;
fibo_series <= c;
END fibonacci;
Please log in to add an answer.