完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
想做一个256*1的异步FIFO,这里只写了写的程序,
module myfifo(clk_1,indata,clk_2,outdata); input clk_1; //write clock// input indata; //input data// output clk_2; //read clock// output outdata; // output data// parameter DEPTH=256,MAX_COUNT=8'b11111111; //256*1// reg emptyp=1'b1; //empty flag// reg fullp=1'b0; //full flag// reg outdata; reg[DEPTH-1:0] tail=8'b00000000; //tail pointer// reg[DEPTH-1:0] head=8'b00000000; //head pointer// reg fifomem[0:MAX_COUNT]; //define the memory// //write// always @(posedge clk_1) begin if(emptyp==1'b1) if(head==DEPTH-1) fifomem[head]<=indata; emptyp<=1'b0; fullp<=1'b1; else fifomem[head]<=indata; head<=head+1; end endmodule 编译出来有这样的错误Error (10170): Verilog HDL syntax error at myfifo.v(24) near text "else"; expecting "@", or "end", or an identifier ("else" is a reserved keyword ), or a system task, or "{", or a sequential statement 改了很久,也不知道是什么问题 |
|
相关推荐 |
|
3323 浏览 1 评论
2582 浏览 1 评论
756 浏览 0 评论
1384 浏览 2 评论
【阿尔达H-30T恒温电烙铁试用体验】阿尔达H-30T恒温电烙铁试用体验
5864 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-29 09:28 , Processed in 0.506065 second(s), Total 37, Slave 29 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号