kannan2590
Member level 4
- Joined
- Sep 1, 2012
- Messages
- 77
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- india
- Activity points
- 2,321
z <= z + input;
Z is a signal.
input is input to the system
this code is placed inside a clocked process.
Your diagram is a simple accumulator.
signal z : unsigned(N downto 0) := (others => '0');
process(clk)
begin
if rising_edge(clk) then
z <= z + input;
end if;
end process;
Code:signal z : unsigned(N downto 0) := (others => '0'); process(clk) begin if rising_edge(clk) then z <= z + input; end if; end process;
I doubt it's showing U, more Likely X. You've assigned ifilterout31 inside and outside the process, meaning you're driving the signal from two sources (not allowed). Delete the assignement outside the process.
Also - where is your testbench?
Post your testbench, then I can check it.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY tbfir IS
END tbfir;
ARCHITECTURE behavior OF tbfir IS
signal Clk : std_logic := '0';
signal Xin : signed(23 downto 0) := (others => '0');
signal Yout : signed(23 downto 0) := (others => '0');
constant Clk_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: entity work.fir4tap PORT MAP (
Clk => Clk,
Xin => Xin,
Yout => Yout
);
-- Clock process definitions
Clk_processrocess
begin
Clk <= '0';
wait for Clk_period/2;
Clk <= '1';
wait for Clk_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
wait for Clk_period*2;
Xin <= to_signed(-3,8); wait for clk_period*1;
Xin <= to_signed(1,8); wait for clk_period*1;
Xin <= to_signed(0,8); wait for clk_period*1;
Xin <= to_signed(-2,8); wait for clk_period*1;
Xin <= to_signed(-1,8); wait for clk_period*1;
Xin <= to_signed(4,8); wait for clk_period*1;
Xin <= to_signed(-5,8); wait for clk_period*1;
Xin <= to_signed(6,8); wait for clk_period*1;
Xin <= to_signed(0,8);
wait;
end process;
END;
THis is not the testbench for the code you have already posted.
You posted the code for the integrator, this is the testbench for the FIR.
You either need to post all of the code or post the testbench for the integrator.
I could not understand what is Z and input.can you explain it with vhdl code?
Now you're just modifying the first testbench. (I can tell, because this one has some glaring errors).
I suggest you run the testbenches yourself before posting here.
Now you're just modifying the first testbench. (I can tell, because this one has some glaring errors).
I suggest you run the testbenches yourself before posting here.
can you explain me what was the error you faced to me because i did not face such problem
For a start, Xin is not declared.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?