46. Protected 2-Entry Circular FIFO

Loading simulator…

The supplied datapath already contains the two 2-bit storage slots, hold/load MUXes, read MUXes, Clock/Reset wiring, and fixed feedback paths. The missing connections complete the FIFO control.

The control DFFs store:

D_FF_4 = WP
D_FF_5 = RP
D_FF_6 = C0
D_FF_7 = C1

1. Accepted Write and Read

Complete:

W_SINGLE out0 → WRITE_ACCEPT in0
R_SINGLE out0 → READ_ACCEPT in1

The supplied request MUXes generate:

W_SINGLE = Write_Request · Read_Request'
R_SINGLE = Read_Request · Write_Request'

WRITE_ACCEPT is already selected by Full, so:

W = W_SINGLE · Full'

READ_ACCEPT is already selected by OCC_NONZERO, where OCC_NONZERO = Empty', so:

R = R_SINGLE · Empty'

Writes are therefore blocked at Full, reads are blocked at Empty, and asserting both requests causes no operation.

2. Pointer Updates

Connect the accepted write to WP_TOGGLE:

WP_next = WP ⊕ W

Connect the accepted read to RP_TOGGLE:

RP_next = RP ⊕ R

Because the FIFO contains two slots, each one-bit pointer naturally wraps between 0 and 1.

3. Occupancy Update

Connect W and R to TRANSFER:

Transfer = W + R

Then complete the low occupancy bit:

C0_next = C0 ⊕ Transfer

For the high occupancy bit, complete:

C1 → C1_KEEP in0
R  → C1_KEEP select

C0 → C0_AND_W
W  → C0_AND_W

The supplied OR gate then produces:

C1_next = (C1 · R') + (C0 · W)

The legal occupancy states are:

C1:C0 = 00 → Empty
C1:C0 = 01 → One stored word
C1:C0 = 10 → Full

4. Full and Empty

Connect:

C1 → Full
C0 → OCC_NONZERO
C1 → OCC_NONZERO

The supplied final XOR uses CONST_1 to invert the occupancy-nonzero signal:

Empty = (C1 + C0)'

Therefore:

00 → Empty=1, Full=0
01 → Empty=0, Full=0
10 → Empty=0, Full=1

5. Supplied Datapath and Reset

The supplied write MUXes use WP to select Slot 0 or Slot 1, and the supplied read MUXes use RP to place the current front word on Data_Out1:Data_Out0.

nReset=0 asynchronously clears WP, RP, C0, and C1. The payload DFFs are intentionally not reset and are ignored while Empty=1.