{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab 4 - 3 In a single loop a Add together all the original...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction This lab shows us how to do various arithmetic operations using signed numbers on the Motorola 68HC12 microcontroller including one’s and two’s complements, sign/magnitude conversions, and we also do many conversions from 8-bit to 16-bit numbers. Equipment • 68HC12 evaluation board • MiniIDE and its respective requirements Procedure 1. Enter relevant data into memory at location $1000 2. In a single loop: a. Negate this data via sign/magnitude and store it at location $1020 i. Take each number and add %1000 0000 0000 0000 (or $8000). b. Negate via one’s complement and store at $1040 i. Load into Accumulator D ii. Request COMA and COMB operations c. Negate via two’s complement and store at $1060 i. Add 1 to the one’s complement from before with ADDD #01
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3. In a single loop: a. Add together all the original positive numbers and store at location $1080 b. Add together all the one’s complement numbers and store at $1084 4. Add up the sign/magnitude numbers assuming the first 4 are negative and the rest are positive. a. After loading a number into Accumulator D, ensure that it is negative with the command ORAA #%1000 0000 or positive with the command ANDA #%0111 1111. These commands will set the most significant bit appropriately while leaving all other bits in Accumulator D alone. 5. Do to sets of custom operations, one using one’s complements and the other using two’s complements. Store them at $1086 and $1088 respectively. Results Results are shown on the following page in the screenshot....
View Full Document

  • Fall '06
  • FernandoRios-Guiterrez
  • Signed number representations, single loop, various arithmetic operations, respective requirements Procedure

{[ snackBarMessage ]}

Ask a homework question - tutors are online