Presentation is loading. Please wait.

Presentation is loading. Please wait.

기초 회로의 VHDL 설계 XOR SungKyunKwan Univ..

Similar presentations


Presentation on theme: "기초 회로의 VHDL 설계 XOR SungKyunKwan Univ.."— Presentation transcript:

1 기초 회로의 VHDL 설계 XOR SungKyunKwan Univ.

2 기초 회로의 VHDL 설계 XOR의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; entity xor2 is port(A,B : in std_logic; Y : out std_logic); end xor2; SungKyunKwan Univ.

3 기초 회로의 VHDL 설계 XOR의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture behave of xor2 is begin process(A,B) begin if (A=‘1’ and B=‘0’) or (A=‘0’ and B=‘1’) then Y <= ‘1’; else Y <= ‘0’; end if; end process; end behave; SungKyunKwan Univ.

4 기초 회로의 VHDL 설계 MULTIPLEXER SungKyunKwan Univ.

5 기초 회로의 VHDL 설계 XOR의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; entity Mux is port(A,B : in std_logic; SEL : in std_logic; Y : out std_logic); end Mux; SungKyunKwan Univ.

6 기초 회로의 VHDL 설계 XOR의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture behave of Mux is begin process(A,B,SEL) begin if SEL=‘0’ then Y <= A; else Y <= B; end if; end process; end behave; SungKyunKwan Univ.

7 기초 회로의 VHDL 설계 DECODER SungKyunKwan Univ.

8 기초 회로의 VHDL 설계 DECODER의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; entity dec is port(SEL : in std_logic_vector(2 downto 0); Y : out std_logic_vector(7 downto 0); end dec; SungKyunKwan Univ.

9 기초 회로의 VHDL 설계 DECODER의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture concur of dec is begin with SEL select Y <= “ ” when “000”, “ ” when “001”, “ ” when “010”, “ ” when “011”, “ ” when “100”, “ ” when “101”, “ ” when “110”, “ ” when others; end concur; SungKyunKwan Univ.

10 기초 회로의 VHDL 설계 D-FF SungKyunKwan Univ.

11 기초 회로의 VHDL 설계 D-FF의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; entity DFF is port(D,CLK : in std_logic; Q : out std_logic); end DFF; SungKyunKwan Univ.

12 기초 회로의 VHDL 설계 D-FF의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture behave of DFF is begin process(CLK,D) begin if CLK’event and CLK=‘1’ then Q <= D end if; end process; end behave; SungKyunKwan Univ.

13 기초 회로의 VHDL 설계 비동기 16진 카운터 SungKyunKwan Univ.

14 기초 회로의 VHDL 설계 비동기 16진 카운터의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all entity ASY_CNT16 is port(CLK,RST : in std_logic; Q : buffer std_logic_vector(3 downto 0)); end ASY_CNT16; SungKyunKwan Univ.

15 기초 회로의 VHDL 설계 D-FF의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture behave of ASY_CNT16 is begin process(CLK,RST) begin if RST=‘0’ then Q <= “0000”; elsif CLK’event and CLK=‘1’ then Q <= Q+1; end if; end process; end behave; SungKyunKwan Univ.

16 기초 회로의 VHDL 설계 동기 10진 카운터 SungKyunKwan Univ.

17 기초 회로의 VHDL 설계 동기 10진 카운터의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all entity SY_CNT10 is port(CLK,RST : in std_logic; Q : buffer std_logic_vector(3 downto 0)); end SY_CNT10; SungKyunKwan Univ.

18 기초 회로의 VHDL 설계 동기 10진 카운터의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture behave of ASY_CNT16 is begin process(CLK,RST) begin if CLK’event and CLK=‘1’ then if RST=‘0’ then Q <= “0000”; elsif Q=“1001” then Q <= “0000”; else Q <= Q+”0001”; end if; end process; end behave; SungKyunKwan Univ.

19 기초 회로의 VHDL 설계 SHIFT REGISTER SungKyunKwan Univ.

20 기초 회로의 VHDL 설계 SHIFT REGISTER Entity Declaration
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all entity SHIFT_R is port(CLK,CLR : in std_logic; D : in std_logic; Q : buffer std_logic_vector(3 downto 0)); end SHIFT_R ; SungKyunKwan Univ.

21 기초 회로의 VHDL 설계 SHIFT REGISTER Architecture Body(동작적 모델링)
architecture behave of SHIFT_R is begin process(CLK,CLR,D) begin if RST=‘0’ then Q <= “0000”; elsif CLK’event and CLK=‘1’ then Q <= Q(2 downto 0) & D end if; end process; end behave; SungKyunKwan Univ.

22 응용 예제 회로의 모델링 STATE DIAGRAM(MOORE) SungKyunKwan Univ.

23 응용 예제 회로의 모델링 STATE DIAGRAM의 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; entity moore is port(clk, rst : in std_logic; insel : in std_logic_vector(3 downto 0); y : out std_logic_vector(1 downto 0)); end moore; SungKyunKwan Univ.

24 응용 예제 회로의 모델링 STATE DIAGRAM의 VHDL 모델링 Architecture Body(동작적 모델링)
architecture behave of moore is type states is (state0,state1,state2,state3); signal state : states; begin process(clk,rst,insel) begin if rst='1' then state <= state0; elsif clk'event and clk='1' then case state is when state0 => if insel = "0100" then state <= state1; else state <= state0; end if; SungKyunKwan Univ.

25 응용 예제 회로의 모델링 STATE DIAGRAM의 VHDL 모델링 Architecture Body(동작적 모델링) when state1 => if insel = "0011" then state <= state2; elsif insel = "0000" then state <= state3; else state <= state1; end if; when state2 => if insel = "0111" then state <= state3; else state <= state2; end if; when others => state <= state0; end case; end if; end process; y <= "00" when (state=state0) else "01" when (state=state3) else "10" when (state=state2) else "11"; end behave; SungKyunKwan Univ.

26 응용 예제 회로의 모델링 STATE DIAGRAM의 Function Simulation 결과 SungKyunKwan Univ.

27 응용 예제 회로의 모델링 STATE DIAGRAM의 Synthesis 결과 SungKyunKwan Univ.

28 응용 예제 회로의 모델링 STATE DIAGRAM의 Optimization 결과 SungKyunKwan Univ.

29 응용 예제 회로의 모델링 분주회로의 설계 SungKyunKwan Univ.

30 응용 예제 회로의 모델링 분주회로 VHDL 모델링 Entity Declaration
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; entity tim_div is port(clk,clr : in std_logic; t_1sec : out std_logic); end tim_div; SungKyunKwan Univ.

31 응용 예제 회로의 모델링 STATE DIAGRAM의 VHDL 모델링 cnt <= 0;
Architecture Body(동작적 모델링) architecture behave of tim_div is signal cnt : integer range 0 to 255; begin process(clk,clr,cnt) variable st : std_logic; begin if clr='1' then cnt <= 0; t_1sec <= '0'; st := '0'; elsif clk'event and clk='1' then if (cnt > 50) then cnt <= 0; st := not st; t_1sec <= st; else cnt <= cnt+1; end if; end process; end behave; SungKyunKwan Univ.

32 응용 예제 회로의 모델링 STATE DIAGRAM의 Function Simulation 결과 SungKyunKwan Univ.

33 응용 예제 회로의 모델링 STATE DIAGRAM의 Synthesis 결과 SungKyunKwan Univ.

34 응용 예제 회로의 모델링 STATE DIAGRAM의 Optimization 결과 SungKyunKwan Univ.

35 효율적인 모델링 기법 대규모 설계를 위해서는 동작적 모델링 구현을 위해서는 합성 가능한 구문 사용
Process문의 sensitivity list를 검사 연산 순서를 조정한 모델링 구조적인 설계 보다 효율적인 문장 선택 SungKyunKwan Univ.

36 효율적인 모델링 기법 연산 수행을 줄이는 모델링 같은 연산은 한번에 수행
process(a,b,c,d) process(a,b,c,d) begin begin y1 <= a+b; y1 <= a+b; y2 <= a+b+d; y2 <= y1+d; y3 <= a+c; y3 <= a+c; end process end process; SungKyunKwan Univ.

37 효율적인 모델링 기법 Simulator에 따라 다른 library와 package사용
관련이 많은 부분은 그룹 지어 코딩 및 합성 복잡한 수식을 포함한 회로의 설계 SungKyunKwan Univ.


Download ppt "기초 회로의 VHDL 설계 XOR SungKyunKwan Univ.."

Similar presentations


Ads by Google