Preview

ece362 lab04

Satisfactory Essays
Open Document
Open Document
559 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
ece362 lab04
ECE 362 Microprocessor Systems and Interfacing
Laboratory 04 Conditional Codes and Prime Number Tester

This exercise investigates conditional code and branches use in ARM Cortex-M3 assembly language program and use of Keil MDK-ARM debugger. The objective of this exercise is familiarization with Cortex-M3 conditional codes through a prime-number test design and programming.

Prelab

Read through this web page, http://www.wikihow.com/Check-if-a-Number-Is-Prime for prime number testing algorithm method 1. Method 1.1 to 1.5 is the algorithm we will use in this lab. Google and find all prime factors smaller than 100 and write them down. Use this algorithm to test if the number 9997 and 1259 are prime numbers and write down their square roots to be used for programming. (Hint: The square root to be used for testing should be rounded up, i.e., take the ceiling function)

Draw (by hand or using Computer CAD tools, such as Visio) a flowchart for the testing algorithm. In this lab, we assume that the test integer is smaller than 100,000, (if it is greater than 100,000, your code simply returns to indicate that it is a non-prime number).

Include a snapshot of your hand-drawn flowchart or computer generated one and all other prelab requirements in your lab report.

Lab Procedure

1. Create a new directory lab04 and Keil MDK-ARM project for this lab exercise, name it as lab04.
2. Following the guidelines listed below, write a properly commented and properly formatted Cortex-M3 assembly language program to test if the number 9997 is a prime number. a. The number 9997 and square root must be declared using assembler directives EQU NUM, and NUMSQT.
NUM EQU 9997
NUMSQRT EQU 100
b. The result is saved in register R7, R7=0, indicating a non-prime number; R7=1, indicating a prime number.
c. Get a screen of your simulation results (Ctrl-Alt-Print Screen) to show than R7=0 for the number 9997.
d. Change the number to 1259 and corresponding square root, run the steps a)

You May Also Find These Documents Helpful

  • Satisfactory Essays

    1408 Bio Lab05 Report2

    • 923 Words
    • 5 Pages

    you recorded in your lab manual while performing the experiments. Save the completed PDF file…

    • 923 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 3

    • 659 Words
    • 3 Pages

    Program description: I calculated the usable area in square feet of a house. Assume that the house has a maximum of four rooms, and that each room is rectangular. I wrote pseudo code statements to declare 4 Integers and labeled them homesqft, room1, room2, room3, and room4. Each room will have its length and width to calculate its area.…

    • 659 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Question 7: (Practice) For the following section of code, determine the data type and scope…

    • 720 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    It/210 Final Exam

    • 1235 Words
    • 5 Pages

    4. The calculation should be executed only after all the valid input values are provided.…

    • 1235 Words
    • 5 Pages
    Good Essays
  • Good Essays

    3) How would you display the Designer window if it is not visible in your project?…

    • 3668 Words
    • 15 Pages
    Good Essays
  • Good Essays

    Nt1210 Chapter 1 Review

    • 1315 Words
    • 6 Pages

    7. A user has opened a calculator application, typed the numbers 123456789, and then done some math problem using this number. Which of the following determine, in part, what bits the computer store in RAM to represent the number123456789?…

    • 1315 Words
    • 6 Pages
    Good Essays
  • Good Essays

    basdasd

    • 683 Words
    • 3 Pages

    Click the “Information” bar at the bottom of the lab simulation and read all the background information.…

    • 683 Words
    • 3 Pages
    Good Essays
  • Better Essays

    Procedure and Data Sheets: Flow Chart. Data Sheets attached. Instructions followed from Lab Manual pages 49-65…

    • 868 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    It210 Appendix F

    • 372 Words
    • 3 Pages

    4. The calculation should be executed only after all the valid input values are provided.…

    • 372 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Netw202 week 1 lab report

    • 800 Words
    • 4 Pages

    4. While performing your labs, capture and paste all screenshots identified in this Lab Report Template.…

    • 800 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Quiz Comp Archi

    • 438 Words
    • 3 Pages

    12) Please list registers and their functions in ARM. How many general purpose registers and how to use them in the program?…

    • 438 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    For Procedure Step #8, you may create a graph on graph paper and submit it using a scanner OR you may create a graph using Microsoft Excel and submit the file.…

    • 3173 Words
    • 11 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Student

    • 595 Words
    • 3 Pages

    0.02 up to 1.0 in steps of 0.01), by running the procedure described above for each value of p and for many slots (at least a thousand slots per value of p). The more simulated slots, the more accurate the results will be. Based on this statistics, plot two graphs: 1) the…

    • 595 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    In my mind I made a number line and crossed off every even number, then the odds divisible by three, five, seven and nine (except themselves), and, of course, one. Looking for twin primes, I located 17 and 19, 11 and 13, as well the triplet three, five and seven, which I divided into two twin primes.…

    • 537 Words
    • 3 Pages
    Good Essays
  • Good Essays

    it320 assignment 1-3

    • 1779 Words
    • 8 Pages

    1. Which of the following is true about 1 bit? (C. Represents one binary digit)…

    • 1779 Words
    • 8 Pages
    Good Essays