Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------
- --
- -- Title : Fub3
- -- Design : szymik_krawczyk
- -- Author :
- -- Company :
- --
- -------------------------------------------------------------------------------
- --
- -- File : C:\My_Designs\szymik_krawczyk\szymik_krawczyk\src\Fub3.vhd
- -- Generated : Mon Nov 26 10:33:03 2018
- -- From : interface description file
- -- By : Itf2Vhdl ver. 1.22
- --
- -------------------------------------------------------------------------------
- --
- -- Description :
- --
- -------------------------------------------------------------------------------
- --{{ Section below this comment is automatically maintained
- -- and may be overwritten
- --{entity {Fub3} architecture {Fub3}}
- library IEEE;
- use IEEE.STD_LOGIC_1164.all;
- use IEEE.numeric_std.all;
- entity Fub3 is
- port(
- n : in STD_LOGIC_VECTOR(3 downto 0);
- cyfra : out STD_LOGIC_VECTOR(6 downto 0)
- );
- attribute LOC :string;
- attribute LOC of cyfra : signal is "P35 P36 P37 P38 P31 P30 P29";
- end Fub3;
- --}} End of automatically maintained section
- architecture Fub3 of Fub3 is
- begin
- process (n) is --początek procesu z listą czułości
- variable dana : std_logic_vector (3 downto 0) := "0000"; --deklaracja zmiennych
- variable cyfra1 : std_logic_vector (6 downto 0) := "0000000";
- begin --początek procesu z listą czułości
- dana (0) := n(3); --założenie czterech neiezależnych linii
- dana (1) := n(2); --w jeden czterobitowy wektor "dana"
- dana (2) := n(1);
- dana (3) := n(0);
- if dana = "0000" then cyfra1 := "0000001"; --uruchomienie dekodera
- elsif dana = "0001" then cyfra1 := "1001111"; --kodu BCD / 7seg.
- elsif dana = "0010" then cyfra1 := "0010010";
- elsif dana = "0011" then cyfra1 := "0000110";
- elsif dana = "0100" then cyfra1 := "1001100";
- elsif dana = "0101" then cyfra1 := "0100100";
- elsif dana = "0110" then cyfra1 := "0100000";
- elsif dana = "0111" then cyfra1 := "0001111";
- elsif dana = "1000" then cyfra1 := "0000000";
- elsif dana = "1001" then cyfra1 := "0000100";
- else cyfra1 := "0000000";
- end if;
- cyfra <= std_logic_vector (cyfra1); --wyprowadzenie danych z dekodera
- --kodu BCD / 7seg. na port wyjściowy
- end process;
- end Fub3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement