목차
◆ logic1
1.소스
2. 시뮬레이션
3. 블록 다이어그램
◆ over_write
1.소스
2. 시뮬레이션
3. 블록 다이어그램
◆ ex1
1.소스
2. 시뮬레이션
3. 블록다이어그램
1) 게이트
◆ ex2
1. 소스
2. 시뮬레이션
3. 블록 다이어그램
※ ex1과 ex2의 차이점은??
◆ if
1. 소스
2. 시뮬레이션
3. 블록다이어그램
◆ 다중 if
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ memory if
1.소스
2. 시뮬레이션
1) flow summary
3. 블록다이어그램
◆ case
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ for loop
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ when else
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ whenelse 연습
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ with_select
1.소스
2. 시뮬레이션
3. 블록다이어그램
1.소스
2. 시뮬레이션
3. 블록 다이어그램
◆ over_write
1.소스
2. 시뮬레이션
3. 블록 다이어그램
◆ ex1
1.소스
2. 시뮬레이션
3. 블록다이어그램
1) 게이트
◆ ex2
1. 소스
2. 시뮬레이션
3. 블록 다이어그램
※ ex1과 ex2의 차이점은??
◆ if
1. 소스
2. 시뮬레이션
3. 블록다이어그램
◆ 다중 if
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ memory if
1.소스
2. 시뮬레이션
1) flow summary
3. 블록다이어그램
◆ case
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ for loop
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ when else
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ whenelse 연습
1.소스
2. 시뮬레이션
3. 블록다이어그램
◆ with_select
1.소스
2. 시뮬레이션
3. 블록다이어그램
본문내용
riable에서는 variable m은 signal b와 c로 즉시 바뀌는 것을 볼 수 있다.
◆ if
1. 소스
library ieee;
use ieee.std_logic_1164.all;
entity iff is
port(a,b,c : in bit;
y : out bit);
end iff;
architecture sample of iff is
begin
process(a,b,c)
begin
if (c = '1') then
y <= a nand b ;
else
y <= a or b;
end if ;
end process ;
end sample;
2. 시뮬레이션
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ 다중 if
library ieee;
use ieee.std_logic_1164.all;
entity comif is
port(a,b,s1,s0 : in bit;
y : out bit);
end comif;
architecture sample of comif is
begin
process(a,b,s0,s1)
begin
if(s1 ='1') then y <= a and b;
elsif (s0 ='1') then y <= a or b;
else y <= a xor b;
end if;
end process;
end sample;
1.소스
2. 시뮬레이션
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ memory if
library ieee;
use ieee.std_logic_1164.all;
entity memoif is
port(a,clk : in bit;
q : out bit);
end memoif;
architecture test of memoif is
begin
process(clk)
begin
if clk'event and clk = '1'then
q <= a;
end if;
end process;
end test;
1.소스
2. 시뮬레이션
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ case
1. 소스
library ieee;
use ieee.std_logic_1164.all;
entity ca is
port(x : in bit_vector( 1 downto 0);
a,b : in bit;
y : out bit);
end ca;
architecture test of ca is
begin
process(x,a,b)
begin
case x is
when "00" =>y<=a nand b;
when "01" =>y<=a and b;
when "10" =>y<=a nor b;
when others =>y<=a xor b;
end case;
end process;
end test;
2. 시뮬레이션 결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1)게이트
2)블록
◆ for loop
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity l_nand is
port( a,b : in bit_vector(3 downto 0);
y : out bit_vector(3 downto 0));
end l_nand;
architecture test of l_nand is
begin
process(a,b)
begin
for n in 3 downto 0 loop
y(n) <= a(n) nand b(n);
end loop;
end process;
end test;
2. 시뮬레이션 결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ when else
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity w_e is
port (a,b,c,d : in bit;
y : out bit);
end w_e;
architecture sample of w_e is
begin
y <= '0' when (d='0') else
'1' when (c='1') else
'0' when (a='1') and (b='1') else
'1';
end sample;
2. 시뮬레이션 결과
1) flow summary
2) waveform
2) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ whenelse 연습
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity ex is
port( a,b,c : in bit;
x : in bit_vector(5 downto 0);
z : out bit);
end ex;
architecture test of ex is
begin
z<=a when(x > "11") else
b when(x > "10") else
c;
end test;
2.시뮬레이션결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ with_select
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity wi_se is
port(xin : in bit_vector(1 downto 0);
y : out bit_vector(3 downto 0));
end wi_se;
architecture test of wi_se is
begin
with xin select
y<="0001" when "00",
"0010" when "01",
"0100" when "10",
"1000" when others;
end test;
2. 시뮬레이션 결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ if
1. 소스
library ieee;
use ieee.std_logic_1164.all;
entity iff is
port(a,b,c : in bit;
y : out bit);
end iff;
architecture sample of iff is
begin
process(a,b,c)
begin
if (c = '1') then
y <= a nand b ;
else
y <= a or b;
end if ;
end process ;
end sample;
2. 시뮬레이션
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ 다중 if
library ieee;
use ieee.std_logic_1164.all;
entity comif is
port(a,b,s1,s0 : in bit;
y : out bit);
end comif;
architecture sample of comif is
begin
process(a,b,s0,s1)
begin
if(s1 ='1') then y <= a and b;
elsif (s0 ='1') then y <= a or b;
else y <= a xor b;
end if;
end process;
end sample;
1.소스
2. 시뮬레이션
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ memory if
library ieee;
use ieee.std_logic_1164.all;
entity memoif is
port(a,clk : in bit;
q : out bit);
end memoif;
architecture test of memoif is
begin
process(clk)
begin
if clk'event and clk = '1'then
q <= a;
end if;
end process;
end test;
1.소스
2. 시뮬레이션
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ case
1. 소스
library ieee;
use ieee.std_logic_1164.all;
entity ca is
port(x : in bit_vector( 1 downto 0);
a,b : in bit;
y : out bit);
end ca;
architecture test of ca is
begin
process(x,a,b)
begin
case x is
when "00" =>y<=a nand b;
when "01" =>y<=a and b;
when "10" =>y<=a nor b;
when others =>y<=a xor b;
end case;
end process;
end test;
2. 시뮬레이션 결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1)게이트
2)블록
◆ for loop
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity l_nand is
port( a,b : in bit_vector(3 downto 0);
y : out bit_vector(3 downto 0));
end l_nand;
architecture test of l_nand is
begin
process(a,b)
begin
for n in 3 downto 0 loop
y(n) <= a(n) nand b(n);
end loop;
end process;
end test;
2. 시뮬레이션 결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ when else
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity w_e is
port (a,b,c,d : in bit;
y : out bit);
end w_e;
architecture sample of w_e is
begin
y <= '0' when (d='0') else
'1' when (c='1') else
'0' when (a='1') and (b='1') else
'1';
end sample;
2. 시뮬레이션 결과
1) flow summary
2) waveform
2) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ whenelse 연습
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity ex is
port( a,b,c : in bit;
x : in bit_vector(5 downto 0);
z : out bit);
end ex;
architecture test of ex is
begin
z<=a when(x > "11") else
b when(x > "10") else
c;
end test;
2.시뮬레이션결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
◆ with_select
1.소스
library ieee;
use ieee.std_logic_1164.all;
entity wi_se is
port(xin : in bit_vector(1 downto 0);
y : out bit_vector(3 downto 0));
end wi_se;
architecture test of wi_se is
begin
with xin select
y<="0001" when "00",
"0010" when "01",
"0100" when "10",
"1000" when others;
end test;
2. 시뮬레이션 결과
1) flow summary
2) waveform
3) time analyzer summary
3. 블록다이어그램
1) 게이트
2) 블록
소개글