集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1481|回复: 2

求VHDL达人帮忙翻译

[复制链接]
如风自在 发表于 2011-5-24 20:33:17 | 显示全部楼层 |阅读模式
begin

----------------------------------------------------------------------------
-- 8 registers of 16 bits each
----------------------------------------------------------------------------
  seldreg_s <= w & seldreg;

  process (clk,reset)
    begin
        if reset='1' then
            axreg_s <= (others => '0');
            cxreg_s <= (others => '0');
            dxreg_s <= (others => '0');
            bxreg_s <= (others => '0');
            spreg_s <= (others => '0');
            bpreg_s <= (others => '0');
            sireg_s <= (others => '0');
            direg_s <= (others => '0');
        elsif rising_edge(clk) then        
            if (wrd='1') then     
                case seldreg_s is
                    when "0000" => axreg_s(7 downto 0)  <= dibus(7 downto 0);     -- w=0 8 bits write
                    when "0001" => cxreg_s(7 downto 0)  <= dibus(7 downto 0);
                    when "0010" => dxreg_s(7 downto 0)  <= dibus(7 downto 0);
                    when "0011" => bxreg_s(7 downto 0)  <= dibus(7 downto 0);
                    when "0100" => axreg_s(15 downto 8) <= dibus(7 downto 0);
                    when "0101" => cxreg_s(15 downto 8) <= dibus(7 downto 0);
                    when "0110" => dxreg_s(15 downto 8) <= dibus(7 downto 0);
                    when "0111" => bxreg_s(15 downto 8) <= dibus(7 downto 0);

                    when "1000" => axreg_s <= dibus;      -- w=1 16 bits write
                    when "1001" => cxreg_s <= dibus;
                    when "1010" => dxreg_s <= dibus;
                    when "1011" => bxreg_s <= dibus;
                    when "1100" => spreg_s <= dibus;
                    when "1101" => bpreg_s <= dibus;
                    when "1110" => sireg_s <= dibus;
                    when others => direg_s <= dibus;
                end case;                                                                                                                     
            end if;
        end if;   
    end process;

由于是初学VHDL,要做毕业设计。以上这段看不太懂,是什么意思?是赋值么?
emaklutz 发表于 2011-5-26 09:43:26 | 显示全部楼层
在不同的状态,将DIBUS的DATA赋值给不同的寄存器
honhu 发表于 2011-7-8 20:34:56 | 显示全部楼层
代码中  "reset " 起到异步清零的作用,"wrd"  是同布置数的功能。哪那个为1,就执行哪个。
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-6-17 20:54 , Processed in 0.061712 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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