Re: sum of array



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

.



Relevant Pages

  • Re: simulation results is correct but synthesis result is not correct
    ... Simulation accepts software, synthesis expects hardware description. ... process (clk) ... or for asynchronous reset: ... <reset regs asynchronous> ...
    (comp.arch.fpga)
  • xilinx beginner modelsim question
    ... to become more familiar with the modelsim and ise. ... port(clk: in std_logic; ... process(clk, enable, reset) ... but my simulation doesn't give right results. ...
    (comp.arch.fpga)
  • Re: Threading / Event issue...
    ... I was considering whether the event might be set and reset before the thread ... You should also *wait for the chime thread to exit* in the main thread ... before firing another instance for the new time-out. ... event signals a Control Panel setting change, one signals a change in the ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Register with a default Value
    ... Now it is working in simulation, I hope to test it on the board today. ... Port (clk: in STD_LOGIC; ... reset: in STD_LOGIC; ... load: in std_logic; ...
    (comp.lang.vhdl)
  • Re: "file locked by another user" mystery
    ... > $ RESET:= ON ERROR THEN RESET ... >> something other than ON ERROR THEN EXIT? ... you can redefine "EXIT" as a DCL SYMBOL. ... another DCL procedure, what would not be practical about it? ...
    (comp.os.vms)