Mechatronics_9_02_08_Supplementary

Mechatronics_9_02_08_Supplementary - More Fixed Point Math...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
More Fixed Point Math Fundamentals of Mechatronics Engineering 9/02/08-Supplementary
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Fixed Point Multiply Atmega128 has instructions for 8 bit by 8 bit multiply, signed, unsigned and fractional For more than 8 bits, such as a 16 bit by 8 bit, or 16 bit by 16 bit, you will need to write a subroutine. Subroutines available online at sources such as AVR assembler site http://avr-asm.tripod.com/
Background image of page 2
16 bit by 8 bit multiply Just like decimal multiplication (sortof) Example: 302 x 5 Multiply the “ones”: 2x5=10 Now, multiply “one” by “ten”: 0x5=0 But shift one place because of the “ten”: 00 Now, multiply “one” by “hundred”: 3x5=15 But shift two places because of “hundred”: 1500 Sum results: 10+00+1500=1510
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
16 bit by 8 bit multiply 16-High 16-Low 8 8 + Add with carry C 16-Low x 8 16-High x 8 24 bit result Algorthim: 1. Multiply Low bytes 2. Multiply Low by High 3. Add “Middle Bytes” 4. Add possible carry to high byte
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

Mechatronics_9_02_08_Supplementary - More Fixed Point Math...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online