embeded/FPGA - ALTERA2017. 12. 27. 13:48

카페자료 퍼옴..

그나저나 이거 언제 해보려나..


VHDL 코드나 일단 한줄한줄 분석해보고

글 쓰신분에게 코드 복사해가도 되나 물어 봐야겠다..


[링크 : http://cafe.naver.com/alteratown/6574]



syntax highlight(notepad++) 하니 굳이 주석 안달아도 될 느낌?

library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; use ieee.numeric_std.all; entity led_top is Port ( p_clk_50Mhz : in std_logic; p_button : in std_logic_vector( 1 downto 0 ); p_led_out : out std_logic ); end led_top; architecture Behavioral of led_top is signal s_reset : std_logic; signal s_clk_50Mhz_cnt : std_logic_vector( 15 downto 0 ); signal s_clk_1Khz : std_logic := '0'; signal s_clk_1Khz_cnt : std_logic_vector( 15 downto 0 ); begin -- reset 신호 생성 s_reset <= not p_button(0); -- 분주 타이머 process( s_reset, p_clk_50Mhz ) is begin if rising_edge( p_clk_50Mhz ) then if s_reset = '1' then s_clk_50Mhz_cnt <= ( others => '0' ); else if s_clk_50Mhz_cnt = (50000-1) then s_clk_1Khz <= not s_clk_1Khz; s_clk_50Mhz_cnt <= ( others => '0' ); else s_clk_50Mhz_cnt <= s_clk_50Mhz_cnt + 1; end if; end if; end if; end process; process( s_reset, s_clk_1Khz ) is begin if rising_edge( s_clk_1Khz ) then if s_reset = '1' then s_clk_1Khz_cnt <= ( others => '0' ); else s_clk_1Khz_cnt <= s_clk_1Khz_cnt + 1; end if; end if; end process; p_led_out <= s_clk_1Khz_cnt(7);  

end Behavioral; 


'embeded > FPGA - ALTERA' 카테고리의 다른 글

terasic DE0-Nano 부품들  (0) 2017.12.27
quartus2 설치 + usb blaster 설치  (0) 2017.12.27
altera 교육자료 요약  (0) 2017.12.27
GHDL - 시뮬레이터  (0) 2017.12.26
c to HDL ㄷㄷㄷ  (0) 2017.12.22
Posted by 구차니