논리회로설계실험 1bit 비교기, 4bits 비교기
- 최초 등록일
- 2010.12.22
- 최종 저작일
- 2010.12
- 4페이지/ 한컴오피스
- 가격 3,000원
소개글
2010학기 논리회로설계실험 과제물로 직접 코딩한 레포트 입니다. A받은 자료입니다.
목차
1. HDL 코드
2. 테스트 벤치 코드
3.결과파형
본문내용
< 1bit 비교기, 4bits 비교기>
1. HDL 코드
1) 1bit 비교기 : Behavioral Modeling
동작 : 두 입력이 서로 같은지 또는 다른지를 비교하여 알려주는 회로.
1비트 비교기는 두 입력이 같으면 ‘1’을 출력하고, 다르면 ‘0’을 출력하는 회로.
library ieee;
use ieee.std_logic_1164.all;
entity onebit is
port(a, b : in std_logic;
eq : out std_logic);
end onebit;
architecture behave of onebit is
begin
process(a,b)
begin
if a=b then
eq <= `1`;
else
eq <= `0`;
end if;
end process;
end behave;
2) 4bits 비교기 : Behavioral Modeling
동작 : 두 입력이 같으면 EQ=`1`, AGB=`0`, ALB=`0`을 출력.
A값이 B값보다 크면 AGB=`1`, EQ=`0`, ALB=`0`을 출력.
A값이 B값보다 작으면 ALB=`1`, EQ=`0`, AGB=`0`을 출력.
library ieee;
use ieee.std_logic_1164.all;
entity fourbit is
port(a , b : in std_logic_vector(3 downto 0);
eq, agb, alb : out std_logic);
end fourbit;
architecture behave of fourbit is
참고 자료
없음