Assignment 2 Part 2

107 views
Skip to first unread message

Sam

unread,
Oct 6, 2020, 3:53:07 PM10/6/20
to cmpt-295-sfu

Test.png

SFU ID: 301404717
Github username:ahmadsami07
Github: Link to github repo (your assignment repos are private so these links are only accessible to TAs and Instructor):https://github.com/CMPT-295-SFU/assignment-2-ahmadsami07
Line and file: part2.c, line 163
Expected behavior: Should left shift the bits by 10 places, as bits 0:4 of immediate hold value 10
Observed behavior: shifts only by one place instead
Question:I'm not sure about my error here, because the instruction was parsed correctly. But I still am not getting the correct value in the register. All other I-type instructions work fine in my simple solution(addi,andi,ori,lui all give correct reg values), except slli.Would appreciate if I got some directions for this.

Parmida Vahdatnia

unread,
Oct 6, 2020, 5:56:08 PM10/6/20
to cmpt-295-sfu
Is there a reason you chose to mask  instruction.itype.imm directly instead of sign_extending it? I see you have done a few commits after writing this question so if the error is not fixed yet, look into the masking process.

Sam

unread,
Oct 7, 2020, 5:35:21 AM10/7/20
to cmpt-295-sfu
I changed the masking process after sign extending and it worked. Thank you!
Reply all
Reply to author
Forward
0 new messages