Quiz Space

May 2024 term · Embedded C Programming · CS2101

Embedded C Programming End Term: 1 September 2024, Set QEF3 (May 2024 term)

The IIT Madras BS Embedded C Programming (Embedded C Programming) End Term paper sat on 1 Sept 2024, in the May 2024 term, set QEF3: 23 questions for 50 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
23
Marks
50
Duration
180 min
MCQ
22
Numerical
1

Updated

Official paper: IIT M ES FOUNDATION AN EXAM QEF3 01 Sep 2024 · No negative marking.

Question 1

+1 markOne correct option

Which of the following is a reason for designing a microcontroller (MCU) instead of using a microprocessor (MPU)?

  1. A

    To achieve higher computational power.

  2. B

    To minimize power consumption and extend battery life.

  3. C

    To accommodate larger on-chip memory capacity.

  4. D

    To simplify the design for general-purpose computing tasks.

Show answer

Correct answer

  • B

    To minimize power consumption and extend battery life.

Question 2

+2 marksOne correct option

Which instruction set architecture (ISA) is primarily associated with the Arduino platform?

  1. A

    AVR

  2. B

    ARM

  3. C

    MSP430

  4. D

    PIC

Show answer

Correct answer

  • A

    AVR

Question 3

+2 marksOne correct option

Which of the following data types would be most memory-efficient for storing the small integer number in an array, given that the maximum value of numbers can be 700?

  1. A

    int

  2. B

    unsigned int

  3. C

    uint8_t

  4. D

    uint16_t

Show answer

Correct answer

  • D

    uint16_t

Question 4

+2 marksOne correct option

A 12-bit ADC is used to digitize a signal in the range of -10V to +10V. What is the minimum difference (approx) between two voltages that you can measure?

  1. A

    2.5 mV

  2. B

    4.88 mV

  3. C

    6.88 mV

  4. D

    9 mV

Show answer

Correct answer

  • B

    4.88 mV

Question 5

+2 marksOne correct option

What is the primary advantage of Zigbee over WiFi for certain embedded system applications?

  1. A

    Higher data transfer rates

  2. B

    Longer range

  3. C

    Better security features

  4. D

    Lower power consumption

Show answer

Correct answer

  • D

    Lower power consumption

Question 6

+2 marksOne correct option

What is a circuit-switched connection?

  1. A

    A connection that breaks data into packets and sends them independently.

  2. B

    A dedicated path created between two endpoints.

  3. C

    A wireless connection established through Wi-Fi.

  4. D

    A protocol used for error detection in data transmission.

Show answer

Correct answer

  • B

    A dedicated path created between two endpoints.

Question 7

+2 marksOne correct option

How does loop unrolling optimize code execution in embedded systems?

  1. A

    By increasing the number of iterations.

  2. B

    By reducing the number of iterations and the overhead of loop control.

  3. C

    By combining multiple loops into one.

  4. D

    By eliminating the loop entirely.

Show answer

Correct answer

  • B

    By reducing the number of iterations and the overhead of loop control.

Question 8

+2 marksOne correct option

What is a common method microcontrollers use to manage power consumption?

  1. A

    Constantly running at maximum clock speed

  2. B

    Increasing voltage supply to all components

  3. C

    Utilizing multiple power modes such as sleep, standby, and shutdown

  4. D

    Disabling thermal management systems

Show answer

Correct answer

  • C

    Utilizing multiple power modes such as sleep, standby, and shutdown

Question 9

+2 marksOne correct option
  1. A

    BX = -4, CX = 16

  2. B

    BX = 4, CX = 16

  3. C

    BX = -4, CX = 20

  4. D

    BX = -4, CX = 12

Show answer

Correct answer

  • A

    BX = -4, CX = 16

Question 10

+2 marksOne correct option

What is a key benefit of using a microkernel architecture in embedded systems?

  1. A

    Enhanced graphical user interfaces

  2. B

    Increased direct hardware access

  3. C

    Strong isolation and modularity

  4. D

    Simplified debugging processes

Show answer

Correct answer

  • C

    Strong isolation and modularity

Question 11

+2 marksOne correct option

What type of error occurs due to asynchronous events and the order in which they occur?

  1. A

    Compilation error

  2. B

    Hardware error

  3. C

    Syntax error

  4. D

    Race condition

Show answer

Correct answer

  • D

    Race condition

Question 12

+2 marksOne correct option

What problem occurs when low-priority tasks never get CPU time due to continuous high-priority task execution?

  1. A

    Deadlock

  2. B

    Starvation

  3. C

    Priority Inversion

  4. D

    Concurrency

Show answer

Correct answer

  • B

    Starvation

Question 13

+2 marksOne correct option

You are developing firmware for a sensor node in a wireless sensor network. The node spends most of its time idle, waking up periodically to transmit data. What is the best optimization strategy to reduce power consumption?

  1. A

    Increase the processor clock speed to reduce the time spent in active mode.

  2. B

    Optimize the sensor data processing algorithm for faster execution.

  3. C

    Implement a deep sleep mode that turns off unnecessary peripherals when the node is idle.

  4. D

    Use a high-efficiency sorting algorithm for organizing transmitted data.

Show answer

