peter schrieb:
> Wer weiss bitte eine bessere Lösung?
Ich (aber nur etwas eleganter):
1 | library ieee;
|
2 | use ieee.std_logic_1164.all;
|
3 | use ieee.numeric_std.all;
|
4 | use ieee.std_logic_unsigned.all;
|
5 |
|
6 | entity takt_geber is
|
7 | port (
|
8 | clock50 : in std_logic;
|
9 | ist_1mhz : out std_logic;
|
10 | ist_500khz : out std_logic
|
11 | );
|
12 | end takt_geber;
|
13 |
|
14 | architecture behavioral of takt_geber is
|
15 | signal n1 : integer range 0 to 99;
|
16 |
|
17 | begin
|
18 |
|
19 | process (clock50) begin
|
20 | wait until clock50='1';
|
21 | ist_1mhz <= '1';
|
22 | ist_500khz <= '1';
|
23 | if n1 = 99 then
|
24 | ist_500khz <= '0';
|
25 | n1 <= 0;
|
26 | end if;
|
27 | if n1 = 49 or n1 = 99 then
|
28 | ist_1mhz <= '0';
|
29 | end if;
|
30 | end process;
|
31 |
|
32 | end behavioral;
|
Die BSF-Konvertierung kennst du jetzt ja schon.
Uwe