Clock Domain Crossing Part 6
Clock Domain Crossing Part 6
Crossing
Part 6 – CDC FIFO
/amradelm
Save The Palestinian Children
“Might be ‘justified and
“Children in Gaza over 4 moral’ to cause 2 million
deserve to be starved” Gazans to die of hunger,
but world won’t let us”
“There will be no
“Executing The Palestinian electricity, no food, no
prisoner ‘right solution to fuel, everything is closed,
overcrowding’” We are fighting human
animals”
CDC FIFO
5-Deep FIFO
// Assigning the MSB directly as it remains the same // Internal wire to store intermediate results
assign gray_out[N-1] = binary_in[N-1]; wire [N-1:0] binary_temp;
// Loop to calculate the Gray code output from binary // Assigning the MSB directly as it remains the same
genvar i; assign binary_temp[N-1] = gray_in[N-1];
generate
for (i = N-2; i >= 0; i = i - 1) begin : bin_to_gray // Loop to calculate the binary output from Gray code
assign gray_out[i] = binary_in[i+1] ^ binary_in[i]; genvar i;
end generate
endgenerate for (i = N-2; i >= 0; i = i - 1) begin : gray_to_bin
assign binary_temp[i] = binary_temp[i+1] ^
endmodule gray_in[i];
end
endgenerate
endmodule
Binary to Gray Gray to Binary
0 0
0 0
Full
Flag?
Domain 1 Domain 2
Write Read
Pointer Pointer
domain 1 wrote
an entry 1 0
0 0
0 1 Domain 2 read
an entry
1 3 Domain 2 read
another 2 entries
Domain 1 wrote a
new entry.
𝑓𝑟𝑒𝑎𝑑
𝐷𝑒𝑝𝑡ℎ = 𝐵𝑢𝑟𝑠𝑡 × 1 −
𝑓𝑤𝑟𝑖𝑡𝑒
• Let 𝒇𝒘𝒓𝒊𝒕𝒆 = 𝟒𝟎𝟎 𝑴𝑯𝒛, 𝒇𝒓𝒆𝒂𝒅 = 𝟏𝟓𝟎 𝑴𝑯𝒛. Burst size = 120. There is 1 idle cycle between consecutive writes.
• The idle cycle will slow down the writing operation giving the read operation more time to read. We should expect the required size to decrease
• With the idle cycle, the write domain takes 2 cycles for each write instead of 1. Effectively the frequency is halved.
𝑓𝑟𝑒𝑎𝑑 150
• 𝐷𝑒𝑝𝑡ℎ = 𝐵𝑢𝑟𝑠𝑡 1 − 𝑓 = 120 1 − 400/2 = 30 location.
𝑤𝑟𝑖𝑡𝑒 /𝟐
https://shorturl.at/qBrGl