[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ethmac] gray code
Hi,
Gray format mean that there is only one
bit change at a time this mean that you can do a comparision without the need to
do complex synconization of moving the pointer from one domain to
another.
you
can do for example something like :
always
@(posedge rclk)
wadd_gray_s <= #1 wadd_gray;
always
@(posedge rclk or negedge rstn)
if (~rstn)
ordy <= #1 0;
else
ordy <= #1 ~((wadd_gray_s==radd_gray) ||
(re && (wadd_gray_s==radd_gray_next)) );
where
wadd_gray come from wclk domain.
as
compare to much more complicated such as store and hold you will need to do
in binary.
but
even when using Gray it is usualy used only for the flags while there is another
set of counter used as the index for the read/write and those are binary,
therefore also you will see many time gray is used only for small fifo's as the
"overhead" logic for "full syncroniztion" become smaller when you need to have
large counter for binary as well as for gray.
Another "advantage" for gray as compare to the full syncornization is
that syncronization methode always use pesemstic approch which mean let say you
have fifo with 8 word it might show full even few clocks after the full level is
no more full or it might show empty for few clocks before it show not empty.
however in Gray the delay is not exsisting or can be 1 clock
delay.
have a
nice day
Illan
Hai,
why people prefer to store data in fifo as gray
format instead of binary format. Is it for speed improvent or any specific
reasons.
Thanks in advance.
Regards
Madhu
Do you Yahoo!?
HotJobs
- Search new jobs daily now