Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using ARM Assembly Language (ARM Cortex-M MicroController) Consider a 9-story building with a basement. The first floor is given the number 1, the second is

Using ARM Assembly Language (ARM Cortex-M MicroController)

Consider a 9-story building with a basement. The first floor is given the number 1, the second is given the number 2 and so on. The basement is given the number 0. You will write a program to simulate an elevator operated throughout the whole building. Write the following subroutines that will work with the main program,

a) DELAY: generates a software delay of 1 second.

b) OPEN: displays a Door open message on the screen after a delay of 1 second. A working version of this code is supplied for your use, if you like on the Software Downloads page from the Lab page

c) CLOSE: displays a Door close message on the screen after a delay of 1 second.

d) UP: performs the following procedure: i. Displays a Going UP message on the screen. ii. Goes up one floor at a time (1 second delay between each floor), until the elevator reaches the destination. iii. At each floor, prints that number (current floor number) on the screen. iv. After the elevator reaches the destination floor, stores this number as the current floor number in memory.

e) DOWN: performs the following procedure: i. Displays a Going DOWN message on the screen. ii. Goes down one floor at a time (1 second delay between each floor), until the elevator reaches the destination. iii. At each floor, prints that number (current floor number) on the screen. iv. After the elevator reaches the destination floor, stores this number as the current floor number in memory.

f) STAY: displays a Same floor message on the screen after a delay of 1 second.

Following is the pseudo code you can use for your main program,

1. Initialize the elevator at floor #1 (memory location containing the present location of the elevator).

2. Call the OPEN subroutine.

3. Wait for the input from the user (0-9).

4. Call the CLOSE subroutine.

5. Compare the number input with the present floor number.

6. If the number input is greater than the present floor number, call the UP subroutine. Then jump to step 9.

7. If the number input is less than the present floor number, call the DOWN subroutine. Then jump to step 9.

8. If the number input is equal to the present floor number, call the STAY subroutine

9. Jump back to step 2.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

ISBN: 3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

LO1 Understand risk management and identify its components.

Answered: 1 week ago