[vhdl] 비동기카운터, asynchronos counter, testbench
- 최초 등록일
- 2008.06.14
- 최종 저작일
- 2008.05
- 7페이지/ 한컴오피스
- 가격 1,500원
소개글
[vhdl] 비동기카운터, asynchronos counter, testbench
목차
(비동기 카운터 설계)
4비트 비동기 카운터
TB파일
그래프 파형
bit-cnt파일(연결)
bit-cnt1파일(연결,마지막Cnt)
TB파일
그래프 파형
본문내용
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counter is
port(clk,rst:in std_logic;
q:buffer std_logic_vector(3 downto 0);
clk_out:buffer std_logic
);
end counter;
architecture behave of counter is
signal temp_clk_cnt:std_logic_vector(2 downto 0):="000";
begin
process(rst,clk)
begin
if (rst=`0`) then
q<="0000";
elsif (clk`event and clk=`1`) then
q<=q+1;
end if;
end process;
process(clk,rst)
begin
if (rst=`0`) then
clk_out<=`0`;
temp_clk_cnt<="000";
elsif (clk`event and clk=`1`) then
if temp_clk_cnt="100" then
temp_clk_cnt<="000";
clk_out<= not clk_out;
else
temp_clk_cnt<=temp_clk_cnt+1;
end if;
end if;
end process;
end behave;
참고 자료
없음