blob: adcb1b4e280824d2d6139a750449ca2f92081d9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
library ieee;
use ieee.std_logic_1164.all;
entity repro4 is
generic (
num : natural := 1);
port (
clk : std_logic;
o : out std_logic);
end;
architecture behav of repro4 is
signal s : natural range 0 to num - 1 := 0;
begin
process (clk) is
begin
if rising_edge(clk) then
if s = 0 then
o <= '1';
else
o <= '0';
end if;
if s = num - 1 then
s <= 0;
else
s <= s + 1;
end if;
end if;
end process;
end behav;
|