完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
大家好,
我必须在clk的每个上升沿发送1个D阵列。 下面是我的代码请帮我完成代码。 entity data_sense isport(clk:在std_logic中; --addr:在整数范围0到3; data_out:out std_logic_vector(15 downto 0)); end data_sense; architecture data_sense的行为istype vector_array是std_logic_vector的数组(0到3)( 15 downto 0);信号存储器:vector_array;信号地址:整数范围0到3; - 类型vector_array1是std_logic_vector的数组(0到3)(15 downto 0); - 信号temp:vector_array1;信号temp:std_logic_vector( 15 downto 0); beginmemory(0)(15 downto 0)内存(1)(15 downto 0)内存(2)(15 downto 0)内存(3)(15 downto 0)进程(clk) - 变量temp: std_logic_vector(15 downto 0); beginfor i in 0 to 3 loopif(clk'event and clk ='1')thentemp end if if; end loop; end process; data_out end Behavioral;我必须一个接一个地发送4个数组 clk的所有上升边缘:) 请帮忙。 谢谢 以上来自于谷歌翻译 以下为原文 Hi all, I have to send 1 D array at each rising edge of the clk. below is my code please help me to complete the code. entity data_sense is port( clk : in std_logic; --addr : in integer range 0 to 3; data_out : out std_logic_vector(15 downto 0)); end data_sense; architecture Behavioral of data_sense is type vector_array is array(0 to 3) of std_logic_vector(15 downto 0); signal memory : vector_array; signal addr : integer range 0 to 3; --type vector_array1 is array(0 to 3) of std_logic_vector(15 downto 0); --signal temp : vector_array1; signal temp : std_logic_vector(15 downto 0); begin memory(0)(15 downto 0) <= "1111000011110000"; memory(1)(15 downto 0) <= "1111000011110000"; memory(2)(15 downto 0) <= "0111000011110000"; memory(3)(15 downto 0) <= "1111000011110000"; process(clk) --variable temp : std_logic_vector(15 downto 0); begin for i in 0 to 3 loop if(clk'event and clk = '1') then temp <= memory(i)(15 downto 0); end if; end loop; end process; data_out <= temp; end Behavioral; I have to send 4 array one by one repeatedly at all the rising edge of the clk :) Please help. Thanks |
|
相关推荐
3个回答
|
|
嗨,
您可以使用基于ROM的方法。 示例代码如下 实体romapproach是Port(clk:在STD_LOGIC; dout:out STD_LOGIC_VECTOR(15 downto 0)); end romapproach架构romapproach的行为istype数据是std_logic_vector的数组(0到3)(15 downto 0); Signal SData:data:= (“1111000011110000”,“1111000011110000”,“0111000011110000”,“1111000011110000”);信号dcount:整数范围0到3; beginProcess(clk)beginIf rising_edge(clk)然后dout if(dcount = 3)然后dcount else dcount end if; 结束如果;结束过程;结束行为; FPGA怪胎 在原帖中查看解决方案 以上来自于谷歌翻译 以下为原文 Hi, You can use ROM based approach for this. Example code is below entity romapproach is Port ( clk : in STD_LOGIC; dout : out STD_LOGIC_VECTOR (15 downto 0)); end romapproach architecture Behavioral of romapproach is type data is array (0 to 3) of std_logic_vector (15 downto 0); Signal SData : data:= ( "1111000011110000","1111000011110000","0111000011110000","1111000011110000"); Signal dcount : integer range 0 to 3; begin Process (clk) begin If rising_edge (clk) then dout <= Sdata(dcount); if (dcount = 3) then dcount <= 0; else dcount <= dcount+1; end if; end if; end process; end Behavioral; FPGA freakView solution in original post |
|
|
|
嗨,
您可以使用基于ROM的方法。 示例代码如下 实体romapproach是Port(clk:在STD_LOGIC; dout:out STD_LOGIC_VECTOR(15 downto 0)); end romapproach架构romapproach的行为istype数据是std_logic_vector的数组(0到3)(15 downto 0); Signal SData:data:= (“1111000011110000”,“1111000011110000”,“0111000011110000”,“1111000011110000”);信号dcount:整数范围0到3; beginProcess(clk)beginIf rising_edge(clk)然后dout if(dcount = 3)然后dcount else dcount end if; 结束如果;结束过程;结束行为; FPGA怪胎 以上来自于谷歌翻译 以下为原文 Hi, You can use ROM based approach for this. Example code is below entity romapproach is Port ( clk : in STD_LOGIC; dout : out STD_LOGIC_VECTOR (15 downto 0)); end romapproach architecture Behavioral of romapproach is type data is array (0 to 3) of std_logic_vector (15 downto 0); Signal SData : data:= ( "1111000011110000","1111000011110000","0111000011110000","1111000011110000"); Signal dcount : integer range 0 to 3; begin Process (clk) begin If rising_edge (clk) then dout <= Sdata(dcount); if (dcount = 3) then dcount <= 0; else dcount <= dcount+1; end if; end if; end process; end Behavioral; FPGA freak |
|
|
|
谢谢sridar,
代码正如我所料:) 带着敬意 ANIL 以上来自于谷歌翻译 以下为原文 Thanks sridar, The code is working as i expected :) with regards ANIL |
|
|
|
只有小组成员才能发言,加入小组>>
2414 浏览 7 评论
2821 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2292 浏览 9 评论
3371 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2458 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
1069浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
577浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
437浏览 1评论
1999浏览 0评论
722浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 18:38 , Processed in 1.314274 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号