123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- ----------------------------------------------------------------------------------
- -- Company:
- -- Engineer:
- --
- -- Create Date: 04/25/2022 01:45:24 PM
- -- Design Name:
- -- Module Name: pt1 - Behavioral
- -- Project Name:
- -- Target Devices:
- -- Tool Versions:
- -- Description:
- --
- -- Dependencies:
- --
- -- Revision:
- -- Revision 0.01 - File Created
- -- Additional Comments:
- --
- ----------------------------------------------------------------------------------
-
-
- library IEEE;
- use IEEE.STD_LOGIC_1164.ALL;
-
- -- Uncomment the following library declaration if using
- -- arithmetic functions with Signed or Unsigned values
- --use IEEE.NUMERIC_STD.ALL;
-
- -- Uncomment the following library declaration if instantiating
- -- any Xilinx leaf cells in this code.
- --library UNISIM;
- --use UNISIM.VComponents.all;
-
- entity pt1 is
- Port (
- clk : in STD_LOGIC;
- u : in integer := 0;
- y : inout integer := 0; -- muss vielleicht initalisiert werden vorher!?
- a : in integer := 1;
- k : in integer := 1;
- stepWidth : integer := 10); --in us
- end pt1;
-
- architecture Behavioral of pt1 is
-
- --signal stepWidth : integer := 10; -- in us -> 10 us später berechnet aus Clk und Prescaler
- signal prescaler : integer := 1000000; -- prescaler für Zeit
-
- -- Konstanten Streckenparameter
- --signal a : integer := 1;
- --signal k : integer := 1;
-
-
- -- signal u : integer := 100000; -- Eingangswert Strecke jetzt u aus port
- -- signal x : integer := 0; -- Ausgangssignal Strecke -> Stellgröße jetzt y aus port
-
- begin
-
- process(clk)
- begin
- if rising_edge(clk) then
- y <= y + stepWidth*(k*u-a*y)/prescaler; -- durch 1000 wg. milisekunden abtastzeit
- end if;
-
- end process;
- end Behavioral;
|