Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

half-band filter code

Status
Not open for further replies.

triump.ar

Junior Member level 2
Joined
Dec 9, 2007
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,440
i m getting 3 errors in this program...i m not able to debug it...nyone cn help me


LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use IEEE.std_logic_arith.all;
use IEEE.STD_LOGIC_SIGNED.ALL;



entity half_band is
generic ( l: integer:= 13);
port(clk1, clk2:in bit:='0';
x: in signed (l-1 downto 0):=(others=>'0');
y: out signed (l-1 downto 0));
end half_band;

architecture hbf11 of half_band is
type data_bus is array (integer range <>) of signed (l-1 downto 0);
signal x_d: data_bus(0 to 10);
signal sum: data_bus(0 to 2);
signal sum_d: data_bus(0 to 3);

begin
shift: process (clk1,clk2)

begin
if (clk1='1' and clk1'event) then
for i in 1 to 10 loop
x_d(i) <= x_d(i-1);
end loop;
end if;
if (clk2='1' and clk2'event) then
sum_d(0)<=(sum(0) sra 7) + (sum(0) sra 8) + (sum(0) sra 11);
sum_d(1)<=(sum(1) sra 4);
sum_d(2)<=((sum(2) sra 2) + (sum(2) sra 5)) + ((sum(2) sra 6) + (sum(2) sra 8));
sum_d(3)<=(x_d(5) sra 1);
y <= (sum_d(0) - sum_d(1)) + ( sum_d(2) + sum_d(3)) ;
end if;
end process shift;
x_d(0)<=x;
add: for i in 0 to 2 generate
sum(i)<= x_d(2*i) + x_d(10 - 2*i);
end generate add;
end hbf11 ;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top