- cleaned up
Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@752 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -48,31 +48,29 @@ end gray_counter;
|
||||
|
||||
architecture Behavioral of gray_counter is
|
||||
|
||||
signal cntg : unsigned (width-1 downto 0);
|
||||
signal cntb : unsigned (width-1 downto 0);
|
||||
signal nxtb : unsigned (width-1 downto 0);
|
||||
signal cntg : unsigned (width-1 downto 0);
|
||||
signal nxtg : unsigned (width-1 downto 0);
|
||||
|
||||
begin
|
||||
|
||||
bnxt <= nxtb;
|
||||
gnxt <= nxtg;
|
||||
bcnt <= cntb;
|
||||
gcnt <= cntg;
|
||||
|
||||
process(rst, clk, ce, cntb, nxtb)
|
||||
begin
|
||||
if rst = '1' then
|
||||
cntb <= to_unsigned(init_value, width);
|
||||
nxtb <= to_unsigned(init_value, width);
|
||||
cntg <= to_unsigned(init_value, width);
|
||||
nxtg <= to_unsigned(init_value, width);
|
||||
bcnt <= to_unsigned(init_value, width);
|
||||
gcnt <= to_unsigned(init_value, width);
|
||||
cntg <= to_unsigned(init_value, width);
|
||||
else
|
||||
if rising_edge(clk) then
|
||||
bcnt <= nxtb;
|
||||
gcnt <= nxtg;
|
||||
cntb <= nxtb;
|
||||
cntg <= nxtg;
|
||||
cntb <= nxtb;
|
||||
end if;
|
||||
nxtg <= bin2gray(nxtb);
|
||||
nxtb <= cntb;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
-- Description:
|
||||
--
|
||||
-----------------------------------------------------------------------
|
||||
-- $Header: /tmp/cvsroot/VHDL/lib/FIFO/src/tb_gray_counter.vhd,v 1.1 2008-08-23 08:20:28 Jens Exp $
|
||||
-- $Header: /tmp/cvsroot/VHDL/lib/FIFO/src/tb_gray_counter.vhd,v 1.2 2010-02-13 10:50:47 Jens Exp $
|
||||
-----------------------------------------------------------------------
|
||||
LIBRARY IEEE;
|
||||
USE IEEE.STD_LOGIC_1164.ALL;
|
||||
@@ -65,15 +65,17 @@ inst_gray_counter : entity work.gray_counter
|
||||
|
||||
wait for 4*PERIOD;
|
||||
rst <= '0';
|
||||
wait for 1*PERIOD;
|
||||
wait until rising_edge(clk);
|
||||
ce <= '1';
|
||||
wait for 2*PERIOD;
|
||||
wait until rising_edge(clk);
|
||||
ce <= '0';
|
||||
wait for 3*PERIOD;
|
||||
ce <= '0';
|
||||
wait for 4*PERIOD;
|
||||
wait until rising_edge(clk);
|
||||
ce <= '1';
|
||||
wait for 1*PERIOD;
|
||||
wait until rising_edge(clk);
|
||||
ce <= '0';
|
||||
wait for 1*PERIOD;
|
||||
wait until rising_edge(clk);
|
||||
ce <= '1';
|
||||
|
||||
wait;
|
||||
|
||||
Reference in New Issue
Block a user