- 3
- 0
- 约2.15千字
- 约 2页
- 2019-07-14 发布于江苏
- 举报
VHDL - ( 3)
【VVHHDDLL 程序举例大全--存储器举例:((注33))】
--A First-in First-outMemory
--afirst-in firstoutmemory,usesasynchronising clock
--genericsallowfifosofdifferentsizestobeinstantiated
libraryIEEE;
useIEEE.Std_logic_1164.all;
entityFIFOMXNis
generic(m, n:Positive :=8);--misfifodepth,nisfifowidth
port(RESET,WRREQ,RDREQ,CLOCK:inStd_logic;
DATAIN :inStd_logic_vector((n-1)downto0);
DATAOUT:outStd_logic_vector((n-1)downto0);
FULL, EMPTY:inoutStd_logic);
endFIFOMXN;
architectureV2ofFIFOMXNis
typeFifo_arrayisarray(0to(m-1)) ofBit_vector((n-1)downto0);
signalFifo_memory:Fifo_array;
signalWraddr,Rdaddr,Offset:Naturalrange0to(m-1);
signalRdpulse,Wrpulse,Q1,Q2,Q3,Q4:Std_logic;
signalDatabuffer:Bit_vector((n-1)downto0);
begin
--pulsesynchronisersforWRREQandRDREQ
--modifiedforSynplify toaprocess
sync_ffs:process
begin
waituntilrising_edge(CLOCK);
Q1=WRREQ;
Q2=Q1;
Q3=RDREQ;
Q4=Q3;
endprocess;
--concurrentlogictogeneratepulses
Wrpulse=Q2andnot(Q1);
Rdpulse=Q4andnot(Q3);
Fifo_read:process
begin
waituntilrising_edge(CLOCK);
ifRESET=1 then
Rdaddr=0;
Databuffer=(others=0);
elsif(Rdpulse=1andEMPTY=0) then
Databuffer=Fifo_memory(Rdaddr);
Rdaddr=(Rdaddr+1)modm;
endif;
endprocess;
Fifo_write:process
begin
waituntilrising_edge(CLOCK);
ifRESET=1 then
Wraddr=0;
elsif(Wrpulse=1 andFULL=0)then
Fifo_memory(Wraddr)=To_Bitvector(DATAIN);
Wraddr=(Wraddr+1)mod m;
endif;
endprocess;
Offset=(Wraddr-Rdaddr)when(WraddrRdaddr)
else(m-(Rdaddr-Wraddr))when(RdaddrWraddr)
else0;
EMPTY=1 when(Offset=0)else0;
FULL=1 when(Offset=(m-1))
您可能关注的文档
- API 5L 要点速查表(无缝管部分)(44版) 2007.pdf
- 废旧塑料回收.doc
- 2013养老地产发展前景分析.doc
- 2012年全球个人移动应用市场十大趋势.pdf
- 平行志愿投档潜在风险与认识误区-在线.doc
- siRNA数据库与设计工具.pdf
- 基于模煳自整定PID的单片机温度控制系统设计[1].pdf
- 国家最新工程造价咨询合同.pdf
- Weimedia教你如何做一个合格的微博营销专员.docx
- 描述富莱克软水控制阀产品规范标准.pdf
- 2026年锡林郭勒职业学院单招职业适应性测试模拟测试卷及答案1套.docx
- 2026年锡林郭勒职业学院单招职业适应性测试模拟测试卷及答案1套.docx
- 十五五智能计算中心关键物料储备战略投资.pptx
- 2026年锡林郭勒职业学院单招职业适应性测试模拟测试卷完整.docx
- 十五五智能计算中心设计规划咨询服务融资.pptx
- 2026年铜陵职业技术学院单招职测考试题库完整版.docx
- 十五五智能计算中心室内农业相结合的投资试验.pptx
- 2026年铜陵职业技术学院单招职业适应性考试题库必考题.docx
- 2026年锡林郭勒职业学院单招综合素质考试题库带答案.docx
- 十五五智能计算中心投资社区与智库兴起.pptx
原创力文档

文档评论(0)