LC3 Assembly - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

LC3 Assembly

i am trying to find the code to perform multiplication and a logical right shift on two unsigned integers.

Comments

  • mombawambamombawamba Posts: 35Member
    : i am trying to find the code to perform multiplication and a logical right shift on two unsigned integers.
    :
    What do you mean by LC3? Is this the Little Computer 3? The HP server? Or something else?

    ~Sparrow
  • lidolido Posts: 2Member
    : : i am trying to find the code to perform multiplication and a logical right shift on two unsigned integers.
    : :
    : What do you mean by LC3? Is this the Little Computer 3? The HP server? Or something else?
    :
    : ~Sparrow
    :

    Hi,

    I'm interested to find out how to shift right in LC3 as well. I'm not sure what's LC3, but basically there's only three operators that can be used to shift bits to the right. They are AND, ADD and NOT.

    I only know that to shift to right, we need to divide the number by half. But in LC3, there's no divide operatior. So we need to make use of the three operators to do the shifting.

    Any experts here that knows hoa to do that?

    Thanks.

  • lidolido Posts: 2Member
    : : : i am trying to find the code to perform multiplication and a logical right shift on two unsigned integers.
    : : :
    : : What do you mean by LC3? Is this the Little Computer 3? The HP server? Or something else?
    : :
    : : ~Sparrow
    : :
    :
    : Hi,
    :
    : I'm interested to find out how to shift right in LC3 as well. I'm not sure what's LC3, but basically there's only three operators that can be used to shift bits to the right. They are AND, ADD and NOT.
    :
    : I only know that to shift to right, we need to divide the number by half. But in LC3, there's no divide operatior. So we need to make use of the three operators to do the shifting.
    :
    : Any experts here that knows hoa to do that?
    :
    : Thanks.
    :
    :
    By the way, just found out that LC3 is little computer 3. Yeah u're right. Any one can advise on the shift right ?

    Thanks
  • kernelOfTruthkernelOfTruth Posts: 1Member
    : : : : i am trying to find the code to perform multiplication and a logical right shift on two unsigned integers.
    : : : :
    : : : What do you mean by LC3? Is this the Little Computer 3? The HP server? Or something else?
    : : :
    : : : ~Sparrow
    : : :
    : :
    : : Hi,
    : :
    : : I'm interested to find out how to shift right in LC3 as well. I'm not sure what's LC3, but basically there's only three operators that can be used to shift bits to the right. They are AND, ADD and NOT.
    : :
    : : I only know that to shift to right, we need to divide the number by half. But in LC3, there's no divide operatior. So we need to make use of the three operators to do the shifting.
    : :
    : : Any experts here that knows hoa to do that?
    : :
    : : Thanks.
    : :
    : :
    : By the way, just found out that LC3 is little computer 3. Yeah u're right. Any one can advise on the shift right ?
    :
    : Thanks
    :

    I just got this book as well, and I have been stuck on that exercise for a while. I can't really think of a very efficient way to do a right shift with only ADD, AND, and NOT. I don't really know that I've solved the problem, but I have a theory. See if this works:

    * A left shift is easy
    * A left rotate is a little harder, but not much
    * N - 1 left rotates is equivalent to a right rotate
    * A right rotate with the MSB cleared is equivalent to a right shift

Sign In or Register to comment.