This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I NEED A SUDDEN REPLY

DEAR TO ALL, I AM DEALING WITH C8051F120 MICROCONTROLLER.UTILIZING 16 X 16 MAC ENGINE OPERATION.I AM DOING ASSEMBLY LANGUAGE PROGRAMMING USING THIS MICROCONTROLLER FOR MULTIPLICATION. IS IT POSSIBLE TO MULTIPLY TWO UNSIGNED 16 BIT INPUTS?
IF YES, THEN HOW ?

Parents
  • what is the use of MAC0RS bit in C8051f120

    The chips datasheet states, on page 162:

    When set to 1, the 40-bit MAC0 Accumulator register will be shifted during the next SYSCLK cycle.
    The direction of the shift (left or right) is controlled by the MAC0RS bit.
    This bit is cleared to ‘0’ by hardware when the shift is complete.
    

    Setting this bit to 1 therefore instructs the MAC engine to do a 1-bit bitshift on the accumulator of the MAC engine. The direction of this shift can be controlled with another bit in the same register.

Reply
  • what is the use of MAC0RS bit in C8051f120

    The chips datasheet states, on page 162:

    When set to 1, the 40-bit MAC0 Accumulator register will be shifted during the next SYSCLK cycle.
    The direction of the shift (left or right) is controlled by the MAC0RS bit.
    This bit is cleared to ‘0’ by hardware when the shift is complete.
    

    Setting this bit to 1 therefore instructs the MAC engine to do a 1-bit bitshift on the accumulator of the MAC engine. The direction of this shift can be controlled with another bit in the same register.

Children
  • Mr.Christoph Franck,
    first of all i am thanking you for giving immediate response. now discussion:

    After reading the part you pointed out,i got confused that whether MAC0SC and MAC0RS are equal
    because no where i saw any further description about that bit.

    may i interrupt you asking other question?

    if yes
    my question is:

    ACALL and LCALL how we utilize in program?

    because i have to reduce execution time

    guide me for this question : how many ways we can reduce code size

  • After reading the part you pointed out,i got confused that whether MAC0SC and MAC0RS are equal
    because no where i saw any further description about that bit.

    MAC0SD and MAC0RS seem to refer to the same bit (the one that controls the direction of the bit-shifts). MAC0SC is the bit that actually triggers the bit shift.

    ACALL and LCALL how we utilize in program?

    You can use ACALL to call a subroutine within the same 2 kB page of the code memory. Else you have to use LCALL. ACALL and LCALL take the same number of processor cycles, but ACALL only takes two bytes, while LCALL takes three.

    because i have to reduce execution time

    ACALL and LCALL have the same execution time.

    guide me for this question : how many ways we can reduce code size

    That is a question that's usually treated in large books. Especially since you also say that you need to reduce the execution time, too - quite often, you need to make a tradeoff between code size and execution time.

    You can unroll loops, which makes the program faster, but larger, for example.

    You can use macros instead of function calls, which also makes the program faster, but larger.

    You can calculate any math functions you need, or you can use lookup tables. The former usually leads to slow, but small code, while the latter takes up a lot of space, but can be very fast.

  • You are right - the Datasheet says what the MAC0RS bit does, but omits to tell you where it is!

    But that is a fault in the SiLabs Datasheet - it has nothing to do with Keil.
    Therefore you should direct this question to SiLabs!

    "ACALL and LCALL how we utilize in program?"

    Sounds like you need a basic 8051 assembler tutorial, then?

    Have you read Chapter 2 of the so-called "bible" for the 8051?

    Chapter 1 - 80C51 Family Architecture:
    www.nxp.com/.../80C51_FAM_ARCH_1.pdf

    Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set:
    www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf

    Chapter 3 - 80C51 Family Hardware Description:
    www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf

    Here are some other introductory & reference materials:
    http://www.keil.com/books/8051books.asp
    www.8052.com/books.phtml
    www.8052.com/tutorial.phtml

  • "That is a question that's usually treated in large books."

    It is a common fallacy that the mere act of writing in assembler will inherently give you fast, tight code.

    This is simply not true: it takes a great deal of skill and experience to write fast, tight code in any language!
    Sure, assembler gives you more opportunities - but you need to know how to use them!

    If you need to ask basic questions like how to use ACALL and LCALL, you're probably not quite ready to be turning out super-optimised code...

    You might even find that the compiler can do a better job - especially with optimisations enabled
    (but then that gives you the issues with debugging - which comes back to skill & experience)

  • You are right - the Datasheet says what the MAC0RS bit does, but omits to tell you where it is!

    from the datasheet:
    Bit 5: MAC0SC: Accumulator Shift Control.
    When set to 1, the 40-bit MAC0 Accumulator register will be shifted during the next SYSCLK cycle. The direction of the shift (left or right) is controlled by the MAC0RS bit.
    This bit is cleared to ‘0’ by hardware when the shift is complete.
    Bit 4: MAC0SD: Accumulator Shift Direction.
    This bit controls the direction of the accumulator shift activated by the MAC0SC bit.
    0: MAC0 Accumulator will be shifted left.
    1: MAC0 Accumulator will be shifted right.

    It should be obvious that MAC0RS and MAC0SD is the same as mentioned in a former post.

    Erik

  • "It should be obvious that MAC0RS and MAC0SD is the same as mentioned in a former post."

    Maybe so, but it's clearly an error in the datasheet.

    Of course, the SiLabs datasheet has nothing to do with Keil - this needs to be taken up with SiLabs!

  • this needs to be taken up with SiLabs!
    I already did

    Erik

  • hello to all , i am using keil uvision3 and device selected is c8051f120.after execution of the project, the states is 1992 and execution time is 0.000650 seconds
    Note:clock is 50MHz

    please tell me whether i forgot any step missed or is it correct ?

    if my answer is correct,then what is the relation between states and executed time?

    i calculated like this

    (1/(50*1000000))*1992=39 microseconds

    but answer i got is .6 milliseconds

    why?

    please i need your help

    sory for interrupting you all

    Regards
    Ranjini.NP

  • please reply to this

    hello to all ,
    i am using keil uvision3 and device selected is c8051f120.after execution of the project, the states is 1992 and execution time is 0.000650 seconds
    Note:clock is 50MHz

    please tell me whether i forgot any step missed or is it correct ?

    if my answer is correct,then what is the relation between states and executed time?

    i calculated like this

    (1/(50*1000000))*1992=39 microseconds

    but answer i got is .6 milliseconds

    why?

    please i need your help

    sory for interrupting you all

    Regards
    Ranjini.NP

  • Why do you post the same question twice? Will there be twice as many who know the answer? Or will the people who know the answer be twice as interested in answering?

  • nobody responding
    thats why i put again

  • "nobody responding thats why i put again"

    And in what way do you suppose that will encourage anyone to reply who hasn't already replied?!

    Rather than merely reposting exactly the same text, why not try to clarify it, or add further explanation?