They are not instances. It is what you do in software or manually for steps 1-8 in your post #13 to generate matrix 1 and matrix 2.Why do we need 9 instances of CRC_parallel() functions with different input parameters ?
Bot the serial and the parallel implementations produce data that depends both on the previous state (Min = old Mout) and the input data (Nin).why "parallel" CRC requires doing cross-mapping across matrix 1 and matrix 2 ?
Both the serial and the parallel implementations produce data that depends both on the previous state (Min = old Mout) and the input data (Nin).
You have a number of inputs (N + M) to the "unknown" parallel implementation and you can calculate the correct output by executing the serial implementaion N times. By flipping one input bit at a time and observing the correct result (from the serial implementation), you can tell if the flipped input bit should be included in the equation for a particular output bit.but again, this still does not explain how using Min and Nin help to generate the "parallel" CRC equation
By flipping one input bit at a time and observing the correct result (from the serial implementation), you can tell if the flipped input bit should be included in the equation for a particular output bit.
Here is an attempt to explain "why" in small steps:What is the logical reasoning behind such operation ?
In your previous reply just above, you were explaining about the steps for parallel CRC operation, but not explaining why doing such operation resulted in parallel CRC ?
For matrix 2, you flip bits in Min, which is Mout from the previous clock cycle (= the shift register in the serial implementation).However, as for generating matrix 2, I am still confused.
100000000
100101 subtract
=========
001010 (The 5 highest bits are the first row in the matrix)
100101 no subtraction
=========
010100 (The 5 highest bits are the second row in the matrix)
100101 no subtraction
=========
101000 (The 5 highest bits are the third row in the matrix)
100101 subtract
=========
01101 (No more dividend bits, this is the remainder (CRC) for the message "1000" and the fourth row in the matrix)
What you have above is the mathematical way of doing the CRC calculation, not the serial implementation.Code:100000000 100101 subtract ========= 001010 (The 5 highest bits are the first row in the matrix) 100101 no subtraction ========= 010100 (The 5 highest bits are the second row in the matrix) 100101 no subtraction ========= 101000 (The 5 highest bits are the third row in the matrix) 100101 subtract ========= 01101 (No more dividend bits, this is the remainder (CRC) for the message "1000" and the fourth row in the matrix)
Could you show me how to compute matrix 2 from the above serial implementation ?
The XOR operation in the shift register in done when the input bit is different from the highest shift register bit (when Nin[x] XOR Min[4] = '1')
The highest polynomial bit isn't used for XORing the shift register, so "00101" is used.
Input message Nin = "1000", the highest bit Nin[3] is processed first
Initial shift register = "00000" (the shift register is Mout, which is also Min for the next clock cycle)
Nin[3] XOR Min[4] = '1', do shift and XOR with polynomial
new shift register = "00101"
Nin[2] XOR Min[4] = '0', only shift, no XOR
new shift register = "01010"
Nin[1] XOR Min[4] = '0', only shift, no XOR
new shift register = "10100"
Nin[0] XOR Min[4] = '1', do shift and XOR with polynomial
new shift register = "01101" = the CRC = the row in matrix 1 for Nin[3]
To generate a row in matrix 2, we need to have Nin = "0000" and flip a bit in Min, which means starting the calculation with a different initial value in the shift register.
To flip e.g. Min[4], we must start with "10000" in the shift register:
Nin[3] XOR Min[4] = '1', do shift and XOR with polynomial
new shift register = "00101"
Nin[2] XOR Min[4] = '0', only shift, no XOR
new shift register = "01010"
Nin[1] XOR Min[4] = '0', only shift, no XOR
new shift register = "10100"
Nin[0] XOR Min[4] = '1', do shift and XOR with polynomial
new shift register = "01101" = the row in matrix 2 for Min[4]
The XOR operation in the shift register in done when the input bit is different from the highest shift register bit (when Nin[x] XOR Min[4] = '1')
That is not correct. Do you mean the leftmost bit in the intermediate results in the "long division"?Huh ? I thought it should be the opposite : when Nin[x] AND Min[4] == '1'
remember that crc intermediate stages only do XOR operation between input message and polynomial Min whenever the msb of input message Nin is '1'
The polynomial is mathematically applied to M+1 (the polynomial size) input bits.What does it exactly mean by the standard serial CRC implementation subtracts the polynomial from input bits that haven't arrived at the input yet. ?
/=============================================================
// Verilog function that implements serial USB CRC5
//=============================================================
function [4:0] crc5_serial;
input [4:0] crc;
input data;
begin
crc5_serial[0] = crc[4] ^ data;
crc5_serial[1] = crc[0];
crc5_serial[2] = crc[1] ^ crc[4] ^ data;
crc5_serial[3] = crc[2];
crc5_serial[4] = crc[3];
end
endfunction
//============================================================
It is the normal serial implementation.I do not understand the following Verilog function implements the serial USB CRC5
Code:/============================================================= // Verilog function that implements serial USB CRC5 //============================================================= function [4:0] crc5_serial; input [4:0] crc; input data; begin crc5_serial[0] = crc[4] ^ data; crc5_serial[1] = crc[0]; crc5_serial[2] = crc[1] ^ crc[4] ^ data; crc5_serial[3] = crc[2]; crc5_serial[4] = crc[3]; end endfunction //============================================================
The XOR operation (crc[4] ^ data) decides if the polynomial should be "subtracted" or not.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?