VHDL ve Örnekler

Başlatan electronious, 01 Temmuz 2011, 17:08:40

electronious

Merhaba arkadaşlar,

VHDL ile ilgili bilgilerimi ve örnek kodları paylaştığım blogumda VHDL ile 'and' kapısı örneğini paylaştım. VHDL ile ilgilenenler için faydalı olmasını diliyorum.

https://electronious.wordpress.com/2011/07/01/vhdl-ile-ve-kapisi/

electronious


scaemteitn

İlgilenenler için http://hobbyistmcu.blogspot.com/ adresindede birkaç örnek var


alicavuslu

#4
VHDL ile kayan toplayıcı tasarım uygulaması...

http://www.alicavuslu.gen.tr/2015/06/24/vhdl-ile-kayan-toplayici-moving-sum-tasarimi/


mesaj birleştirme:: 09 Eylül 2015, 16:00:36

VHDL ile Cordic (sin & cos) Tasarımı...

http://www.alicavuslu.gen.tr/2014/12/23/vhdl-ile-cordic-tasarimi/

Niyazi_SARAL

Kaynak Dokümanlar

Çizgi Tagem'den VHDL ve Verilog kitapçıkları.

Elektronik ve Gömülü Sistemlere Giriş Ders Notları (Türkçe) : Elektronik ve Gömülü Sistemlere Giriş
HDL Dilleri Temel Bilgiler (Türkçe) : HDL Dilleri Temel Bilgiler
Örnek HDL Kodlar: sample codes
VHDL Tutorial (Türkçe) :  VHDL Tutorial
Verilog Tutorial (Türkçe) : Verilog Tutorial

CPLD ve FPGA Sistemlere Giriş
Programlanabilir Devreler: CPLD ve FPGA
FPGA Programlama ve HDL Dillerine Giriş

http://www.cizgi-tagem.org/?lesson=gomulu-sistemler-ve-hdl-dilleri-temel-egitimi
"Eğitimli insanlar topluma borçludurlar. Bir işin nasıl yapılabileceğini biliyorken bir başkasının yapamadığını görüp susmaları kendilerini yetiştiren o topluma ihanettir."  Bilgi paylaştıkça çoğalır



Firzen

VHDL ile MAX23 entegresi ile Asenkron Haberleşme ( TxD veri gönderme)

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity TxD is Port (
saat   : in  STD_LOGIC;
reset  : in  STD_LOGIC;
gonder : in  STD_LOGIC;
giris  : in  STD_LOGIC_VECTOR (7 downto 0); 
tamam  : out STD_LOGIC;
sonuc  : out STD_LOGIC
);
end TxD;

architecture Behavioral of TxD is
	constant saat_katsayisi 	 : INTEGER := 5200;
	type durum_turu is (bekle_txd, basla_txd, gonder_txd, dur_txd );
	signal durum, durum_sonraki  : durum_turu;
	signal N,N_sonraki 			 : INTEGER ;
	signal sayici,sayici_sonraki : INTEGER ;
	signal veri, veri_sonraki	 : STD_LOGIC := '0';
begin
	kontrol : process (saat,reset) is begin
				if reset = '1' then
					durum  <= bekle_txd ;
					sayici <= 0;
					veri   <= '1';
					N      <= 0;
				elsif (RISING_EDGE(saat)) then
					durum  <= durum_sonraki ;
					sayici <= sayici_sonraki;
					veri   <= veri_sonraki;
					N      <= N_sonraki;
				end if;
			end process;
	Sirala  : process (durum, sayici, N, gonder, giris, veri) is begin
				durum_sonraki  <= durum ;
				sayici_sonraki <= sayici;
				veri_sonraki   <= '1';
				N_sonraki      <= N;
				tamam 		   <= '0';
				
				case durum is
					when bekle_txd =>
						if gonder = '1' then
							durum_sonraki <= basla_txd ;
						end if;
					when basla_txd =>
						sayici_sonraki <= sayici + 1 ;
						veri_sonraki   <= '0';
						if sayici = saat_katsayisi then
							sayici_sonraki <= 0;
							durum_sonraki <= gonder_txd;
						end if;
					when gonder_txd =>
						sayici_sonraki <= sayici + 1;
						veri_sonraki   <= giris(N);
						if sayici = saat_katsayisi then
							if N = 7 then
								durum_sonraki <= dur_txd;
								N_sonraki <= 0;
							else
								N_sonraki <= N + 1;
							end if;
						    sayici_sonraki <= 0;
						end if;
					when dur_txd =>
						sayici_sonraki <= sayici + 1;
						if sayici = saat_katsayisi then
							sayici_sonraki <= 0;
							tamam <= '1';
							durum_sonraki <= bekle_txd;
						end if;
					end case;
				end process;
			sonuc <= veri;
end Behavioral;


----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;



entity test is
    Port ( basla : in  STD_LOGIC;
           saat : in  STD_LOGIC;
           sonuc : out  STD_LOGIC);
end test;

