Fastest way to compare two shiftregisters

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi,

   

I need to compare two shiftregisters (each 32bit, one containing a ref value and one a cycling sequence) as fast as possible. Is there an alternative to dma the registers and interrupt the cpu and then XOR the values in the isr? I need cpu time for other tasks.

   

 

   

Thanks!

   

Franz

0 Likes
5 Replies
Anonymous
Not applicable

 I think it can be done with customized datapath, but I never done that. May be we need some help from Cypress Application support here. 🙂

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think you can do it in hardware. You can either use 16 LUTs, each configured as 2bit-comparer, or 4 8bit-XORs switched together. But it will consume a lot of UDBs. The best way would really a custom datapath. You should read the tutorials on that - I think a simple comparision is not that difficult (the example creates a counter).

0 Likes
Anonymous
Not applicable

As many have told the best way to go about it is to develop your own custom logic. Fpr this you can use the datapath tool provided with PSoC Creator and synthesize the logic. There are some good tutorials here, 

   

http://www.cypress.com/?rID=48413

   

http://www.cypress.com/?id=2232&rtID=134

   

http://www.cypress.com/?rID=40360

0 Likes
Anonymous
Not applicable

 But how to access the parallel output of the shiftregister in HW? Or should I route do[7:0] from each datapath in the shiftregister component?

   

 

   

Thanks.

0 Likes
Anonymous
Not applicable

To compare two values, the "Conditions" in the datapath can be used for comparison.

   

The comparison can occur between Data Register (D0) and Accumulator Register (A0).

   

 

   

This has been utilized in the UDB based components such as PWM and Timers.

0 Likes