Shop Learn P1 Docs P2 Docs
SHL docu correct? — Parallax Forums

SHL docu correct?

Christof Eb.Christof Eb. Posts: 689
edited 2022-09-15 10:28 in PASM2/Spin2 (P2)

In https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/edit#gid=0

For SHL (and others similar) it is said:
Shift left. D = [63:32] of ({D[31:0], 32'b0} << S[4:0]). C = last bit shifted out if S[4:0] > 0, else D[31].

So this would hold only the upper long???
How do I get the lower long result?

Comments

  • ersmithersmith Posts: 5,433

    @"Christof Eb." said:
    In https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/edit#gid=0

    For SHL (and others similar) it is said:
    Shift left. D = [63:32] of ({D[31:0], 32'b0} << S[4:0]). C = last bit shifted out if S[4:0] > 0, else D[31].

    So this would hold only the upper long???
    How do I get the lower long result?

    Note that the input in that description is padded on the right with 32 bits, so in fact you are getting the lower long. It's an awkward way of decribing that the new bits in the output are 0.

  • Thank you, Eric! That was too cryptic for me then. ...And I have to find a different bug then in my code.....

Sign In or Register to comment.