How you can implement the Sign Extended Instruction in VHDL (in ALU) for PIC24? I need to implement the following instructions and I don't have any idea how to implement SE.
LOOP:
mov 0x1020, w1 ; INW0=ff7f
mov 0x1022, w2 ; INW1=8001
ior w2, w2, w3 ; N=1
se w1, w1 ; N=0
REP1:
bra n, REP1
add w1, w1, w5
se w5, w6 , N=1
bra n, CONT1
REP2:
bra rep2
CONT1:
mov w6, 0x1024
bra LOOP