Skip to content

Microprocessor and Micro-controller

CSE · Final · Summer 25

Batch 64

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Daffodil International University Faculty of Science & Information Technology Department of Computer Science & Engineering Final Examination, Summer 2025 Course Code: 317, Course Title: Microprocessor and Micro-controller Level: 3 Term: 1 Batch: 64 Time: 02:00 Hrs Marks: 40 Answer ALL Questions [Optional] [The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.] 1. a) A temperature monitoring system uses a microcontroller to read data from a temperature sensor and display it on an LCD screen. Show the concepts of Microcontroller to answer the following question. What basic components are typically involved in a microcontroller? How does the microcontroller operate with these components? [5] CO3 2. a) You are working on a portable medical device that uses an STM32L4 microcontroller to process sensor data and display results on an LCD. The device must run on battery power for long periods, yet respond quickly to real-time events. Illustrate the processor organization and explain the process. [7] CO3 b) Why is the Harvard architecture of the Cortex-M4 beneficial in this application? [3] 3. a) You are designing a security system using an STM32 microcontroller. A motion sensor is connected to one of the GPIO pins configured to generate an external interrupt when motion is detected. When the interrupt occurs, the system should immediately turn on an alarm LED and log the event. Analyse the following task one by one. 1. How would you configure the GPIO pin connected to the motion sensor to generate an interrupt on the STM32? 2. What are the advantages of using an interrupt instead of continuously polling the sensor state? 3. Briefly describe what happens inside the microcontroller when the motion sensor triggers the interrupt. 4. How would you write the interrupt service routine (ISR) to handle turning on the alarm LED? [7] CO3 b) You want to build: - Device A: A laptop computer that can run programs like web browsers and games. - Device B: A digital wristwatch that shows time and controls alarms. 1. Which device should use a microprocessor and which should use a microcontroller? 2. Give two simple differences between a microprocessor and a microcontroller. [3] 4. a) You are programming an 8-bit microcontroller. The AL register contains a status byte where each bit represents a sensor's state (1 = active, 0 = inactive): S7 S6 S5 S4 S3 S2 S1 S0 Currently, AL = 10110010b. Use the result of AL for each task. 1. Write the result of performing (SAR AL, 1) on this byte. Explain what happens to each bit. 2. After the shift, perform (ROR AL, 1) instruction. What will the new value be? Explain how bits move during this operation. 3. You need to check if the most significant bit and least significant bit were set before the shift. 4. If you want to rotate the bits circularly to the left by 3 positions, what instruction would you use and what is the resulting binary? 5. Write the instruction if Bits 4, 5, and 6 were inverted (bit-flipped). Analyze the results of SAR, ROR, and ROL on the original byte [7] CO4 b) mov ax, 0x1111 mov bx, 0x2222 call sub1 mov cx, ax ; End of program sub1: push bx mov bx, 0x3333 call sub2 pop bx Ret sub2: push ax add ax, bx pop ax ret Evaluate the final values of AX, BX, and CX after all calls and returns? [3] 5. i. You are given a null-terminated ASCII string stored in memory starting at label STR1. Your task is to write assembly instructions to perform the following operation. Count the number of vowels (A, E, I, O, U) in the resulting string. ii. You have a string stored at SOURCE: "ASSEMBLY" Find the first occurrence of 'M' iii. A string is stored at STR: "ASM" Write an assembly routine to reverse the string [5] CO4