Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Chapter 3.

Similar presentations


Presentation on theme: "Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Chapter 3."— Presentation transcript:

1 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Chapter 3

2 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Addition and Subtraction –Double Numbers Multiplication Division Shift and Rotate Instructions

3 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Addition and Subtraction

4 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

5 68HC12 code for 1+, 2+ ; 1+ ( n -- n+1 ) ONEP LDD 0,X ADDD #1 STD 0,X RTS ; 2+ ( n -- n+2 ) TWOP LDD 0,X ADDD #2 STD 0,X RTS

6 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 code for 1-, 2- ; 1- ( n -- n-1 ) ONEP LDD 0,X SUBD #1 STD 0,X RTS ; 2- ( n -- n-2 ) TWOP LDD 0,X SUBD #2 STD 0,X RTS

7 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Addition and Subtraction –Double Numbers Multiplication Division Shift and Rotate Instructions

8 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Double Numbers

9 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Adding Double Numbers

10 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Subtracting Double Numbers

11 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

12

13 68HC12 Arithmetic Addition and Subtraction –Double Numbers Multiplication Division Shift and Rotate Instructions

14 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Multiplication

15 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Multiplication

16 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Multiplication

17 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC11: A, B, C, D are 8 bits 16 x 16 => 32-bit product 68HC12: A, B, C, D could be 16 bits 32 x 32 => 64-bit product

18 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Multiplication - DUM*

19 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell WHYP Multiplication Examples

20 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Addition and Subtraction –Double Numbers Multiplication Division Shift and Rotate Instructions

21 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Division

22 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

23 WHYP uses symetric (not floored) division

24 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

25

26 Examples of using / and MOD

27 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

28 Examples of using UM/MOD

29 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell MU/MOD

30 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of using MU/MOD

31 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell M/MOD

32 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of using M/MOD

33 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell */

34 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of using */

35 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell IDIV

36 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell U/

37 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of using IDIV and U/

38 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell FDIV

39 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of using FDIV

40 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC11 version of UM/MOD

41 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Addition and Subtraction –Double Numbers Multiplication Division Shift and Rotate Instructions

42 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

43 Logic Shift Left LSL, LSLA, LSLB 0 1 0 1 0 0 1 0 1 1 C 76543210Bit 1 0 1 0 0 1 0 1 10 C 76543210Bit 1 0 1 0 0 1 0 1 76543210 AB LSLD

44 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Logic Shift Right LSR, LSRA, LSRB 1 0 1 0 0 1 0 1 10 C 76543210Bit 1 0 1 0 0 1 0 1 10 C 76543210Bit 1 0 1 0 0 1 0 1 76543210 AB LSRD

45 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Arithmetic Shift Right ASR, ASRA, ASRB 1 0 1 0 0 1 0 1 1 C

46 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Rotate Left ROL, ROLA, ROLB 1 0 1 0 0 1 0 1 1 C 76543210Bit

47 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Rotate Right ROR, RORA, RORB 1 0 1 0 0 1 0 1 1 C 76543210Bit

48 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 2*, 2/, and U2/

49 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell LSHIFT and RSHIFT

50 Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

51

52

53


Download ppt "Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 Arithmetic Chapter 3."

Similar presentations


Ads by Google