ALU 설계 - VHDL로 ALU(산술 논리 장치)를 설계함으로써 컴퓨터 중앙처리장치(cpu)의 기본설계를 알아보는 목적입니다.
본 자료는 6페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
해당 자료는 6페이지 까지만 미리보기를 제공합니다.
6페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

ALU 설계 - VHDL로 ALU(산술 논리 장치)를 설계함으로써 컴퓨터 중앙처리장치(cpu)의 기본설계를 알아보는 목적입니다.에 대한 보고서 자료입니다.

목차

1. ALU 설계 목적
2. 설계 방법
3. 프로그램
4. simulation
5. 4 X 8 register file을 포함한 ALU 설계
 1) 설계 방법
 2) 프로그램
 3) simulation
6. 고찰

본문내용

-- pass
when \"01\" => output <= input(6 downto 0) & \'0\'; -- 오른쪽으로 쉬프트
when \"10\" => output <= \'0\' & input(7 downto 1); -- 왼쪽으로 쉬프트
when others => output <= input(0) & input(7 downto 1); -- 오른쪽 회전
end case;
end process;
end behavior;
(5) 3상태 버퍼 프로그램
library ieee;
use ieee.std_logic_1164.all;
entity tri_buf is port(
e : in std_logic;
d : in std_logic_vector(7 downto 0);
y : out std_logic_vector(7 downto 0));
end tri_buf;
architecture behavioral of tri_buf is
begin
process(e,d)
begin
if( e =\'1\') then -- 1 이면 pass
y <= d;
else
y <= (others =>\'Z\'); --1이 아니면 Z값 표시
end if;
end process;
end behavioral;
(6) 전체 메인 프로그램
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity reg_alu is port(
clock : in std_logic;
input : in std_logic_vector(7 downto 0);
ie, we : in std_logic;
WA : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
RAE : IN STD_LOGIC;
RAA : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
RBE : IN STD_LOGIC;
RBA : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
ALUsel : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
SHsel : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
OE : IN STD_LOGIC;
OUTPUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END reg_alu;
architecture structural of reg_alu is
component mux2 port(
s : in std_logic;
d0, d1:in std_logic_vector(7 downto 0);
y : out std_logic_vector(7 downto 0));
end component;
component regfile port(
clk : in std_logic;
WE : IN STD_LOGIC; --write enable
WA : IN STD_LOGIC_VECTOR(1 DOWNTO 0); --write address
INPUT : IN STD_LOGIC_VECTOR(7 DOWNTO 0); --입력
RAE : IN STD_LOGIC; --read enable ports A
RAA : IN STD_LOGIC_VECTOR(1 DOWNTO 0); --read address port A
RBE : IN STD_LOGIC; --read enable ports B
RBA : IN STD_LOGIC_VECTOR(1 DOWNTO 0); --read address port A
AOUT, BOUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)); --출력
end component;
component alu2 port(
ALUSEL : IN STD_LOGIC_VECTOR(2 DOWNTO 0); --ALU 선택
A, B : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
F : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
end component;
component shifter port(
shsel : in std_logic_vector(1 downto 0); -- shifter 레지스터 선택라인
input : in std_logic_vector(7 downto 0);
output : out std_logic_vector(7 downto 0));
end component;
component tri_buf port(
e : in std_logic;
d : in std_logic_vector(7 downto 0);
y : out std_logic_vector(7 downto 0));
end component;
signal muxout, aout, bout : std_logic_vector(7 downto 0); --signal 선언
signal alu2out, shout, triout : std_logic_vector(7 downto 0);
begin
U0: mux2 port map(IE,input,shout,muxout);
U1: regfile port map(clock,WE,WA,muxout,RAE,RAA,RBE,RBA,aout,bout);
U2: alu2 port map(ALUsel,aout,bout,alu2out);
U3: shifter port map(SHsel,alu2out,shout);
U4: tri_buf port map(oe,shout,triout);
output <= triout;
end structural;
3) simulation
※시뮬의 그림이 중간값을 캡쳐한것같습니다. input에 원래 입력값을 10을로 주었습니다.
6. 고찰
이번 설계를 하면서 CPU의 구성을 확실하게 이해하게 된 것 같습니다. 복잡 할 줄만 알았던 CPU가 단순한 연산만으로 구성되어 처리되는 것이 신기 하였습니다. 물론 아직까지 제가 모르는 부분이 많이 있다고 생각합니다.
설계를 하면서 아쉬운 점은 프로그램 컴파일에서 많은 에러가 났던 부분과 수업시간에 했던 자인린스로 프로그램 시뮬을 돌리지 못해 아쉬웠습니다.
많은 오류가 났지만 끝까지 분석하고 오류를 찾아내고 수정하면서 마지막엔 뿌듯함도 느꼈습니다.
앞으로도 이것을 응용한 여러 가지 프로그램에 도전하고 공부하겠습니다.
  • 가격13,860
  • 페이지수18페이지
  • 등록일2012.12.04
  • 저작시기2011.6
  • 파일형식한글(hwp)
  • 자료번호#823815
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니