Re: sum of array
- From: "VHDL_HELP" <abaidik@xxxxxxxxx>
- Date: 16 Mar 2007 07:11:32 -0700
On 14 mar, 18:43, "John_H" <newsgr...@xxxxxxxxxxxxxxxx> wrote:
"VHDL_HELP" <abai...@xxxxxxxxx> wrote in message
news:1173890111.962169.307570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 14 mar, 13:44, "Dave Pollum" <vze24...@xxxxxxxxxxx> wrote:
As John_H pointed out, taille only needs to be 2 bits. In other
words:
taille : in STD_LOGIC_VECTOR (1 downto 0);
As for your simulation problem, your test bench needs to supply the
values to be loaded into your signal "s". Otherwise, you will see X
for dout.
-Dave Pollum
i dont know it still the same problem
So, tell us please: what does your simulation say the values of s(0), s(1),
s(2), and s(3) are?
Troubleshooting involves breaking the problem down into smaller pieces,
seeing if you can show the smaller pieces work or don't work. If you have a
smaller piece that works, you can now ignore it and only need to concentrate
on the smaller piece that doesn't work. You can cut that up into smaller
pieces and isolate what works there.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity somme is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
en : in STD_LOGIC_VECTOR (3 downto 0);
clk_out : out STD_LOGIC;
s : out STD_LOGIC_VECTOR (3 downto 0));
end somme;
architecture Behavioral of somme is
TYPE tab is array(3 downto 0) of std_logic_vector(3 downto 0);
begin
process
VARIABLE t:tab;
begin
SEQ_LOOP: loop
wait until clk'event and clk = '1';-- Lecture de premier élément
du tableau 4 éléments
exit SEQ_LOOP when reset = '1';
clk_out <= '1';
wait until clk'event and clk = '1';
exit SEQ_LOOP when reset = '1';
t(0) := en;
wait until clk'event and clk = '1';-- Lecture de deuxième
élément du tableau 4 éléments
exit SEQ_LOOP when reset = '1';
clk_out <= '0';
wait until clk'event and clk = '1';
exit SEQ_LOOP when reset = '1';
t(1) := en;
wait until clk'event and clk = '1';-- Lecture de troisième élément
du tableau 4 éléments
exit SEQ_LOOP when reset = '1';
clk_out <= '1';
wait until clk'event and clk = '1';
exit SEQ_LOOP when reset = '1';
t(2) := en;
wait until clk'event and clk = '1';-- Lecture de quatrième élément
du tableau 4 éléments
exit SEQ_LOOP when reset = '1';
clk_out <= '0';
wait until clk'event and clk = '1';
exit SEQ_LOOP when reset = '1';
t(3) := en;
end loop;
s <= t(0) + t(1) + t(2) + t(3);
end process;
end Behavioral;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
this is my problem:
for the s(0) , s(1) , s(2) and s(3) it gives me the numbers but for s
in simulation i have as a result 4'hU and 4'hX
.
- Follow-Ups:
- Re: sum of array
- From: John_H
- Re: sum of array
- References:
- sum of array
- From: VHDL_HELP
- Re: sum of array
- From: John_H
- Re: sum of array
- From: VHDL_HELP
- Re: sum of array
- From: VHDL_HELP
- Re: sum of array
- From: John_H
- sum of array
- Prev by Date: MXE compilation error
- Next by Date: Re: Programming XCF from MicroBlaze over JTAG???
- Previous by thread: Re: sum of array
- Next by thread: Re: sum of array
- Index(es):
Relevant Pages
|