微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 求大神帮我看一下程序

求大神帮我看一下程序

时间:10-02 整理:3721RD 点击:

 library ieee;

 use ieee.std_logic_1164.all;

 use ieee.std_logic_arith.all;

 entity mux2 is

  generic (n:integer:=16);

          port (d0:in std_logic_vector(7 downto 0);

                         d1: in integer range 0 to n-1;

                                  sel:in std_logic;

                                  yout: out std_logic_vector(7 downto 0));

                                  end mux2;

                                  architecture if_march of mux2 is

                                  begin

                                      process(d0,d1,sel)

                                           begin

                                             if(sel='1') then

                                                 yout<=conv_std_logic_vector(d1,8);

                                                 else

                                                 yout<=d0;

                                                 end if;

                                     end process;

                                         end if_march;



这是教科书上的一个程序,为什么我怎么仿真都得不到这个结果?

这是一个二选一的选择器,是程序错误还是我不会仿真,求指导一下。



看波形,仿真结果是对的啊。小编再好好看看

来学习 一下  顶一个

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top