unishift74194.vhd

来自「vhdl programs to use as a lab experiment」· VHDL 代码 · 共 29 行

VHD
29
字号
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity shift74194 is    port(clk, cr, rin,lin: in std_logic;          s: in std_logic_vector(1 downto 0);          d: in std_logic_vector(3 downto 0);          q: out std_logic_vector(3 downto 0)          );end shift74194;architecture reg of shift74194 issignal sq: std_logic_vector(3 downto 0);begin    process(clk,cr,d)        begin            if(cr='1') then sq<= "0000";            elsif(clk'event and clk='1') then                case  s is                 when "00" => sq<=d;                 when "01" => sq<= rin& d(3 downto 1);                 when "10" => sq<= d(2 downto 0)&lin;                 when "11" => sq<= d(0)& d( 3 downto 1);                 when others => sq<= "UUUU";                 end case ;            end if;     end process;     q<= sq;end reg;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?