FFT Using VHDL
FFT Using VHDL
FFT Using VHDL
A = x + Wn * y;
A_r + j*A_i = (x_r + j* x_i) + ( w_r + j*w_i) *(y_r + j*y_i);
A_r + j*A_i = (x_r + (w_r * y_r ) ( w_i *y_i)) + j*(x_i +( w_i *y_r) +( w_r
* y_i));
B = x-+ Wn * y;
B_r + j*B_i = (x_r + j* x_i) - ( w_r + j*w_i) *(y_r + j*y_i);
B_r + j*B_i = ( x_r - (w_r *y_r) + (w_i * y_i)) + (x_i (w_r * y_i ) (w_i *
y_r ));
B_r =( x_r - (w_r *y_r) + (w_i * y_i);
B_i = x_i (w_r * y_i ) (w_i * y_r );
Entity fft_radix_2 is
port (
x_r
y_r
x_i
y_i
w_r
w_i
A_r
A_i
B_r
B_i
);
end fft_radix_2;
architecture behavioral of fft_radix_2 is
signal product_1,product_2 : std_logic_vector(15 downto 0);
begin
product_1 <= (y_r*w_r) - (y_i*w_i);
product_2 <= (y_r*w_i) + (y_i*w_r);
A_r <= x_r + product_1(7 downto 0);
A_i <= x_i + product_2(7 downto 0);
B_r <= x_r - product_1(7 downto 0);
B_i <= x_i - product_2(7 downto 0);
DUT:process
begin
x_r <="00000110";
y_r <="00000100";
x_i <="00000010";
y_i <="00000001";
w_r <="00000001";
w_i <="00000000";
wait;
end process DUT;
end architecture;
Imaginary_part of Output-A
Imaginary_part of Output-B
3). Represent the FFT process by means of a scheduled sequencing graph considering
ASAP and ALAP schedules.
ASAP:(As Soon As Possible) Here some computations are performed in the first cycle
ALAP:(As Late As Possible) Here some computations need not be computed in the first cycle.
4. Assume that only one ALU (for addition. comparison, etc) and one multiplier is available.
Draw a scheduled sequencing graph for the process taking resource constraints into
consideration and considering minimum number of clock cycles.
When there are only one multiplier and one ALU it takes minimum 8-clock
cycles to complete the entire operation. So the latency of the sequencing graph is =
8*T
5). Obtain two designs of the FFT processor from problem 2 and problem 4 and
realize a structural model of the processor in VHDL.
---------------------------------------------------- DATA FLOW STRUCTURAL model of FFT algorithm
-- using 2 ALUs and 2 multipliers
---------------------------------------------------
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
entity data_flow_fft_struct is
GENERIC (
N
: INTEGER := 8
);
port (
clk
reset
: in std_logic;
: in std_logic;
data_valid_in : in std_logic;
ain_r
bin_r
ain_i
bin_i
w_r
w_i
aout_r
aout_i
bout_r
bout_i
);
end data_flow_fft_struct;
: std_logic;
time6
);
signal next_state : times;
begin
process(clk,reset)
begin
if( reset ='0' ) then
a_r_t
a_i_t
aout_r
bout_r
aout_i
bout_i
Add_sub_1
<= '1';
Add_sub_2
<= '1';
<= time1;
case next_state is
when time1 =>
if (data_valid_in='1')then
mul1_in_1 <= bin_r;
mul1_in_2 <= w_r;
Add_sub_1<='0';
ALU1_in_1 <= ain_r;
ALU1_in_2 <= ALU1_out_b;
Add_sub_2<='0';
ALU2_in_1 <= ain_i;
ALU2_in_2 <= ALU2_out_b;
next_state <= time6;
when time6 =>
aout_r <= a_r_t;
aout_i <= a_i_t;
bout_r <= ALU1_out;
bout_i <= ALU2_out;
data_valid_out <='1';
next_state <= time6;
entity resrc_constraint_fft is
GENERIC ( N : INTEGER := 8
);
PORT ( x_r : inout std_logic_vector(N-1 downto 0);
x_i : inout std_logic_vector(N-1 downto 0);
y_r : inout std_logic_vector(N-1 downto 0);
y_i : inout std_logic_vector(N-1 downto 0);
time4,
time5,
time6,
time7,
time8,
time9
);
signal next_state:times;
begin
process(reset,clk)
begin
if (reset = '0') then
A_r <= (others=>'0');
A_i <= (others=>'0');
B_r <= (others=>'0');
B_i <= (others=>'0');
-- Add_sub <= (others =>'0');
a_r_t <= (others =>'0');
a_i_t <= (others =>'0');
b_r_t <= (others =>'0');
--
DUT:process
begin
x_r <= "00000110";
x_i <= "00000010";
y_r <= "00000100";
y_i <= "00000001";
w_r <= "00000001";
6). Synthesize the models in problem 5 on Altera Quartus II synthesis tool and
compare the resource utilization summary in the two cases.
Synthesized the problems in Quartus II by selecting EP2C20F484c7 FPGA
Problem-2 uses the resources as follows
Total=126/18,752 (<1%)
Combinational with no registers =27
Data flow graph uses more number of resources than the resource constraint sequencing graph.