forcing 1,0 internal signal

E

Elinore

Hi

In Xilinx XST document, I took 4bit counter example and modified it.

I am wondering this will work in read chip, while the simulation after
place and route, seems okay.



--4-bit unsigned up counter
--an asynchronous clear and a clock enable.
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counter is
port(
C, CLR, CE : in std_logic;
Q : out std_logic_vector(3 downto 0)
);
end counter;

architecture archi of counter is
signal tmp: std_logic_vector(3 downto 0);
signal clear: std_logic; -- modified
signal enable: std_logic; -- modified
begin

clear <= CLR; -- modified
enable <= CE; -- modified

clear <= '0'; -- modified : ground connect?
enable <= '1'; -- modified : VCC connect ?

process (C, CLR)
begin
if (CLR='1') then
tmp <= "0000";
elsif (C'event and C='1') then
if (CE='1') then
tmp <= tmp + 1;
end if;
end if;
end process;
Q <= tmp;
end archi;
 
M

Mike Treseler

Elinore said:
I am wondering this will work in read chip, while the simulation after
place and route, seems okay.

If you expect it to no never CLR and always CE
then yes. It might be easier to just edit the
code:

process (C)
begin
if rising_edge(C) then
tmp <= tmp + 1;
end if;
end process;


-- Mike Treseler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,405
Messages
2,571,545
Members
48,797
Latest member
Fractal_Prime_357
Top