介绍大型Cypress公司FIFO器件的内部工作和如何应用这些器件进行深度和宽度的扩展
- 格式:pdf
- 大小:349.20 KB
- 文档页数:8
fifo电路结构结构
FIFO电路结构是一种特殊的存储器结构,主要用于数据的缓存和传输。
FIFO,即First In First Out,意为先入先出,其特性是数据按照进入的顺序依次被读出。
这种特性使得FIFO在数据传输和缓冲中扮演着重要的角色。
FIFO电路结构主要由两部分组成:输入部分和输出部分。
输入部分负责接收数据并将其存储到FIFO中,而输出部分则负责从FIFO中读取数据并将其输出。
这种结构使得数据在FIFO中的流动呈现出一种线性、有序的状态。
在FIFO中,数据的存储和读取都是通过指针来实现的。
指针是一个地址指示器,它指向FIFO中当前要读取或写入的数据的位置。
当数据被写入FIFO时,写指针会向前移动,指向下一个可用的存储位置。
当数据被从FIFO中读取时,读指针会向前移动,指向下一个要读取的数据位置。
由于FIFO的先入先出特性,写指针和读指针的移动方向是一致的,都是从FIFO的一端向另一端移动。
FIFO电路结构有两种主要类型:触发导向结构和零导向传输结构。
触发导向结构的FIFO 由寄存器阵列构成,当满足一定条件时,数据会被写入或读取。
而零导向传输结构的FIFO 则是由具有读和写地址指针的双口RAM构成,数据的读写操作是通过地址指针来完成的。
FIFO电路结构在许多领域都有广泛的应用,如计算机系统中的缓存、数据传输、图像处理等。
由于其先入先出的特性,FIFO能够有效地缓解数据传输和处理过程中的速度不匹配问题,提高系统的整体性能。
fifo先进先出原理先进先出(First-In-First-Out, FIFO)是一种常见的数据存储和处理方式,它遵循一个简单的原则:最先进入的数据最先被处理或取出。
FIFO原理在计算机科学和电子工程中被广泛应用,一些典型的应用包括缓冲区、队列、调度算法和存储器管理。
接下来,我将详细介绍FIFO原理及其应用。
FIFO原理从字面上可以理解为“先进先出”,类似于队列理论中的排队模型。
假设有一条串行数据流,数据按照顺序进入一个容器或缓冲区,并按照相同的顺序离开。
数据可以是任何形式的,例如数字、字节、字符或者数据包。
FIFO原理的关键在于数据存储和处理的顺序。
当新的数据到达时,它被添加到容器的末尾,而最早到达的数据则从容器的开头被移除。
这就确保了每个数据项都遵循了“先进先出”的原则。
换句话说,数据在容器中被处理的顺序与它们进入容器的顺序相同。
FIFO原理可以通过一个简单的例子来理解。
考虑一个咖啡馆的咖啡杯架,顾客来到咖啡馆后,他们在杯架上取一只空杯子,并在架子的尽头放上一只新的满杯子。
当员工准备好制作咖啡时,他们会从杯架的一侧取出第一只空杯子,制作咖啡并交给顾客。
这样就确保了每个顾客依次得到自己的咖啡,遵循了先进先出的原则。
FIFO原理在计算机科学和电子工程中有广泛的应用。
其中一个典型的应用是队列。
队列是一种线性数据结构,它允许在一端(尾端)插入数据,而在另一端(头端)删除数据。
数据项通过队列“排队”进入和离开。
队列的操作包括入队(enqueue)和出队(dequeue)。
入队操作在队列的尾部插入数据项,而出队操作则移除队列的头部数据项。
队列的操作遵循FIFO原则,因此最早进入队列的数据项将最先出队。
队列的应用非常广泛,其中一个重要的应用是操作系统中的进程调度。
在多道程序设计环境中,操作系统需要决定执行哪个进程。
调度算法选择队列中的第一个进程,并分配处理器时间给它。
然后,该进程完成后,它会被移出队列,而下一个进程则成为新的队列头部。
红色飓风III开发板USB2FPGA实验指导Red Logic目录第一章FX2特性介绍 (3)1.1介绍………………………………………………………………………。
3 1.2结构………………………………………………………………………。
.3 1.3特征……………………………………………………………………….。
4第二章Slave FIFO传输 (5)2.1概述.................................................................................。
.5 2.2硬件连接.. (5)2.3 Slave FIFO的几种传输方式 (6)2.3.1 同步Slave FIFO写……………………………………………。
62.3.2 同步Slave FIFO读……………………………………………。
92.3.3异步Slave FIFO写……………………………………………。
112.3.4异步Slave FIFO读 (12)第三章寄存器设置..........................................................................。
15 3.1 IFCONFIG..................................................................。
(15)3.2 PINFLAGSAB/CD.........................................................。
...。
16 3.3 FIFORESET.. (17)3.4 FIFOPINPOLAR.........................................................。
......。
18 3.5 EPxCFG..................................................................。
fifo参数说明
FIFO(First In First Out)是一种先进先出的数据缓存器,用于数据的缓存或高速异步数据的交互。
以下是FIFO的一些主要参数:
1. 宽度:FIFO的宽度表示每次读写操作的数据位数。
2. 深度:FIFO的深度表示FIFO可以存储的数据量,计算方式为深度=2的宽度位数次方。
3. 空标志:当FIFO为空时,会产生空标志,此时无法进行读操作。
4. 满标志:当FIFO已满时,会产生满标志,此时无法进行写操作。
5. 读写时钟:对于同步FIFO,读写操作使用同一时钟;对于异步FIFO,读写操作使用不同的时钟。
6. 读写地址:FIFO具有自动加一的读写地址,用于数据的读写操作。
7. 计数器:用于产生空满标志,当计数器的值为0时产生空标志,当计数器的值为FIFO深度时产生满标志。
8. 数据宽度:FIFO存储的数据宽度,用于定义数据在FIFO中的位宽。
了解这些参数对于设计和应用FIFO非常重要,它们会影响FIFO的性能和适用性。
同时,根据具体的应用需求,还可以定制其他参数,如数据预取、奇偶校验等。
异步fifo的工作原理今天咱们来唠唠异步FIFO这个超有趣的东西哦。
你可以把异步FIFO想象成一个特别的小仓库,这个小仓库是用来存放数据的呢。
不过它可有点特别,和咱们平常那种规规矩矩同步的仓库不太一样。
异步FIFO主要是在不同时钟域之间工作的。
就好比啊,有两个世界,一个世界的节奏快,另一个世界的节奏慢,异步FIFO就在这两个节奏不一样的世界之间搭起了一座数据的桥梁。
那它怎么存数据呢?当有数据要进来的时候,就像是有人要往这个小仓库里送货。
在写端口这边,有一个写指针,这个写指针就像一个小向导,它告诉大家数据应该放在仓库的哪个位置。
每次有新的数据要存进来,写指针就会指向下一个空闲的地方。
就像我们在图书馆书架上找空位放书一样,写指针就是那个帮我们找空位的小助手。
再说说读这边吧。
读端口有个读指针,这个读指针就负责从仓库里取数据。
它就像一个小管家,知道哪些数据已经被取走了,哪些还在仓库里等着被取。
读指针也是一步一步地移动,每次取走一个数据,就会指向下一个要取的数据的位置。
这里面有个超关键的东西,就是空满标志的判断。
你想啊,如果仓库满了,还往里塞东西,那不就乱套了嘛;或者仓库都空了,还在傻乎乎地去取数据,那也不行呀。
对于空满标志的判断呢,其实有点小巧妙。
因为是异步的,时钟不一样,所以不能简单地用一个计数器来判断。
一般会采用一些特殊的编码方式,像是格雷码。
为啥用格雷码呢?这就像是给这个小仓库的货物管理上了一道保险。
格雷码的好处就是相邻的码值只有一位不同。
这样在不同时钟域转换的时候,就不容易出错啦。
比如说,写指针和读指针在判断满的时候,不是简单地看数字大小哦。
因为时钟不一样,数字可能会乱套。
用格雷码就不一样啦,它能很准确地判断出是不是真的满了。
就好像是两个人在不同的节奏下数数,但是通过一种特殊的规则,能准确知道什么时候仓库满了。
还有哦,异步FIFO的深度也是个很重要的概念。
深度就像是这个小仓库的大小。
如果数据来的太快,而读的速度又跟不上,那仓库就得大一点,不然就容易满了溢出来。
高速串行数据通信发送芯片CY7B923的原理及应用CY7B923是CYPRESS公司推出的一种用于点对点之间高速串行数据通信的发送芯片。
CY7B923采纳的是基带传输通信方式,并支持带电插拔(热接插)。
其内部主要包括时钟产生器、输入寄存器、、移位寄存器、三对差分PECL输出对以及测试规律等。
该芯片外转帐电路比较容易,不需或微机控制,并且内置有自测试电路,因此用法比较便利。
CY7B923的最大传输速率可达400Mbps,有三种传输速率的器件可供挑选:标准系列的器件有CY7B923-JC、CY7V923-JI、 CY7B923-SC及CY7B923-LMB 四种型号,它们的传输速率为160~330Mbps;高速系列器件有CY7B923-400JC和CY7B923-400JI两种型号,传输速率可达160~400Mbps;对一些传输速率要求不高的场合,可采纳较低价格的CY7B923-155JC或CY7V923-155JI,其传输速率为150~160Mbps。
CY7B923采纳单一的+5V电源供电,功耗仅 350mW。
可兼容光纤、IBM ESCON、DVB-ASI及SMPTE-259M等多种传输协议,适用于光纤、同轴电缆和双绞线等传输媒介。
2 引脚功能及内部结构CY7B923有28脚SOIC、C和LCC三种封装形式,采纳 0.8μBi工艺,其此脚罗列1所示(SOIC封装),引脚功能如表1所列。
CY7B923的内部结构2所示,其内部主要包括时钟产生器、输入寄存器、编码器、移位寄存器、三对差分PECL输出对(OUTA±、OUTB±及OUTC±)及测试规律等电路。
输入寄存器的数据输入时序和标准FIFO的数据输出时序相全都,因而不需外加规律电路,便可知同步FIFO芯片或异步FIFO芯片挺直衔接并将FIFO芯片中的数据读入到输入寄存器中,然后再发送出去。
在BIST方式下,借助于内部规律电路,并行输入寄存器又可作为线性反馈移位寄存器,用于产生一串511字节的包含有数据、特定的有效字第1页共4页。
verilog fifo原理FIFO(FirstInFirstOut)是一种常用的存储器结构,用于在数据传输过程中暂存数据。
在数字电路和系统设计中,FIFO被广泛应用于数据缓存、接口通信等领域。
本文将介绍VerilogFIFO的基本原理和设计方法。
一、FIFO的结构FIFO通常由输入端、输出端和存储器组成。
输入端和输出端分别对应数据的输入和输出,而存储器则用于暂存数据。
FIFO的读写操作遵循FIFO的先进先出(FIFO)原则,即最早进入FIFO的数据最先被读取。
在Verilog中,可以使用模块(module)和语句(statement)来实现FIFO。
常见的VerilogFIFO结构包括数据寄存器(dataregister)、读写指针(read/writepointer)、存储器单元(memorycell)和控制逻辑(controllogic)等部分。
二、FIFO的工作原理1.读写操作FIFO的读写操作遵循FIFO的基本原则。
在写操作时,新数据被写入存储器;在读操作时,最早进入FIFO的数据最先被读取。
控制逻辑负责管理读写指针,以确保正确的读写操作顺序。
2.缓冲作用FIFO的主要作用是缓冲数据,即在数据传输过程中,将输入端的数据存储到FIFO中,待FIFO满后再从输出端输出数据。
这样可以在一定程度上缓解数据传输的时序问题,提高数据传输的可靠性和效率。
3.溢出和欠流控制当FIFO满时,控制逻辑会停止新的写操作,以避免数据溢出。
同样地,当FIFO空时,控制逻辑会暂停新的读操作,以防止欠流(underflow)现象的发生。
这些控制逻辑的实现通常需要借助状态机(statemachine)和条件语句(conditionstatement)等Verilog语言特性。
以下是一个简单的VerilogFIFO设计示例:modulefifo(inputwireclk,reset,en_write,en_read,outputwire [7:0]data_out);reg[7:0]data_reg[15:0];//数据寄存器regread_pointer,write_pointer;//读写指针integeri;parameterSIZE=16;//FIFO容量//控制逻辑和状态机always@(posedgeclkorposedgereset)beginif(reset)beginread_pointer<=0;//复位时读写指针都归零write_pointer<=0;for(i=0;i<SIZE;i=i+1)begindata_reg[i]<=8'h00;//清空FIFOendendelseif(en_write)begindata_reg[write_pointer]<={data_reg[write_pointer],data_in };//新数据写入FIFOwrite_pointer<=write_pointer+1;//写指针加一if(write_pointer==SIZE)write_pointer<=0;//FIFO满时归零写指针endelseif(en_read)begindata_out<=data_reg[read_pointer];//读出最早进入FIFO的数据read_pointer<=read_pointer+1;//读指针加一if(read_pointer==SIZE)read_pointer<=0;//FIFO空时归零读指针endelsebegin//其他情况不做处理endendendmodule以上示例中,我们使用了一个16位的数据寄存器和两个指针(read_pointer和write_pointer)来管理FIFO的读写操作。
fifo芯片FIFO(First-In-First-Out)芯片是一种常见的数据缓冲器,用于在数据读取和写入之间进行临时存储和排队操作的集成电路。
它按照数据进入的顺序进行排列,首先进入的数据首先被读取或输出。
FIFO芯片的主要功能是解决输入和输出设备之间速度不匹配的问题。
例如,当一个设备以较快的速度产生数据,而另一个设备以较慢的速度接收数据时,使用FIFO芯片可以临时存储数据并使其按照正确的顺序进行传输。
FIFO芯片通常由读取和写入指针组成,用于指示读取和写入操作的位置。
当数据写入FIFO时,写入指针会自动增加。
当数据被读取或输出时,读取指针会自动增加。
这种方式可以保证数据按照正确的顺序进行读取和输出。
FIFO芯片具有以下特点和优势:1. 数据存储和传输的稳定性:FIFO芯片通过临时存储数据,可以确保数据传输的稳定性和可靠性。
当输入设备和输出设备速度不一致时,FIFO芯片可以自动调整数据的传输速度,避免数据丢失或错误。
2. 简化数据处理:FIFO芯片可以作为缓冲器,存储大量的数据,并且在需要时按照正确的顺序进行传输。
这样可以减轻主处理器的负担,简化数据处理的复杂性。
3. 异步数据传输:FIFO芯片可以实现异步数据传输,不同设备之间的数据传输可以按照各自的节奏进行,不需要进行时钟同步或控制信号的干扰。
4. 灵活性和可扩展性:FIFO芯片可以根据系统需求进行配置和扩展。
可以根据需要选择不同的存储容量,以满足数据处理的要求。
5. 低功耗和高性能:FIFO芯片通常采用CMOS技术制造,具有低功耗和高性能的特点。
因此,在各种电子设备中广泛应用,例如通信设备、计算机、工业自动化等。
总的来说,FIFO芯片作为一种常见的数据缓冲器,可以提供稳定可靠的数据传输和处理功能,解决输入和输出设备之间速度不匹配的问题。
它在现代电子设备中具有重要的应用和意义,促进了数据处理和通信技术的发展。
FIFO详解深⼊理解FIFO(包含有FIFO深度的解释)FIFO:⼀、先⼊先出队列(First Input First Output,FIFO)这是⼀种传统的按序执⾏⽅法,先进⼊的指令先完成并引退,跟着才执⾏第⼆条指令。
1.什么是FIFO?FIFO是英⽂First In First Out 的缩写,是⼀种先进先出的数据缓存器,他与普通存储器的区别是没有外部读写地址线,这样使⽤起来⾮常简单,但缺点就是只能顺序写⼊数据,顺序的读出数据,其数据地址由内部读写指针⾃动加1完成,不能像普通存储器那样可以由地址线决定读取或写⼊某个指定的地址。
2.什么情况下⽤FIFO?FIFO⼀般⽤于不同时钟域之间的数据传输,⽐如FIFO的⼀端时AD数据采集,另⼀端时计算机的PCI总线,假设其AD采集的速率为16位 100K SPS,那么每秒的数据量为100K×16bit=1.6Mbps,⽽PCI总线的速度为33MHz,总线宽度32bit,其最⼤传输速率为1056Mbps,在两个不同的时钟域间就可以采⽤FIFO来作为数据缓冲。
另外对于不同宽度的数据接⼝也可以⽤FIFO,例如单⽚机位8位数据输出,⽽DSP可能是16位数据输⼊,在单⽚机与DSP连接时就可以使⽤FIFO来达到数据匹配的⽬的。
3.FIFO的⼀些重要参数FIFO的宽度:也就是英⽂资料⾥常看到的THE WIDTH,它只的是FIFO⼀次读写操作的数据位,就像MCU有8位和16位,ARM 32位等等,FIFO的宽度在单⽚成品IC中是固定的,也有可选择的,如果⽤FPGA⾃⼰实现⼀个FIFO,其数据位,也就是宽度是可以⾃⼰定义的。
FIFO的深度:THE DEEPTH,它指的是FIFO可以存储多少个N位的数据(如果宽度为N)。
如⼀个8位的FIFO,若深度为8,它可以存储8个8位的数据,深度为12 ,就可以存储12个8位的数据,FIFO的深度可⼤可⼩,个⼈认为FIFO深度的计算并⽆⼀个固定的公式。
异步fifo原理异步FIFO原理解析什么是异步FIFO异步FIFO是一种用于数据接收和发送的电子元件,它按照先入先出(FIFO)的原则处理数据。
它被广泛应用于数字电子系统中的数据缓冲、通信和存储等领域。
异步FIFO的原理异步信号与同步信号的区别1.同步信号:数据的传输采用同一个时钟信号驱动,数据的采样和传输是在时钟的上升沿或下降沿进行的。
2.异步信号:数据的传输不依赖于单一的时钟信号,发出数据的一方和接收数据的一方的时钟信号不一定完全一致。
异步FIFO的工作原理异步FIFO是由两个独立的存储器组成,一个作为数据的写入端,另一个作为数据的读取端。
它们通过一系列的控制信号来实现数据的缓冲和传输。
1.当数据写入FIFO时,写指针会自动递增,将数据写入写指针所指向的位置。
2.当数据读取FIFO时,读指针会自动递增,读取指针所指向的数据,并将其传递给外部。
异步FIFO的数据同步由于不同的时钟信号可能有不同的频率和相位,所以在数据传输过程中,可能会出现时钟抖动或者抖动,导致数据读取错误。
因此,为了保证数据的可靠传输,异步FIFO使用了数据同步机制。
1.FIFO的写指针和读指针都需要采用相关的同步电路,使其与本地时钟信号同步。
2.读指针必须等待写指针来自写入端的下一个时钟周期,并且读指针的启动信号必须与读指针同一时钟周期内变化。
异步FIFO的关键问题异步FIFO在使用过程中,需要注意一些关键问题,以确保数据的正确传输。
数据宽度不兼容在异步FIFO中,写入端和读取端的数据宽度不一定相同。
为了解决这个问题,需要使用数据宽度转换电路,将数据进行格式转换。
读写速度不匹配在数据写入和读取的过程中,写入端和读取端的速度可能不一致。
为了解决这个问题,一种常见的解决方案是使用FIFO深度控制电路,来控制数据的写入和读取速度。
异步FIFO的应用场景异步FIFO主要用于数据缓冲、数据通信以及存储系统等领域。
它在数字电子系统中起到了缓冲数据、数据传输和数据存储的重要作用。
fax id: 5506Understanding Large FIFOsIntroductionThis application note explains the internal operation of the large FIFOs manufactured by Cypress and shows how to use the devices to accomplish depth and width expansion. Other topics covered here include FIFO interfacing, the writing and reading process, failure modes, and typical problem symp-toms and solutions. This information applies to the following Cypress FIFOs: CY7C419, CY7C420, CY7C421, CY7C424,CY7C425, CY7C428, CY7C429, CY7C432, CY7C433,CY7C439, CY7C460, CY7C462, CY7C464, CY7C470,CY7C472, and CY7C474.Timing parameters given in this application note are taken from Cypress Semiconductor’s High Performance Data Book .Large FIFO OverviewThe Cypress product line of large FIFOs include densities from 256 x 9 up to 32, 768 (32K) x 9,with the depth doubling (256, 512, 1K, 2K, 4K, 8K, 16K, 32K) between densities.These monolithic devices are available in a wide variety of packages with the industry standard pinout and with access times as fast as ten nanoseconds and cycle times as fast as twenty nanoseconds. Not all speed grades are available in all densities or all packages, so consult the Cypress databook to determine valid speed, density, package combinations. The smallest package available is the 32-lead 7mm x 7mm TQFP ,which occupies less than one-third the area of a 300-mil-wide 28-pin DIP .Although the first FIFOs utilized a shift-register type of archi-tecture, today’s large FIFOs employ an SRAM type of inter-face. Data is written into and read out of the devices, as with SRAM write and read operations. These operations can occur independently of one another and are made possible by a specially designed six-transistor, dual-ported SRAM cell. This cell makes use of separate read and write transistors to allow independent R/W operation.Operating these FIFOs at their maximum throughput rates demands the generation of narrow write and read pulses. T o facilitate significantly higher throughput rates, Cypress has developed the CY7C440 and CY7C450 families of clocked, or self-timed FIFOs.These FIFOs feature 70-MHz operation and are character-ized by self-timed interfaces. You generate the read and write enables, which are combined internally with the appropriate clocks. Thus, you do not need to generate narrow read and write pulses. These FIFOs also feature totally independent,asynchronous, read and write operations.Each FIFO is organized such that data is read out in the same sequential order in which it was written. Full, half-full and empty flags facilitate writing and reading. Additional pins are provided to facilitate unlimited expansion in width and depth,with no performance penalty.Writing to and Reading from the FIFOFigure 1 shows the large FIFOs’ read and write timing. Reads and writes are asynchronous to each other. The read processFigure 1. Asynchronous Read and Write Timing 电子发烧友 电子技术论坛begins with R’s falling edge. The output data bus, Q0–Q8, leaves the high-impedance state t LZR ns after R’s falling edge. The output data becomes valid t A ns after that same falling edge. This t A period is referred to as the FIFO’s read access time. R’s rising edge ends the read process.The data on the Q0–Q8 bus remains valid for t DVR ns following the R rising edge. This is the output data hold time at the end of the read cycle. The internal circuitry then readies itself for the next read operation. This period is referred to as the t RR, or read recovery time, and must be observed between con-secutive read operations. The read signal’s minimum pulse width is denoted by t PR and is identical to the read access time, t A.You can determine the read cycle time (t RC) by adding the access time (t A) and the read recovery time (t RR), which you can find in the FIFO data sheet. The maximum read frequen-cy is the reciprocal of t A + t RR. For example, a Cypress FIFO with a 20-ns access time and a 10-ns read recovery time re-sults in a 30-ns read cycle time, or 33.3-MHz maximum read cycle frequency.The write process is similar to the read process. A write be-gins with the falling edge of the write line, W, and terminates with W’s rising edge. For a valid write to occur, the input data bus, D0–D8, must be stable for t SD ns prior to W’s rising edge and for t HD ns after this edge. These specifications are re-ferred to as the data set-up and hold times, respectively. The write strobe also has a minimum negative pulse width, denot-ed as t PW. A minimum recovery time, t WR, is required between write cycles.The maximum write frequency is the reciprocal of t PW + t WR. As an example, a device with a 20-ns write strobe width and a 10-ns write recovery time yields a 30-ns write cycle time, or a 33.3-MHz maximum write cycle frequency.The FIFOs include separate write and read counters (point-ers). Each write or read operation increments the appropriate counter one position. When the FIFO is empty, both counters point to the same location. The relative position of these counters determines the device’s status, which is indicated externally via empty, half-full, and full flags. ApplicationsFIFOs are asynchronous devices that are ideal for interfacing between two asynchronous processes. A FIFO allows two systems running at different data rates to communicate by providing a temporary data or control buffer.Typical FIFO applications include•Interprocessor communications, in which bidirectional de-vices are especially useful•Communications systems, including local area networks •Digital-signal-processing-based systems for bufferingreal-time data•Electronic data processing, CPU, and peripheral equip-ment, including high-performance disk controllers Common FIFO ConfigurationsAll large FIFOs can be interconnected, without external logic, to create either wider FIFOs, deeper FIFOs, or both. Standa-lone operation, width expansion, depth expansion, and de-sign considerations are described next.Figure 2 illustrates standalone mode, and Figure 3 shows width expansion mode. In both these modes, the XI (expan-sion in) pin is grounded and the FL (first load) pin is tied HIGH. The OR gates in the width-expansion design generate com-posite full, half-full, and empty flags (F, HF, E). Composite flags are necessary because variations in propagation delays might prevent the individual FIFOs in the design from entering the F, HF, or E states simultaneously. A composite flag prop-erly reflects the instantaneous status of the entire word. Figure 4 illustrates depth expansion. The FL (first load) pin on one device must be grounded to define that FIFO as the first FIFO to be written to. The FIFOs are then daisy-chained to-gether by connecting one device’s XO (expansion out) output pin to the next device’s XI (expansion in) input. The XO of the last device in the chain is connected to the XI of the first de-vice, thus forming a token-passing ring.Figure 3. Width ExpansionFigure 4. Depth ExpansionT oken passing allows the writing and reading processes to stay consistent. That is, the passing and holding of a read or write token tells an individual FIFO whether it is actively being read from or written to. In the token-passing procedure for write operations, the first FIFO is written to until it is filled. An internal write pointer determines the location written to, and after every write, the pointer is incremented. When the pointer reaches the last physical location, no more writes can occur to that device. At that point, the first FIFO passes the write token to the next FIFO in the chain via the XO–XI interface. The second device, now in possession of the write token, re-ceives all future written data until this device also fills up and passes the write token onto the next device in the chain. If enough writes occur to fill up the FIFO chain, the last device fails in its attempt to pass the write token back to the first device. This is because the full FIFO cannot accept a write token. No further writes to the FIFO chain are allowed until a read operation occurs, which frees up an internal location. The relative positions of the internal write and read counters determine a device’s status and whether it can accept data though a write operation. Figure 5 shows the timing for write operations.As with the procedure for writes, the first FIFO in the chain holds the read token. When the FIFO chain is read from, the device holding the read token supplies the data from the ad-dress specified by the device’s read pointer. The read pointer is then incremented. The incrementing continues until the FIFO is empty, and the read token is passed to the next device in the chain. The passing of the read token is done via the XO–XI interface. Figure 6 shows the timing for read opera-tions.A depth-expansion design must generate composite status flags to adequately reflect the instantaneous state of the FIFO chain, as is done for width expansion.Figure 5. Write Expansion TimingFigure 6. Read Expansion TimingRetransmitThe retransmit feature is useful in communications for re-transmitting packets of data and in disk drives for rewriting sectors. It is especially useful in applications where a single block of data in the FIFO must be sent out multiple times, as in a word or pattern generator.Data can be retransmitted any number of times, and with Cy-press FIFOs, the retransmit feature can be used at any time, no matter how much data the FIFO contains. This is in con-trast to some competing FIFOs, such those from IDT, which do not allow use of the retransmit function when the FIFO is full.In the retransmit operation, the read pointer is reset to its initial location and the R pin is pulsed until the read pointer advances to the same memory location addressed by the write pointer. The retransmit (RT) pin is available in the sin-gle-device and width-expansion modes, but not in depth ex-pansion because this pin designates the FIFO to be loaded first.The retransmit function is initiated by asserting an ac-tive-LOW pulse to the retransmit input, which resets the inter-nal read counter to zero. Keep the R input inactive during this time; otherwise, the conflicting requirements on the read counter might cause it to become corrupted. The retransmit process does not affect the state of the write counter or the write process, though the retransmit timing constraints shown in Figure 7 must not be violated.Note that the architectural description in the 1990 and previ-ous Cypress data books incorrectly stated that the W input must be inactive during a retransmit cycle. No design or us-age rules are violated if retransmit and write cycles overlap or occur simultaneously; the device does not lock up, and data is neither lost nor corrupted.The reasons for the data book’s retransmit/write restriction are more historical and application-oriented than functional. Specifically, the first large FIFOs did not permit writes during a retransmit cycle. This set a documentation precedent that all future devices had to match.Additionally, keeping track of what data is currently in the FIFO and what data is being read out can become complicat-ed. For example, if a FIFO is half full and the retransmit func-tion is activated and writes continue, filling the FIFO to three quarters full before the read pointer catches up with the write pointer, the FIFO outputs all of the data.Common Problems and SolutionsT o help prevent problems and correct them when they occur, this section describes the causes and solutions to some com-mon FIFO problems. The first problem to consider is corrupt-ed or repetitive data in a FIFO.Corrupted or Repetitive DataThe most common cause of corrupted and repetitive data be-ing present in a FIFO is a spurious active signal (glitch) on the FIFO’s W input. Because Cypress devices are extremely fast, a write pulse as short as 3 ns initiates a write. Write glitches cause whatever logic levels are present at the data inputs to be written into the FIFO, which can put false data into the device. If valid data is present at the data inputs, a write glitch causes this data to be written a second time, resulting in du-plicated data.Write glitches are often the result of voltage reflections due to impedance mismatches, which you can eliminate using im-pedance-matching termination networks. T ermination net-works are recommended on the W and R traces on printed circuit boards (PCBs) when the lines exceed approximately 4 inches from source to a single load. This line length assumes a 2-ns rise/fall time for the read and write strobes. For R and W signals with sub-2-ns rise/fall times, line lengths as short as 1 inch might require termination.A termination network matches the load impedance to the PCB trace’s characteristic impedance, which is typically 50Ωor less for microstrip or stripline construction on G-10 glass epoxy material. T o minimize voltage reflections, a slightly overdamped termination is preferred. Cypress recommends a 47-pF (max.) series capacitor and a 47-ohm resistor be connected from the read or write pin to ground (Figure 8). This termination network acts as a high-pass filter to short, high-frequency pulses and dissipates no DC power. Read or write lines that drive more than one FIFO require only one termination network. Put the network at the input that is elec-trically farthest from the source. For multiple loads, see the “Systems Design Considerations When Using Cypress CMOS Circuits” application note for help in determining the maximum line length.Figure 7. Retransmit TimingFIFO data corruption can also be caused by violation of mas-ter-reset timing constraints. As shown in the timing diagram in Figure 9, the read and write signals must be inactive around the rising edge of MR (master reset) to satisfy the t RMR , or master-reset recovery-time specification. This constraint is necessary because the FIFO goes through an internal initial-ization process during reset and requires a settling period after the reset terminates. FIFO Locks UpShort noise pulses on the FIFO’s master reset pin can cause the FIFO to not respond because it is “partially reset.” If this problem occurs, you need to terminate the master reset line. Missing or Disappearing DataGlitches on the R input can cause data to disappear because of an unintended read operation. The read increments the internal read counter, resulting in the loss of the current data word. Here again, a termination network eliminates the un-wanted glitches.Repetitive or Out-of-Sequence Data, False Full or EmptyA misaligned internal read or write pointer can cause a variety of symptoms, including repetitive or out-of-sequence data and false full and/or empty conditions. The two most common causes of misaligned pointers are master-reset violations and boundary-condition violations.Boundary conditions are defined as the FIFO being either full or empty. When high-density FIFOs are connected in parallel to make a wider word, certain conditions can cause the FIFOs to choose individually to either ignore or act upon a read or write request. The system-level symptom of individual FIFOs making different decisions is word misalignment. The prob-lem occurs in the empty condition when a read immediately follows a write and in the full condition when a write immedi-ately follows a read.Operation at the Empty BoundaryConsider a FIFO that has been reset and is empty. The empty flag is active (LOW), and internal logic inhibits read opera-tions. In the general case, the read and write signals are asyn-chronous. Upon completion of the write operation the internal state of the FIFO goes from empty to empty + 1. During this interval, a read operation might or might not be recognized. A read preceding the write is ignored; a read following the write is not. In between these conditions, the FIFO decides whether to recognize the read. During this aperture of uncertainty, it cannot be determined whether the read will be ignored or not.With one FIFO, this uncertainty is acceptable. However, if two or more FIFOs are connected in parallel to make a wider word, some might ignore the read, and others might not. Operation at the Full BoundaryA similar condition occurs when a single FIFO becomes full.The full flag is active (LOW), and internal logic inhibits write operations. A read operation immediately followed by a write operation causes the FIFO to go from full to full – 1 and back to full. During the time the FIFO is going from full to full – 1, a write operation might or might not be recognized. The aper-ture of uncertainty applies here because the FIFO takes a finite amount of time to change states, and a write command arriving at this instant might be ignored.Figure 8. Recommended Termination Network CYPRESS FIFO LSOURCE47 pF R, W47 OHMSFigure 9. Master Reset TimingWaiting at the Empty BoundaryFigure 10 shows the timing that prevents problems with reads at the empty boundary. Any device reading from the FIFO must wait an amount of time, t RAE , after the termination of the write operation before causing a HIGH-to-LOW transition of the R signal. The W signal’s rising edge indicates the termi-nation of the write operation.One way to satisfy this timing is to gate read operations with the composite empty flag (EF) such that the read operation is prevented when the empty flag is active. Note, however, that the R signal can be LOW either before or during the first write to the empty FIFO and the data still propagates to the outputs correctly.Waiting at the Full BoundaryFigure 11 shows the timing that prevents problems with writes at the full boundary. Any device writing to the FIFO must waitan amount of time, t WAF , after the termination of the read op-eration before causing a HIGH-to-LOW transition of the W signal. The R signal’s rising edge indicates the end of the read operation.You can meet this timing by gating write operations with the composite full flag (FF) such that the write operation is pre-vented when the full flag is active. However, the W signal can be LOW either before or during the first read from a full FIFO and the data is still properly written. Empty Reads and Full WritesWhen Cypress FIFOs are empty, their data outputs go to the high-impedance state. Therefore, attempting to read from an empty FIFO yields unpredictable data. Internal logic inhibits the read, and the read pointer is not incremented. Internal logic also inhibits attempts to write to a full FIFO, and the write pointer is not incremented.Figure 10. Read Fall-Through Timing ViolationDATA OUTt RAE [4]EFWRt WEFVALID DATAFigure 11. Write Bubble-Through Timing ViolationEffective Pulse Width ViolationThis phenomenon can occur at either the empty or the fullboundary if the flags are not properly used. The empty flagmust be used to prevent reading from an empty FIFO and thefull flag must be used to prevent writing into a full FIFO. Oth-erwise, the effective pulse width of the read or the write strobewill be violated, even though the actual signals meet the datasheet specifications.Consider an empty FIFO that is receiving read pulses. Be-cause the FIFO is empty, the read pulses are ignored, andnothing happens. Next, a single word is written into the FIFO,with a signal that is asynchronous to the read pulses, whilethe read pulses continue. The internal state machine in theFIFO goes from empty to empty + 1 shortly after the risingedge of the write pulse. However, it does this asynchronouslywith respect to the read pulse, and it does not look at the readsignal until it enters the empty + 1 state. If the rising edge ofthe write signal occurs slightly before the rising edge of theread signal an effective minimum LOW read pulse width vio-lation will occur.In a similar manner, the minimum write pulse width may beviolated by attempting to write into a full FIFO and asynchro-nously performing a read. The empty and full flags must beused to avoid these effective pulse width violations.Intermittent MalfunctionsIf all the timing requirements appear to be met and data in theFIFO is still corrupted, the cause is likely to be noise on thepower supply. Random spikes on either the V CC or groundpins of the FIFO are likely culprits when non-repeatable fail-ures occur.The cure for this problem is to add a high-pass filter capacitorbetween the device’s power and ground pins. This practice isrecommended whenever the read or write frequency exceeds5 MHz. Use a very small (100–500 pF) ceramic or mica ca-pacitor. Surface-mounted capacitors are recommended be-cause they have at least an order of magnitude less lead in-ductance than radial or axial leaded capacitors.The filter capacitor is in addition to the 0.1- or 0.01-µF decou-pling capacitor that should always be present with anyhigh-speed digital chip. Although decoupling capacitors areoften referred to as bypass capacitors-implying filtering prop-erties-their true function is to supply the instantaneous cur-rent required when many or all device outputs simultaneouslyswitch from LOW to HIGH. This larger capacitor thus decou-ples or isolates the IC from the power distribution system.Notes1.Expansion out of device 1 (XO1) is connected to expansion in ofdevice 2 (XI2).2.t PRT is the minimum retransmit pulse width.3.t RTR is the retransmit recovery time. It is a timing window that mustnot be violated.4.t RAE is an invalid read window. A read operation should never beinitiated inside this window.5.t WAF is an invalid write window. A write operation should never beinitiated inside this window.© Cypress Semiconductor Corporation, 1995. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use。