Data stream Comparator

N

Niall 84

Guest
Hi all,

I'm doing an assignment and am having trouble with the following part:

I'm looking to compare two separate data streams (hex). I have to
identify and mark the locations when the data in the two streams are
equal. The output should be the block number for those blocks of equal
value.

These are the two data streams:

dataword1 = 128'h0AAF37a000AA23600AA0738000AAAAbe
dataword2 = 128'h0AA237a000AA23600AA0731000AAAAle

This is treated as 8 separate 4-bit words, i.e. 0AAF is a word where
0A is the address and AF is the part to compare with the equivalent in
the second data word.

In the hdl file we have:

module comparator (channel1, channel2, reset_n, clock, op)

input [127:0] channel1, channel2;
input clock, reset_n;
output op;
reg op;

I also have a testbench set up.

Can anyone help me with the comparator module?

Thanks
 
On Nov 21, 8:56 am, Niall 84 <niall_hea...@yahoo.com> wrote:
Hi all,

I'm doing an assignment and am having trouble with the following part:

I'm looking to compare two separate data streams (hex). I have to
identify and mark the locations when the data in the two streams are
equal. The output should be the block number for those blocks of equal
value.

These are the two data streams:

dataword1 = 128'h0AAF37a000AA23600AA0738000AAAAbe
dataword2 = 128'h0AA237a000AA23600AA0731000AAAAle

This is treated as 8 separate 4-bit words, i.e. 0AAF is a word where
0A is the address and AF is the part to compare with the equivalent in
the second data word.

In the hdl file we have:

module comparator (channel1, channel2, reset_n, clock, op)

input [127:0] channel1, channel2;
input clock, reset_n;
output op;
reg op;

I also have a testbench set up.

Can anyone help me with the comparator module?

Thanks
O.K. you've confused me. Did you mean 8 16-bit words? and what
is a "block"? Perhaps if you show the answer you expect from the
two example values, it would be clearer.
 
Its a 32 bit hex word split into 8 segments of 4 if that makes sense
i.e for the 1st word that is 0AAF37a000AA23600AA0738000AAAAbe it would
in effect be dealing with
0AAF | 37a0 | 00AA | 2360 | 0AA0 | 7380 | 00AA |
AAbe and then the 2nd number would be
0AA2 | 37a0 | 00AA | 2360 | 0AA0 | 7310 | 00AA | AAle

However this is where it gets hard to explain.......... the 1st block
of 4 in each number has to be compared, so this is
0AAF and 0AA2, but the 1st 2 bits (0A) is the address, so basically
its comparing AF and A2 from the address block 0A........

Hope that makes a little more sense.

Niall.
 

Welcome to EDABoard.com

Sponsor

Back
Top