This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137 N2HET SHFT instruction



Hi,

Is it possible to shift 32 word data using SHFT instruction in N2HET. I see that it can process only 25 bits of data

It will be helpful if i get some sample code.

Thank you.

  • Gobind,

    If you want to do a 32-bit shift, you would need to use the new instructions on N2HET (ADD, etc.)

    This will take multiple cycles which is why I don't think it's a good fit for the very fast manchester decoder on your other post. 

    You might try something like this:   

      a) shift the pin value into the MSB position of the immediate data field w. SHFT.  Copy to register

      b) clear all bits in register except the MSB  (AND)

      c) use and ADD instruction with a Rotate-Right by 31 bit positions (== to rotate left once).  this will result in having the bit you just shifted into the SHIFT instruction placed in the LSB of the ADD instruction's data field.

    like this:

    SH1  SHFT { smode = IRM, cond = <your choice>, pin = <your choice>, reg = A, cond_addr = SH2, next=NXT }

    SH2  AND {src1 = A, src2 = IMM, dest = A, data = 0x1000000, hr_data=0}

    SH3  ADD {src1 = A, src2 = IMM, dest = IMM, data=0, hr_data=0, smode = RR, scount = 31}

    NXT   <...  your next code.  If you are keeping track of how many times you shift you probably need to do that in SH4, SH5, etc. which I'm leaving out >