⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 source_serial_parallel.vhd

📁 ALTERA的语音芯片程序
💻 VHD
字号:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_unsigned.all;
ENTITY source_serial_parallel IS 
PORT ( reset,clk : IN STD_LOGIC;
             din:  IN STD_LOGIC;
	        done: out std_logic;
           dout: OUT STD_LOGIC_vector(3 downto 0));
END source_serial_parallel;

ARCHITECTURE shift OF source_serial_parallel IS
  SIGNAL  data: std_logic_vector(3 downto 0);
  signal  bitcount:std_logic_vector(1 downto 0);
  signal  doneR: std_logic;
BEGIN
  process(clk,reset)
  begin 
  if reset='0' then data<="0000";
  elsif clk'event and clk='1' then
         if bitcount="11" then bitcount<="00";
         else    bitcount<=bitcount+'1';
         end if;
         data(3 downto 0)<=data(2 downto 0)&din;
   end if;
end process;
  process(clk,reset)
  begin
  if reset='0' then doneR<='0';
  elsif bitcount="11" then doneR<='1';
  else doneR<='0';
  end if;
  end process;
  done<=doneR;
  dout<=data;
END shift;

⌨️ 快捷键说明

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