[논리회로설계]ALU를 활용한 shifter 구현
본 자료는 3페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
해당 자료는 3페이지 까지만 미리보기를 제공합니다.
3페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[논리회로설계]ALU를 활용한 shifter 구현에 대한 보고서 자료입니다.

목차

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

본문내용

프트를 비트수만큼 하면 모두 0이 저장된다.
2.Describe how you solved
1. 10100010을 미리 입력으로 저장한다.
2. 스위치를 조작하여(00) 입력 값에 미리 저장된 입력을 인가한다.
3.
mode
동작
00
Load
01
Circular Shift
10
Logical Shift
11
Arithmetic Shift
4. 스위치를 조작하여 Right, Left 쉬프트를 선택한다.
5. 결과가 led로 출력된다.
3. provide specification
entity ShiftRegister is
port( clk, reset, dir : in std_logic;
mode : in std_logic_vector(1 downto 0);
q : out std_logic_vector(7 downto 0));
end ShiftRegister;
architecture Behavioral of ShiftRegister is
signal reg : std_logic_vector (7 downto 0);
signal clk_d : std_logic;
입력 clk- 클럭, reset-리셋, dir-쉬프트 방향 설정, mode-쉬프트 종류 선택을 선언하고
출력 q-led를 통하여 출력될 출력값을 8비트로 선언한다.
내부 신호로 쉬프트 결과 값을 저장할 reg를 8비트 선언하고, 분주회로를 위한 clk_d를 선언한다.
4. Discuss how your circuit does
입력값10100010
circular-Right
logical-Right
arithmetic-right
10100010
01010001
10101000
01010100
10100010
01010001
00101000
00010100
10100010
11010001
11101000
11110100
circular-Left
logical-left
arithmetic-left
10100010
01000101
10001010
00010101
10100010
01000100
10001000
00010000
10100010
01000100
10001000
00010000
주어진 입력값에 대한 각각의 쉬프트를 3번씩 했을 때의 결과로서
circular shift는 최상위 비트, 최하위 비트가 없어지지 않고 순환하며
logical shift는 0으로 되고,
arithmetic shift는 right shift를 할 때 최상위 비트의 sign이 유지됨을 알 수 있다.
5. Discuss how you test it.
미리 준비된 Kit와 연결하여 실험할 것이며 분주회로를 통해 클럭의 주파수를 줄일 것이다.
실제 클럭은 4MHz 가 들어오고 이를 1Hz로 줄일 것이다. (20000000번 카운트 된 후에 clk_d가 1이 한번 되도록 설계)
pin table은 아래와 같다.
port
pin
clk
p79
reset
p205
dir
p12
mode(1:0)
p15, p16
q(7:0)
p11~p2
이에 대한 ucf 코드는 아래와 같다.
NET \"mode<0>\" LOC=\"p16\";
NET \"mode<1>\" LOC=\"p15\";
NET \"dir\" LOC=\"p12\";
NET \"q<0>\" LOC=\"p2\";
NET \"q<1>\" LOC=\"p3\";
NET \"q<2>\" LOC=\"p4\";
NET \"q<3>\" LOC=\"p5\";
NET \"q<4>\" LOC=\"p7\";
NET \"q<5>\" LOC=\"p9\";
NET \"q<6>\" LOC=\"p10\";
NET \"q<7>\" LOC=\"p11\";
NET \"reset\" LOC=\"p205\";
NET \"clk\" LOC =\"p79\";
6. Provide the simulation result and the code
circular right shift 3번후 모습 01010100이 점등되어 있다.
circular left shift 3번후 모습 00010101이 점등되어 있다.
logical right shift 3번후 모습 00010100이 점등되어 있다.
logical left shift 3번후 모습 00010000이 점등되어 있다.
arithmetic right shift 3번후 모습 11110100이 점등되어 있다.
arithmetic right shift 3번후 모습 00010000이 점등되어 있다.
SourceCode
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
--입력, 출력
entity ShiftRegister is
port( clk, reset, dir : in std_logic;
mode : in std_logic_vector(1 downto 0);
q : out std_logic_vector(7 downto 0));
end ShiftRegister;
architecture Behavioral of ShiftRegister is
--내부신호
signal reg : std_logic_vector (7 downto 0);
signal clk_d : std_logic;
begin
--분주회로 clk가 2000000이 되면 clk_d가 1이 된다 이후 clk가 2000000되면 clk_d는 0이 된다.
process( reset, clk )
variable count_clk : integer range 0 to 2000000;
begin
if( reset = \'0\' ) then
clk_d <= \'0\';
count_clk :=0;
elsif( clk\'event and clk=\'1\' ) then
if( count_clk = 2000000 ) then
clk_d <= not clk_d;
count_clk := 0;
else
count_clk := count_clk +1;
end if;
end if;
end process;
--본 프로세스 clk 대신 clk_d가 클럭으로 들어간다
process(clk_d, reset, dir)
begin
--리셋
if (reset=\'0\') then
reg <= (others => \'0\');
--clk_d가 라이징

키워드

  • 가격1,000
  • 페이지수10페이지
  • 등록일2014.06.23
  • 저작시기2014.5
  • 파일형식한글(hwp)
  • 자료번호#925441
본 자료는 최근 2주간 다운받은 회원이 없습니다.
다운로드 장바구니