Gray code in asynchronous FIFO design

Why do we use Gray code in asynchronous FIFO? (I am aware that only ONE bit changes in Gray code at a time, but what is the advantage of that?)

Reply to
anand
Loading thread data ...

This sounds suspiciously like a homework problem, but I'll give you a clue. Suppose you wanted to sample the write address pointer using the read clock? What would happen if the address were changing just as you sampled it?

Reply to
Gabor

Well the setup time would not be met, therefore, metastability will occur? No, this is not a HW problem, rather, I am trying to prepare for an interview ;-)

Reply to
anand

I almost think it's unfair to give you information if the new comany wants you for your knowledge and ability. But perhaps the ability to ask the professionals in a newsgroup is underrated.

Keep in mind that propagation delays aren't the same for all sources and all destinations. When you sample the write address from the read domain, there will be an area of uncertainty where the bits are transitioning between the previous and next values. The metastability windows in modern devices are extremely slow; I think Peter Alfke's numbers from one of the most recent high-end families was sub-femtosecond. Darn, that's small! So Metastability isn't an issue, the uncertainty region between values is the issue. If you're only uncertain about one bit, it doesn't matter if you have the previous or next value - both are valid for your "on the edge" calculation. What isn't valid is getting a pointer that's off by 2, 4, or 8 from either of the two valid values you're trying to sample.

Now, do you know how to properly pipeline? How about state machines: can you design a soda dispenser state machine to count change? And how many gas stations would you estimate are in the US (please explain your reasoning)? If you had a belt tight around the equator of the earth, how much length do you figure you'd need to add to raise the belt to an altitude of 1 foot across the entire distance and why?

Good luck with your interviewing.

Reply to
John_H

Quick typo clarification. I meant small, not slow.

"The metastability windows in modern devices are extremely small; I think Peter Alfke's numbers from one of the most recent high-end families was sub-femtosecond."

I hate it when that happens.

Reply to
John_H

hi thanks for your response(s).

"I almost think it's unfair to give you information if the new comany wants you for your knowledge and ability. But perhaps the ability to ask the professionals in a newsgroup is underrated"

Well I would disagree with the above. Reason is, it is not that I CANNOT design - I DO have a design background and have done a lot of it in my last role (barring the async fifo that is!) . It is just that the last few years I happen to be doing something else, and all I am doing is brushing up. And for doing so, anyone will certainly use ANY and ALL resources including groups at their disposal, isnt that logical? Unless you use something on a daily basis, I dont think it is realistic to show up at a tech company and be serious about landing an offer.

Anyways, you have answered my question and that is what counts Hopefully, my "read_ptr" is not even off by 1 bit :-) Thanks!!!

Reply to
anand

your

This is interesting. I dont know the answer, but the reasoning can be tagged to the distribution of gas station /sq mile or per population density.

The earth's equatorial radius is 3,963.189mi, so elevate the radius by

1 ft, from the top view, it would be like drawing an outer circle with a 1 ft border. From this we can calculate the new radius and hence the addition in the radius gives us the new circumference and thus the addition in length.....what do u think...am I way off???
Reply to
morpheus

You don't need the earth radius.

Let's says the original radius is r and expressed in feet, the original belt would be 2*pi*r . By adding 1 feet, you now have a belt of 2*pi*(r+1). So you added 2*pi feet to it no matter what.

Sylvain

Reply to
Sylvain Munaut

Yeah I knw....I have a habit of thinking out loud....atleast I wasnt way off Any idea on the estimation on the number of gas pumps in the US?

Reply to
morpheus

Hi John, I used to drive my buddy Kurt insane with these questions. The secret is to ask him about two pints into a Friday night Guinness session. After four pints he'll let you tell him the answer. The next few pints erase his memory so you can do it all over again a couple of weeks later. Eventually he bought himself a notebook! For example, a brother and sister were born on the same day a few minutes apart. But they're not twins. How? Cheers, Syms.

Reply to
Symon

It's not about the answer, it's about the process. Can you demonstrate how to come up with a credible engineering estimate with sparse real data (your own experience)? If you rely on precise data as a crutch (diameter of the earth to 7 decimal places) you may not find a place as a "superb" engineer, but still quite passable.

Reply to
John_H

Assuming the same day of the same year,

1) At least one is adopted. 2) They're in a monastery (and not related). 3) At least one is born to a surrogate mother.

A man marries his daughter. Legally. How?

A (biological) father and son are in a car accident, both rushed to the hospital. The unconscious son is wheeled into the operating room for emergency surgery. At first glance, the doctor turns pale and declares "we need another surgeon to perform this operation; that's my own (biological) son!" How can this be? [I added the "biological" notes to try to avoid some of the arguments related to your question.]

Reply to
John_H

I must be missing something. The surgeon is the kid's mother?!

Reply to
Pete Fraser

Good effort, but no. They're biological brother and sister, no fancy IVF nonsense involved, same mother and father. No relativistic effects either! IIRC Kurt was similarly very inventive too... :-)

I've heard these, and, rest assured, so has Kurt! :-)

Cheers, Syms.

Reply to
Symon

Bingo. This addresses bad assumptions and was easier to trip people up a decade or two ago.

Reply to
John_H

Given that the definition of twins is that they're born from the same pregnancy, I see two options :

- They are only half brother and sister : Same father, different mother and they just happened to give birth at the same time. - They are from the same mother but different pregnancy ... some women have two uteruses, one baby in each could be viewed as different pregnency and even with slightly different conception date, they could come to term at the same time (one of them induced for convenience for example ...).

Couldn't the man have a daughter when he was young and either abandon her, or give her for adoption, then ... twenty years later decides to find him self a young wife and by "chance" choose his own daughter without knowing it ...

Sylvain

Reply to
Sylvain Munaut

Symon a écrit :

Hasn't this something to do with a boat crossing the date change line ? I seem to recall something like that ...

Nicolas

Reply to
Nicolas Matringe

Hi Nicolas, I like your thinking, but that only gives you a day maximum. Hard to conceive and gestate a baby in 24 hours, I think?! :-) Anyway, it's much simpler than that. There's another sibling. So, not twins. Triplets! Sometimes it's safer to post this online than IRL!! Cheers, Syms. p.s. The guy who married his own daughter? He's a vicar! Happy Easter all!

Reply to
Symon

tes

I

ns.

Triplets (or more) is a solution, but an even more common one is that they are simply born from different mothers who have previously had another child. The statement was just that "a brother and sister were born..." there is nothing saying that the 'brother' is the brother of the 'sister' that was born (and vice versa), just that they are a 'brother' and a 'sister'.

This situation happens every day in every maternity ward in every major hospital (i.e. one with more than a couple mothers in labor on a given day), whereas the multiple births are not nearly as common.

KJ

Reply to
KJ

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.