summaryrefslogtreecommitdiffstats
path: root/counter.vhd
diff options
context:
space:
mode:
authorroot <root@no.no.james.local>2018-05-17 17:43:06 +0100
committerroot <root@no.no.james.local>2018-05-17 17:43:06 +0100
commit22bcde813e924f2cca7b96941465ae0737b82fc3 (patch)
treef2a0e2cc6bb097e21663a7b4a2daafffb623df89 /counter.vhd
parentaac3a573c21dd7822dad9259757b1cd3f3163054 (diff)
downloadrob_spdif-22bcde813e924f2cca7b96941465ae0737b82fc3.tar.gz
rob_spdif-22bcde813e924f2cca7b96941465ae0737b82fc3.tar.bz2
rob_spdif-22bcde813e924f2cca7b96941465ae0737b82fc3.zip
working 3 detectors with parity checks
Diffstat (limited to 'counter.vhd')
-rw-r--r--counter.vhd9
1 files changed, 5 insertions, 4 deletions
diff --git a/counter.vhd b/counter.vhd
index 0be542f..9fad8b3 100644
--- a/counter.vhd
+++ b/counter.vhd
@@ -11,7 +11,7 @@ entity counter is
divisor : in integer;
clk : in std_logic;
n_reset : in std_logic;
- clk_out : out std_logic
+ pulse_out : out std_logic
);
end counter;
@@ -19,12 +19,12 @@ end counter;
architecture rtl of counter is
signal d :
- std_logic_vector (15 downto 0);
+ std_logic_vector (31 downto 0);
signal q :
std_logic;
begin
- clk_out <= q;
+ pulse_out <= q;
process (clk, d, q, divisor, n_reset)
begin
if n_reset = '0' then
@@ -34,9 +34,10 @@ begin
if d < divisor then
d <= d + 1;
+ q<='0';
else
d <= (others => '0');
- q <= not q;
+ q <= '1';
end if;
end if;
end process;