Correct answer

  • C

    Implement a deep sleep mode that turns off unnecessary peripherals when the node is idle.

Question 14

+2 marksOne correct option

Which strategy is most effective for reducing leakage currents in an embedded system?

  1. A

    Using a lower clock frequency

  2. B

    Reducing the operating voltage

  3. C

    Implementing sleep modes for unused components

  4. D

    Increasing the transistor size

Show answer

Correct answer

  • C

    Implementing sleep modes for unused components

Question 15

+2 marksOne correct option

You are debugging an embedded system for a wearable fitness tracker that periodically measures and records heart rate data. You need to ensure that the system's timing is not affected by your debugging efforts. Which approach would you use to minimally impact the system's performance?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 16

+2 marksOne correct option

You are developing a video processing application that converts videos to different formats. After releasing the first version, you notice that the application takes a long time to process large video files. You decide to use a profiling tool to understand the performance issues. Question:
After profiling your application, you discover that a significant amount of time is spent on reading and writing video files to disk. What is the most effective optimization you could implement to improve the application's performance?

  1. A

    Rewrite the file I/O operations using a different programming language.

  2. B

    Optimize the video compression algorithm to reduce processing time.

  3. C

    Implement a buffering system to minimize disk I/O and process data in memory.

  4. D

    Increase the application's logging level to track more detailed processing steps.

Show answer

Correct answer

  • C

    Implement a buffering system to minimize disk I/O and process data in memory.

Question 17

+2 marksOne correct option

The process of identifying potential ethical dilemmas, evaluating options, making decisions, and learning from the outcomes is known as:

  1. A

    Ethical framework

  2. B

    Guided decision making

  3. C

    Ethical dilemma

  4. D

    Ethical reasoning

Show answer

Correct answer

  • B

    Guided decision making

Question 18

+3 marksOne correct option
  1. A

    0x20

  2. B

    0x40

  3. C

    0x10

  4. D

    0x80

Show answer

Correct answer

  • B

    0x40

Question 19

+3 marksOne correct option

A CPU has 128KB of SRAM connected to it starting at address 0x00300000. What is the address of the last byte in the SRAM?

  1. A

    0x0031FFFF

  2. B

    0x00320000

  3. C

    0x00303FFF

  4. D

    0x0030FFFF

Show answer

Correct answer

  • A

    0x0031FFFF

Question 20

+3 marksOne correct option

A memory-mapped peripheral has a register set starting at address 0x12345600. Each register is 16 bits wide. If there are 8 registers in the set, what is the address of the 4th register?

  1. A

    0x12345606

  2. B

    0x1234560C

  3. C

    0x12345608

  4. D

    0x12345610

Show answer

Correct answer

  • C

    0x12345608

Question 21

+3 marksOne correct option

Let's use the example of a finite state machine (FSM) for controlling an LED with a single button. The states and events will be defined as follows:

  • States:
    1. STATE_OFF - LED is off.
    2. STATE_ON - LED is on.
    3. STATE_BLINKING - LED is blinking.
  • Events:
    1. EVENT_BUTTON_PRESS - Button is pressed.
    2. EVENT_BLINK_DONE - Blinking sequence is completed (5 blinks).

Consider the following code.

c
void handleEvent(Event_t event) {
switch (currentState) {
case STATE_OFF:
if (event == EVENT_BUTTON_PRESS) {
currentState = STATE_ON;
}
break;
case STATE_ON:
if (event == EVENT_BUTTON_PRESS) {
currentState = STATE_BLINKING;
}
break;
case STATE_BLINKING:
if (event == EVENT_BUTTON_PRESS || event == EVENT_BLINK_DONE) {
currentState = STATE_OFF;
}
break;
default:
currentState = STATE_OFF;
break;
}
}

Which of the following transitions would occur if the current state is STATE_BLINKING and the EVENT_BLINK_DONE event occurs?

  1. A

    Transition to STATE_ON

  2. B

    Transition to STATE_OFF

  3. C

    Transition to STATE_ERROR

  4. D

    Transition to STATE_IDLE

Show answer

Correct answer

  • B

    Transition to STATE_OFF

Question 22

+3 marksOne correct option

Given the following FreeRTOS code for an Arduino project:

c
#include <Arduino_FreeRTOS.h>
void Task1(void *pvParameters) {
for (;;) {
Serial.println("Task 1");
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
}
void Task2(void *pvParameters) {
for (;;) {
Serial.println("Task 2");
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
void setup() {
Serial.begin(9600);
xTaskCreate(Task1, "Task 1", 128, NULL, 1, NULL);
xTaskCreate(Task2, "Task 2", 128, NULL, 1, NULL);
vTaskStartScheduler();
}
void loop() {}

What does the function xTaskCreate() do in the FreeRTOS setup?

  1. A

    It starts the scheduler to manage task execution.

  2. B

    It ends the task and frees resources.

  3. C

    It delays the execution of a task.

  4. D

    It creates a new task and adds it to the ready list.

Show answer

Correct answer

  • D

    It creates a new task and adds it to the ready list.

Question 23

+2 marksNumerical answer

A 8-bit ADC can digitize an analog value into ___ distinct levels.

Show answer

Correct answer: 256