Ok. SO I want to rotate a 16 bit number. it\'s 0000111100001111. Thing is, the p
ID: 3652589 • Letter: O
Question
Ok. SO I want to rotate a 16 bit number. it's 0000111100001111.Thing is, the program of an lc-3 is that you DON'T HAVE opcodes like rotation. i basically only have
add/not/and and that's it. no rotation to do it automatically for me.
Now a hint was given that if I add it to itself it shifts to the left. all the bits. so if i shift once, it would be 0001111000011110. If i shift 2nd time, it'll be 0011110000111100 and so on.
BUT, once i get to like after 6th rotation, WHERE DOES THE CARRY BIT GO? if you know what i mean.
so for example, if i wanted to add 1111000011110000 (a different 16 bit number) to itself. and hence rotate once. which results in 1110000111100001 RIGHT? but how do you get that carry bit from most significant bit to least significant bit? because if you add it. it's actually 1110000111100000.
so basically my question is how do i get the 1 bit back to the least significant bit. i know addiing it to itself is essentially in shifiting. but i need help with getting the carry bit to the least significant bit.
like how do i do it?
the more detailed, and if you hit it straight on, u getting ur lifesavers!
Explanation / Answer
shift left
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.