Free Essay

Fedral Reserve

In: Business and Management

Submitted By ayush1189
Words 2636
Pages 11
DESIGNING SYNCHRONOUS FIFO AND ITS VERILOG IMPLEMENTATION IN HARDWARES

Submitted in partial fulfillment for the requirement for the award of degree of bachelor of technology in Electronics and Telecommunication Engineering

[pic]

School of Electronics Engineering
KIIT UNIVERSITY

Batch: 2008-2012, Group-8
Under the guidance of
Mr. S.Padhi

An End-Semester Project Report
Submitted by:

Akshay Prakash-804008
Avinash Kumar-804029
Ayush Bansal-804031
Barun Kumar-804034
Deepak Kumar Barnwal-804044

KIIT UNIVERSITY, BHUBANESWAR

[pic]
CERTIFICATE

This certificate is to certify that this report entitled “AUTOMATIC VEHICLE PASS USING IMAGE PROCESSING” being submitted by Group-34:

Akshay Prakash-804008
Avinash Kumar-804029
Ayush Bansal-804031
Barun Kumar-804034
Deepak Kumar Barnwal-804044

in partial fulfillment of the degree of Bachelor in Technology in “Electronics and Telecommunication engineering” is a bonafide work carried out at KIIT University under the supervision of project guide
Prof. S.Padhi

Prof A. K. Sen Mr. S.Padhi Dean
E&TC Deptt. E&TC Deptt.
KIIT University KIIT University

TABLE OF CONTENTS:

• ACRONYMS ………………………………………………………...3 • ACKNOWLEDGEMENT …………………………………………...4 • HISTORY ……………………………………………………………5 • ABSTRACT ………………………………………………………….6 • INTRODUCTION …………………………………………………...7 • BLACK-BOX VIEW OF SYNCHRONOUS FIFO ……….…….…10 • PORT LIST ……………………………………………..………......10 • FUNCTIONAL DESCRIPTION …………...………………………12 • VERIFICATION OF THE MODULE ………..…………………….22 • SYNTHESIS OF THE MODULE ...………………………………..27 • CONCLUSION ……………………………………………………..32 • APPENDIX …..……………………………………………………..33 o A1: RTL DESCRIPTION OF SYNCHRONOUS FIFO USING VERILOG HDL …………………...…………………………...33 o A2: VERILOG TESTBENCH …………...………………………42

ACRONYMS:

• EDA : Electronic Design Automation • FIFO : First In First Out • CAD : Computer Aided Design • CAE : Computer Aided Engineering • IC’s : Integrated Circuits • RTL : Register Transistor Level • TB : Testbench • HDL : Hardware Description Language • MSB : Most Significant Bit • RAM : Random Access Memory • WCLK : Write Clock • RCLK : Read Clock • LFSR : Linear Feedback Shift Registers • VHDL : Very High Speed Integrated Circuit Hardware Description Language

ABSTRACT

FIFO is a First-In-First-Out memory queue with control logic that manages the read and write operations, generates status flags, and provides optional handshake signals for interfacing with the user logic. It is often used to control the flow of data between source and destination. FIFO can be classified as synchronous or asynchronous depending on whether same clock or different (asynchronous) clocks control the read and write operations. In this project the objective is to design, verify and synthesize a synchronous FIFO using binary coded read and write pointers to address the memory array. FFIO full and empty flags are generated and passed on to source and destination logics, respectively, to pre-empt any overflow or underflow of data. In this way data integrity between source and destination is maintained.
The RTL description for the FIFO is written using Verilog HDL.

INTRODUCTION

WHAT IS A FIFO (first in first out)?
In computer programming, FIFO (first-in, first-out) is an approach to handling program work requests from queues or stacks so that the oldest request is handled first. In hardware it is either an array of flops or Read/Write memory that store data given from one clock domain and on request supplies with the same data to other clock domain following the first in first out logic. The clock domain that supplies data to FIFO is often referred as WRITE OR INPUT LOGIC and the clock domain that reads data from the FIFO is often referred as READ OR OUTPUT LOGIC. FIFOs are used in designs to safely pass multi-bit data words from one clock domain to another or to control the flow of data between source and destination side sitting in the same clock domain. If read and write clock domains are governed by same clock signal the FIFO is said to be SYNCHRONOUS and if read and write clock domains are governed by different (asynchronous) clock signals FIFO is said to be ASYNCHRONOUS.

