FIFO Input detection

Dear all.

i am looking for sample code with arduino mega/ Arduino Due. I have 8 digital input and 8 digital output. I have connected 8 LED at output end

i am looking for sample code where i wanted to replicate FIFO fault.

When First input given flash rate of first fault must be 100%

When 2nd fault given

latest fault will be 100%
previous fault will be 75%

when 3rd fault occurs

latest fault will be 100%
previous fault will be 75%
previous fault1 will be 50%

when 4th fault occurs

latest fault will be 100%
previous fault will be 75%
previous fault1 will be 50%
last fault will be Steady

It should detect atleast 3 level of fault and later on it should became study.

AJITnayak:
latest fault will be 100%
previous fault will be 75%
previous fault1 will be 50%
last fault will be Steady

What does the LED do differently for latest fault will be 100% vs. last fault will be Steady?

And maybe describe by what you mean by a fault in this context.
Is is an attempt to read an item in the FIFO when nothing is present or to put an item into the FIFO which would cause an overflow ?

Are the 8 leds used to indicate a fault condition and the degree (%) of the fault ?