集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 3531|回复: 4

如何用VHDL实现八位的串并转换?

[复制链接]
CPLD 发表于 2010-6-23 15:53:38 | 显示全部楼层 |阅读模式
如何用VHDL实现八位的串并转换?
 楼主| CPLD 发表于 2010-6-23 15:53:55 | 显示全部楼层
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity in8out1 is
       port( clk,indata,rst: in std_logic;
                      outdata: out std_logic_vector(7 downto 0));
end in8out1;
architecture sepa of in8out1 is
    signal temp_data: std_logic_vector(8 downto 0);
         begin
           process(clk)
              begin
                if clk'event and clk='1' then
                      if rst='0' then
                         temp_data<=( others=>'0' );
                      elsif temp_data(0)='0' then
                         temp_data<=indata&"01111111";
                      else
                         temp_data<=indata&temp_data(8 downto 1);
                      end if;
                end if;
           end process;
           process(temp_data)
                 begin
                   if temp_data(0)='0' then
                      outdata<=temp_data(8 downto 1);
                   else
                      outdata<="00000000";
                   end if;
           end process;
end sepa;
 楼主| CPLD 发表于 2010-6-23 15:54:07 | 显示全部楼层
程序我写好了。仿真我也做了。发现有毛刺,现在也没有解决,原因是可能器件的延迟设计的不好,另外做的只是功能仿真,结果上看是基本符合的。请你仔细调试一下,看看效果怎么样。
Sunlife 发表于 2015-5-20 15:14:35 | 显示全部楼层

程序我写好了。仿真我也做了。发现有毛刺,现在也没有解决,原因是可能器件的延迟设计的不好,另外做的只是功能仿真,结果上看是基本符合的。请你仔细调试一下,看看效果怎么样。
zxopenljx 发表于 2020-10-18 19:29:42 | 显示全部楼层
如何用VHDL实现八位的串并转换?
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-4-19 23:56 , Processed in 0.059969 second(s), 24 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表