architecture Behavioral of test is

	COMPONENT TxD
	PORT(
		saat   : IN std_logic;
		reset  : IN std_logic;
		gonder : IN std_logic;
		giris  : IN std_logic_vector(7 downto 0);          
		tamam  : OUT std_logic;
		sonuc  : OUT std_logic
		);
	END COMPONENT;

type veri_turu is array (0 to 15) of STD_LOGIC_VECTOR (7 downto 0);

constant veri : veri_turu := (x"22", x"53", x"45", x"4c", x"41", x"4D", x"20", x"46",
										x"50", x"47", x"41", x"22", x"00", x"00", x"00", x"00" );

signal sayici, sayici_sonraki : STD_LOGIC_VECTOR (3 downto 0) := (others => '0');
signal aktif, tamam : STD_LOGIC;
signal giris : STD_LOGIC_VECTOR (7 downto 0);

begin
	Inst_TxD: TxD PORT MAP(
		saat   => saat,
		reset  => '0',
		gonder => aktif,
		giris  => giris,
		tamam  => tamam,
		sonuc  => sonuc
	);

		process (saat) is begin
			if(RISING_EDGE(saat)) then
				sayici <= sayici_sonraki;
			end if;
		end process;
		
		aktif <= '1' when basla = '1' and sayici <= "1101" else '0';
		sayici_sonraki <= sayici + 1 when tamam = '1' else sayici ;
		giris <= veri(CONV_INTEGER(sayici));

end Behavioral;





Çok öncelerden kurmuş olduğum kitaptan aldığım kodu göndereyim dedim.
Referans : Her Yönüyle FPGA ve VHDL
University of Idaho                                  Postdoctoral Fellow

alicavuslu

#9
VHDL ile SPI Protokulun gerçeklenmesi...

http://www.alicavuslu.gen.tr/2015/12/10/vhdl-ile-spi-prokolunun-gerceklenmesi/


Sitede problem olduğundan linklere ulaşılamamaktadır...

MC_Skywalker

#10
Yanıp sönen LED uygulamam
http://youtu.be/zRhq0cH3OBo


FPGA ile BCD to Binary demultiplexer gerçeklemesi.
http://youtu.be/4BHIVRS0Hs4

-----------------------------------------------------------------------------------------

16bit yukarı/aşağı sayıcı
http://youtu.be/EQbJrg95WK4

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.numeric_std.ALL;

entity onalti is
    Port ( clk100 : in STD_LOGIC;
           anh : in STD_LOGIC;
           led015 : out STD_LOGIC_VECTOR (15 downto 0));
end onalti;

architecture Behavioral of onalti is
            signal prescaller : integer range 0 to 800000:=0;
            signal sonuc : integer range 0 to 65535:=0;
begin
    led015<=STD_LOGIC_VECTOR(to_unsigned(sonuc,16));
        process(clk100)
            begin
            if(clk100'event and clk100='1') then
             if(prescaller<800000) then
                prescaller<=prescaller+1;
             else
                prescaller<=0;
            end if;       
            
            if(prescaller=0) then
            case anh is
                when '1' =>
                    if(sonuc<65535) then
                       sonuc<=sonuc+1;
                    else
                       sonuc<=0;
                    end if;
                when '0' =>
                    if(sonuc>0) then
                       sonuc<=Sonuc-1;
                    else
                       sonuc<=65535;
                    end if;
            end case;
            end if;
            end if;
        end process;                        
end Behavioral;

----------------------------------------------------------------------------------------

VHDL ile Karaşimşek Uygulamam
http://youtu.be/rmpanx5cP8U

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity KaraSimsek is
    Port ( clk : in STD_LOGIC;
           led015 : out STD_LOGIC_VECTOR (15 downto 0));
end KaraSimsek;

architecture Behavioral of KaraSimsek is

    constant SYS_CLK_PERIOD : integer := 10; -- ns cinsinden
    constant NEW_CLK_PERIOD : integer := 100_000_000; -- ns cinsinden
    constant CLK_COUNT : integer := NEW_CLK_PERIOD / (2 * SYS_CLK_PERIOD);
         
    signal counter: std_logic_vector(3 downto 0):= "0000";
    signal gecici: std_logic_vector(3 downto 0);
    signal clk_new : std_logic := '0';
    signal count : integer range 0 to 99999999 := 0;
    signal r_led015 : STD_LOGIC_VECTOR (15 downto 0):= X"0001";
    signal fwd : std_logic := '1';

begin
     process(clk)
     begin
        if clk= '1' and clk'event then
            if count = CLK_COUNT - 1 then
                count <= 0;
                clk_new <= not clk_new;
            else
                count <= count + 1;
            end if;
        end if;
     end process;
     
     process(clk_new)
     begin
        if rising_edge(clk_new) then
            if (fwd = '1') then
                r_led015 <= r_led015(14 downto 0) & r_led015(15);
                    if (r_led015 = X"4000") then
                                fwd <= '0';
                    end if;
             else
              r_led015 <= '0' & r_led015(15 downto 1);
             if (r_led015 = X"02") then
                  fwd <= '1';
             end if;
            end if; 
        end if;
     end process;
     led015 <= r_led015;
end Behavioral;


alicavuslu


alicavuslu


alicavuslu