목차
1. 이론
2. 코드
3. 파형
4. 컴토 및 분석
본문내용
1. 이론
시프트 레지스터는 2진수를 저장하는 플립플롭이 직렬로 연결되어 있는 집합체입니다. 입력된 2진수는 시프트 실행 신호가 들어 올 때마다 left shifter는 왼쪽으로, right shifter는 오른쪽으로 이동합니다. 이번에 구현한 코드는 한 비트씩 이동하는 시프터입니다. 그리고 left shifter 의 경우는 가장 왼쪽에 있는 비트가 다시 오른쪽으로 오고, right shifter의 경우는 가장 오른쪽에 있는 비트가 다시 가장 왼쪽에 옵니다.
2. 코드
<left_shifter>
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity left_shifter is
port(rst : in std_logic;
clk : in std_logic;
load : in std_logic;
data : in std_logic_vector(5 downto 0);
out_shift : out std_logic_vector(5 downto 0));
end left_shifter;
architecture a of left_shifter is
<right_shifter>
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity right_shifter is
port(rst : in std_logic;
clk : in std_logic;
load : in std_logic;
data : in std_logic_vector(5 downto 0);
out_shift : out std_logic_vector(5 downto 0));
end right_shifter;
architecture a of right_shifter is
signal s : std_logic_vector(5 downto 0) :="000000";
참고 자료
없음