0% found this document useful (0 votes)
50 views1 page

Labsheet2 15ECE382: Microcontroller Lab

This document provides 4 embedded C programming exercises for a microcontroller lab: 1) Generate the first 10 Fibonacci numbers, 2) Sort an array of 10 numbers into ascending order, 3) Implement a logical calculator using switch case for logic operations, and 4) Calculate a grade based on marks ranges from A to Fail. Students are to write the C code, simulate it using Keil IDE, and observe the corresponding ARM assembly code to correlate variables with registers.

Uploaded by

Bharath Chandra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views1 page

Labsheet2 15ECE382: Microcontroller Lab

This document provides 4 embedded C programming exercises for a microcontroller lab: 1) Generate the first 10 Fibonacci numbers, 2) Sort an array of 10 numbers into ascending order, 3) Implement a logical calculator using switch case for logic operations, and 4) Calculate a grade based on marks ranges from A to Fail. Students are to write the C code, simulate it using Keil IDE, and observe the corresponding ARM assembly code to correlate variables with registers.

Uploaded by

Bharath Chandra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Labsheet2 15ECE382: Microcontroller Lab

Embedded C program
__________________________________________________________________________
Name: Roll Number:
___________________________________________________________________________

Write the embedded C code for the following and simulate


using Keil IDE.
Note: For all exercises first write down either flow chart or Pseudo code.
Also observe the corresponding ASM code and try to correlate with your C code
variables with that of ARM registers used.

1. Generate the first 10 Fibonacci numbers


2. Sort the given array of 10 numbers into ascending
order.
3. Implement a Logical Calculator using switch case.
Perform logic operations such as AND, OR, NOT, XOR,
NAND; SHIFT RIGHT.
4. Calculate grade according to the following conditions;
If mark is above 85 then Grade=A; If >=70 & <85 then
Grade=B; If >=55) & <70 then Grade=C; If >=40 &
<54, then Grade=D; If below 40 then Grade=Fail.

Date: Signature of the Faculty

Page 1 of 1

You might also like