Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------------------------
- -- Company:
- -- Engineer:
- --
- -- Create Date: 12:55:54 06/05/2018
- -- Design Name:
- -- Module Name: obrotyKalkulator - 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;
- use IEEE.STD_LOGIC_UNSIGNED.ALL;
- use IEEE.STD_LOGIC_ARITH.ALL;
- entity obrotyKalkulator is
- PORT(
- WejscieEnkoder : in std_logic;
- WyjscieWartosc : out std_logic_vector (8 downto 0 )
- );
- end obrotyKalkulator;
- architecture Behavioral of obrotyKalkulator is
- begin
- process(WejscieEnkoder)
- variable iloscImpulsow : integer range 0 to 360;
- begin
- if(rising_edge(WejscieEnkoder))
- then
- if(iloscImpulsow < 360)
- then
- iloscImpulsow := iloscImpulsow + 1;
- WyjscieWartosc <= conv_std_logic_vector(((iloscImpulsow)), 9);
- else
- iloscImpulsow := 0;
- end if;
- end if;
- end process;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement