Samsung S5PC100 User Manual page 348

Table of Contents

Advertisement

ASYNC BRIDGE
T1
Data is written into the FIFO.
T2
The write pointer update occurs.
T3
The first synchronization stage of this value to the read side occurs because enough time has elapsed
since the write pointer updated.
T4
The second synchronization stage occurs and enables synchronized pointer visible to the read side.
T5
The read side asserts its valid signal because it has compared the read and synchronized write pointers
and they are different.
T6
The data is read.
T7
The read pointer update occurs. The old or new value being captured is unpredictable because this
value is changing on the ACLKS edge, when the synchronizer is sampling. In this case the old value is
captured.
T8
The read pointer starts synchronizing to the write side.
T9
Synchronization is complete.
After T9 The read side can again indicate that it is ready to accept data.
1.3.2 Gray Code
The Gray code used for an N-entry FIFO has 2N values in its sequence, and the order of the values is chosen so
that each value, when XORed with the value N places away from it, gives the same result and does not give that
result when XORed with any other value in the sequence. This enables the fullness and emptiness to be
determined by comparing the two counters:
Emptiness is shown by the read and write counters being the same.
Fullness is shown by the result of XORing the read and write counters being the first value in the second half
of the sequence, at position N.
The required Gray code can be calculated by an algorithm:
The number of bits required in the Gray code, k, can be calculated as:
k = ceil(log2(N)) +1
Where ceil represents a function that rounds its argument up to the nearest integer.
The first N values, positions 0 to N-1 in the sequence, are derived from the binary value of their position in the
sequence: Bits of the binary value B[k-1:0] is mapped to the bits of Gray coded value G[k-1:0] using the
following rules:
G[k-1] = B[k-1] (== 0)
G[i] = B[i] XOR B[i+1]
where 0<=i<k-1
3.4-6
S5PC100 USER'S MANUAL (REV1.0)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents