[논리회로설계]ALU 및 Booth 곱셈기
본 자료는 6페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
해당 자료는 6페이지 까지만 미리보기를 제공합니다.
6페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[논리회로설계]ALU 및 Booth 곱셈기에 대한 보고서 자료입니다.

목차

1. 개요
2. 디자인
3. 결론
4. 느낀점

본문내용

downto 0);
end if;
end if;
end process;
end Behavioral;
(2)Booth 곱셈기
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_signed.ALL;
entity booth_multiplier is
--승수, 피승수 및 출력의 길이 저장
generic (m_plicand_width : integer :=8;
m_plier_width : integer :=8;
output_width : integer :=16);
--곱셈기의 입력 및 출력 선언
port (load, rst : in std_logic;
m_plicand : in std_logic_vector (m_plicand_width-1 downto 0);
m_plier : in std_logic_vector (m_plier_width-1 downto 0);
output : out std_logic_vector (output_width-1 downto 0);
clk : in bit);
end booth_multiplier;
architecture Behavioral of booth_multiplier is
--상태 s 신호 선언
signal state:integer range 0 to 2;
begin
process(clk)
--계산을 위한 임시 variable 선언
variable buf_mplicand: std_logic_vector(m_plicand_width-1 downto 0);
variable buf_mplier: std_logic_vector(output_width downto 0);
variable buf_mplier_up: std_logic_vector(m_plier_width-1 downto 0);
variable buf_mplier_2: std_logic_vector(output_width downto 0);
variable cnt : integer range 0 to 50;
begin
if clk'event and clk='1' then
--reset이 1인 경우 모두 0
if rst = '1' then
buf_mplicand := (others =>'0');
buf_mplier := (others =>'0');
buf_mplier_up := (others =>'0');
state <= 0;
cnt:=0;
--reset이 0인 경우 시작
else
case state is
--S0 buf_mplicand와 buf_mplier에 입력받은 값 저장 및 s1으로 이동
when 0 =>
buf_mplicand := m_plicand;
buf_mplier := "00000000" & m_plier & '0';
cnt:= 0;
if load = '0' then
state <= 0;
elsif load = '1' then
state <= 1;
end if;
--S1 buf_mplier의 최하위비트 두 개의 값에 따라 연산후 s2로 이동
when 1 =>
if (buf_mplier(1 downto 0 ) = "11") or (buf_mplier (1 downto 0) = "00") then
buf_mplier_2 := buf_mplier;
state <= 2;
elsif (buf_mplier (1 downto 0) = "10") then
buf_mplier_up := buf_mplier_up - buf_mplicand;
buf_mplier_2 := buf_mplier_up & buf_mplier(8 downto 0);
state <=2;
elsif (buf_mplier (1 downto 0) = "01") then
buf_mplier_up := buf_mplier_up + buf_mplicand;
buf_mplier_2 := buf_mplier_up & buf_mplier(8 downto 0);
state <=2;
end if;
--S2 쉬프트 연산후 cnt 증가 cnt가 8이 되면 s0으로 8이 되기 전에는 s1로 보내서 다시 연산 시킴
when 2 =>
--쉬프트 연산하는 부분으로 최상위 비트는 사인 비트 유지를 위해 변경되지 않음에 유의
buf_mplier_2 := buf_mplier_2 (16) & buf_mplier_2(16 downto 1);
buf_mplier:= buf_mplier_2;
buf_mplier_up := buf_mplier_2 (16 downto 9);
cnt := cnt +1;
if (cnt < 8) then
state <= 1;
elsif (cnt = 8) then
--cnt가 8인 경우로서 출력에 buf_mplier_2의 최하위 비트를 제외한 값(Y-1에 해당)을 제외하고 저장하여 출력
output <= buf_mplier_2(16 downto 1);
state <= 0;
end if;
end case;
end if;
end if;
end process;
end Behavioral;
Conclusion
기본적 형태의 multiplexor인 ALU를 설계해 보았다. 단순한 연산을 떠나 조건문을 이용하여 다양한 케이스의 연산을 설계하고 같은 입력 값을 다른 연산을 수행시켜 보았다. 쉬프트연산을 굳이 쉬프트 연산자를 이용하지 않고도 간단하게 구현할 수 있었다.
· ALU를 이용해서 다양한 연산을 할 수 있다.
· 조건문을 사용해서 여러가지 케이스를 나눌 수 있다. 그 나뉘어진 케이스에 따라 각각 다른 연산을 수행시킬 수 있다.
내부 시그널과 비슷하지만 수행 속도에 있어서 차이가 있는 variable을 사용하여 보았으며 Booth 곱셈기를 설계하였다.
Evaluation
ALU와 Booth 곱셈기를 설계하였다. 가감산기와는 달리 연산 자체를 하나하나 지정해준 것은 아니고 +, -등 연산자를 이용하여 할 수 있었으며 C와 비슷한 if, case등 조건문을 사용하여 C에 익숙한 덕분에 크게 어려움을 느끼지 않았다. 다만 Booth곱셈기를 설계할 때 처음 값을 인가하는 부분에서 실수가 있었는지 출력이 자꾸 0만 떠서 곤란함을 느꼈었지만 크게 늦지 않게 해결하고 집에 갈 수 있었다.
  • 가격1,500
  • 페이지수19페이지
  • 등록일2014.06.23
  • 저작시기2014.5
  • 파일형식한글(hwp)
  • 자료번호#925438
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니