FIFO full and FIFO empty flags are of great concern as no data should be written in full condition and no data should be read in empty condition, as it can lead to loss of data or generation of non relevant data. The full and empty conditions of FIFO are controlled using binary pointers.
[pic]
Figure 1: Data Flow through FIFO

SYNCHRONOUS FIFO
A synchronous FIFO refers to a FIFO design where data values are written sequentially into a memory array using a clock signal, and the data values are sequentially read out from the memory array using the same clock signal.

In synchronous FIFO the generation of empty and full flags is straight forward as there is no clock domain crossing involved. Considering this fact user can even generate programmable partial empty and partial full flags which are needed in many applications.

APPLICATIONS • FIFO’s are used to safely pass data between two asynchronous clock domains. In System-on-Chip designs there are components which often run on different clocks. So, to pass data from one such component to another we need ASYNCHRONOUS FIFO

• Some times even if the Source and Requestor sides are controlled by same clock signal a FIFO is needed. This is to match the throughputs of the Source and the Requestor. For example in one case source may be supplying data at rate which the requestor can not handle or in other case requestor may be placing requests for data at a rate at which source can not supply. So, to bridge this gap between source and requestor capacities to supply and consume data a SYNCHRONOUS FIFO is used which acts as an elastic buffer.

BLACK BOX VIEW OF SYNCHRONOUS FIFO
[pic]
Figure 1: Black-box view of a Synchronous FIFO

PORT LIST

COMMON PORTS

|Name |I/O |Width |Description |
|clk |I |1 |Clock input to the FIFO. This is common input to both read and write |
| | | |sides of FIFO |
|reset_n |I |1 |Active-low asynchronous reset input to FIFO read and write logics |
|flush |I |1 |Active-high synchronous flush input to FIFO. A clock-wide pulse resets |
| | | |the FIFO read and write pointers |

WRITE SIDE PORTS

|Name |I/O |Width |Description |
|write_data |I |8 |8-bit data input to FIFO |
|wdata_valid |I |1 |Qualifies the write data. Logic high indicates the data on write_data bus|
| | | |is valid and need to be sampled at next rising edge of the clock. |
|fifo_full |O |1 |Indicates to the source that FIFO’s internal memory has no space left to |
| | | |take in new data |
|fifo_afull |O |1 |Indicates to the source that FIFO’s internal memory has only few spaces |
| | | |left for new data. Upon seeing this source may decide to slow down or |
| | | |stall the write operation |
|write_ack |O |1 |Write acknowledgement to source. |

READ SIDE PORTS

|Name |I/O |Width |Description |
|read_req |I |1 |Data read request to FIFO from the requestor |
|read_data |O |8 |Read data in response to a read request. Data is valid in the next cycle |
| | | |of read_req provided FIFO is not empty |
|rdata_valid |O |1 |Qualifies read data out. A logic high indicates the data on read_data bus|
| | | |is valid and need to be sampled at the next rising edge of the clock |
|fifo_empty |O |1 |Indicates to the requestor that FIFO’s internal memory is empty and |
| | | |therefore has no data to serve upon the read request |
|fifo_aempty |O |1 |Indicates to the requestor that FIFO’s internal memory is almost empty |
| | | |and therefore has only few data left to serve upon the future read |
| | | |requests. Upon seeing this requestor may decide to slow down or stall the|
| | | |read operation. |

FUNCTIONAL DESCRIPTION
Figure 2 depicts the basic building blocks of a synchronous FIFO which are: memory array, write control logic and read control logic. The memory array can be implemented either with array of flip-flops or with a dual-port read/write memory. Both of these implementations allow simultaneous read and write accesses. This simultaneous access gives the FIFO its inherent synchronization property. There are no restrictions regarding timing between accesses of the two ports. This means simply, that while one port is writing to the memory at one rate, the other port can be reading at another rate totally independent of one another. The only restriction placed is that the simultaneous read and write access should not be from/to the same memory location.

The Synchronous FIFO has a single clock port clk for both data-read and data-write operations. Data presented at the module's data-input port write_data is written into the next available empty memory location on a rising clock edge when the write-enable input write_enable is high. The full status output fifo_full indicates that no more empty locations remain in the module's internal memory. Data can be read out of the FIFO via the module's data-output port read_data in the order in which it was written by asserting read-enable signal read_enable prior to a rising clock edge. The memory-empty status output fifo_empty indicates that no more data resides in the module's internal memory. There are almost empty and almost full flags too viz. fifo_aempty and fifo_afull which can be used to control the read and write speeds of the requestor and the source.
[pic]
Figure 2: Block Diagram of a Synchronous FIFO

