Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LC3 Machine language

in LC-3 machine language how can a number of 16 bits left shifted by n bits? like if we have 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 and the binary numbers are | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |

then how can we left shift 3?

like image 226
user2383518 Avatar asked Aug 08 '26 05:08

user2383518


1 Answers

Because LC-3 apparently has no shift operations you have to do it yourself.

some folks dicussing an LC-3 simulator and bit shift operations here http://www.asmcommunity.net/board/index.php?topic=28978.0 indicate that:

for each bit position of shift to the left, its multiply by 2 (or add it to itself if you like)

Hope that helps.

like image 116
David Tansey Avatar answered Aug 11 '26 02:08

David Tansey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!