WRITE CONTROL LOGIC
Write Control Logic is used to control the write operation of the FIFO’s internal memory. It generates binary-coded write pointer which points to the memory location where the incoming data is to be written. Write pointer is incremented by one after every successful write operation. Additionally it generates FIFO full and almost full flags which in turn are used to prevent any data loss. For example if a write request comes when FIFO is full then Write Control Logic stalls the write into the memory till the time fifo_full flag gets de-asserted. It intimates the stalling of write to source by not sending any acknowledgement in response to the write request. Figure 3 below shows the black-box view of Write Control Logic
[pic]
Figure 3: Write Control Logic Black-box View

PORT LIST
|Name |I/O |Width |Description |
|clk |I |1 |Clock input |
|reset_n |I |1 |Active-low reset input |
|flush |I |1 |Active-high synchronous flush input to FIFO. A clock-wide pulse resets |
| | | |the FIFO read and write pointers |
|wdata_valid |I |1 |Qualifies write data in. A logic high indicates the data on write_data |
| | | |bus is valid |
|rd_ptr |I |5 |Read pointer from Read Control Logic. This along with write pointer is |
| | | |used to find FIFO full and almost full condition |
|write_enable |O |1 |Write enable to FIFO’s internal memory |
|write_ptr |O |5 |Write pointer value. This serves as a write address to FIFO’s internal |
| | | |memory |
|write_ack |O |1 |Acknowledgement to source that write operation is done. |
|fifo_full |O |1 |Indicates to the source that FIFO’s internal memory has no space left to |
| | | |take in new data |
|fifo_afull |O |1 |Indicates to the source that FIFO’s internal memory has only few spaces |
| | | |left for new data. Upon seeing this source may decide to slow down or |
| | | |stall the write operation |

READ CONTROL LOGIC
Read Control Logic is used to control the read operation of the FIFO’s internal memory. It generates binary-coded read pointer which points to the memory location from where the data is to be read. Read pointer is incremented by one after every successful read operation. Additionally it generates FIFO empty and almost empty flags which in turn are used to prevent any spurious data read. For example if a read request comes when FIFO is empty then Read Control Logic stalls the read from the memory till the time fifo_empty flag gets de-asserted. It intimates the stalling of read to the requestor by not asserting rdata_valid in response to the read request. Figure 5 below shows the black-box view of Read Control Logic
[pic]
Figure 5: Read Control Logic Black-box View

PORT LIST
|Name |I/O |Width |Description |
|clk |I |1 |Clock input |
|reset_n |I |1 |Active-low reset input |
|flush |I |1 |Active-high synchronous flush input to FIFO. A clock-wide pulse resets |
| | | |the FIFO read and write pointers |
|read_req |I |1 |Read request from the requestor. |
|write_ptr |I |5 |Write pointer from Write Control Logic. This along with read pointer is |
| | | |used to find FIFO empty and almost empty conditions |
|read_enable |O |1 |Read enable to FIFO’s internal memory |
|read_ptr |O |5 |Read pointer value. This serves as a read address to FIFO internal memory|
|rdata_valid |O |1 |Acknowledgement to source that write operation is done. |
|fifo_empty |O |1 |Indicates to the source that FIFO’s internal memory has no space left to |
| | | |take in new data |
|fifo_aempty |O |1 |Indicates to the source that FIFO’s internal memory has only few spaces |
| | | |left for new data. Upon seeing this source may decide to slow down or |
| | | |stall the write operation |

MEMORY ARRAY
Memory Array is an array of flip-flops which stores data. Number of data words that the memory array can store is often referred as DEPTH of the FIFO. Length of the data word is referred as WIDTH of the FIFO. Besides flop-array it comprises read and write address decoding logic.

The functionality of Memory Array is relatively straight forward as described below:

1. If write_enable signal is high DATA present on write_data is written into the row pointed by write_addr on the next rising edge of the clock signal clk. Note that write_enable is asserted only when wdata_valid is high and FIFO is not full to avoid any data corruption 2. If read_enable signal is high the DATA present in the row pointed by read_addr is sent onto the read_data bus on the next rising edge of the clock signal clk. Note that read_enable is asserted only when read_req is high and FIFO is not empty to avoid any spurious data being sent to the requestor 3. It can handle simultaneous read and write enables as long as their addresses do not match

Figure 6 below shows the black-box view of Memory Array.

[pic]

Figure 6: Memory Array Black-box View

PORT LIST
|Name |I/O |Width |Description |
|clk |I |1 |Clock input |
|write_addr |I |4 |Write address to the memory. It is derived from write pointer by |
| | | |knocking-off its MSB |
|write_enable |I |1 |Active-high write enable input to the memory |
|write_data |I |8 |Data Input to the memory |
|read_addr |I |4 |Read address to the memory. It is derived from read pointer by |
| | | |knocking-off its MSB |
|read_enable |I |1 |Active-high read enable to memory |
|read_data |O |8 |Data read out from the memory |

FULL & EMPTY FLAG GENERATION
FIFO full and almost full flags are generated by Write Control Logic whereas empty and almost empty flags are generated by Read Control Logic. FIFO almost full and almost empty flags are generated to intimate the source and the requestor about impending full or empty conditions. The almost full and almost empty levels are parameterized.

It is important to note that read and write pointers point to the same memory location at both full and empty conditions. Therefore, in order to differentiate between the two one extra bit is added to read and write pointers. For example if a FIFO has depth of 256 then to span it completely 8-bits will be needed. Therefore with one extra bit read and write pointers will be of 9-bits. When their lower 8-bits point to same memory location their MSBs are used to ascertain whether it is a full condition or empty condition. In empty conditions the MSBs are equal whereas in full condition MSBs are different. The verilog code shown below depicts the same: assign fifo_full = ( (write_ptr[7 : 0] == read_addr[7 : 0]) && (write_ptr[8] ^ read_ptr[8]) );

assign fifo_empty = (read_ptr[8 : 0] == write_ptr[8 : 0]);

Following piece of verilog code shows logic almost full generation: // Generating fifo almost full status always @* begin if ( write_ptr[8] == read_ptr[8] ) fifo_afull = ((write_ptr[7:0] - read_ptr[7:0]) >= (DEPTH - AFULL)); else fifo_afull = ((read_ptr[8:0] - write_ptr[8:0])

Similar Documents

Premium Essay

Fedral Reserve

...the Federal Reserve System. This is known as the central banking system of the United States of America. The Federal Reserve was first established on December 23, 1913. It was enacted by the Federal Reserve Act. This is an act to provide for the establishment of Federal Reserve banks. Mostly it was to furnish an elastic currency, to afford means of rediscounting commercial paper, to establish a more effective supervision of banking in the United States of America, and also for other purposes. Over the years different responsibilities and roles have occurred within the Federal Reserve. It did not just consist of the same functions but over time it changed and changed for the good of the country. The major factor that has contributed to most of the change within the Federal Reserve is the Great Depression. The Great Depression was known as a severe worldwide economic depression. There was a high unemployment rate, poverty, deflation, plunging from incomes, and many more consequences. These components sent the United States into a deep state of unstableness. The Federal Reserve System is made up of several different components. These components consist of appointed Board of Governors, the Federal Open Market Committee, and twelve regional Federal Reserve Banks, which are located in major cities throughout the nation, numerous privately owned U.S. member banks and various advisory councils. There are seven members that make up the Board of Governors in the Federal Reserve System.......

Words: 1840 - Pages: 8

Premium Essay

Banking Theory, Law and Practices

...system of India. Exchange banks were essentially meant for financing the foreign trade of the country, but they also conducted banking activity in competition with Indian banks. The exchange banks are termed “foreign banks”, because they were financed and managed by non-Indians. Bank Crisis Till about the middle of the twentieth century, Indian joint-stock banks had a checkered career in the country. The banking sector experience severe set-backs during the priod-1913-17, as 108 banks failed and another 373 banks failed on 1922-36 which was again followed by the failure of 620 more banks in 1937-38. The Central Banking Enquiry Committee (1929) traced the following major causes of bank failure in India: (1) Insufficient paid-up capital and reserves; (2) Poor liquidity of assets; (3) Combination of non-banking activities with banking. (4) Irrational credit policy causing reckless and injudicious advances; (5) Favouritism by the directors the their vested interests; (6) Incompetent and inexperienced directors; (7) Mismanagement; (8) Dishonest management; (9) Creation of long-term loans on the basis of short-term deposits; (10) Indulgence in speculative investment; (11) Ignorgance of the people about banking business; (12) Lack of co-ordinate among joint-stock banks; (13) Absence of a central bank for overall supervision and control; (14) Lack of suitable banking legislation for regulation of banks. And above all, the shattered public confidence in banks may be accounted for......

Words: 105282 - Pages: 422