0% found this document useful (0 votes)
153 views6 pages

Microprocessors - Final Exam (2020 Fall)

This document contains a final exam for the ELEC 334 - Microprocessors course. It consists of 20 multiple choice questions related to microprocessor concepts like registers, interrupts, memory formats, real-time systems, and analog to digital converters. The student is asked to fill in their name and student ID at the top.

Uploaded by

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

Microprocessors - Final Exam (2020 Fall)

This document contains a final exam for the ELEC 334 - Microprocessors course. It consists of 20 multiple choice questions related to microprocessor concepts like registers, interrupts, memory formats, real-time systems, and analog to digital converters. The student is asked to fill in their name and student ID at the top.

Uploaded by

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

ELEC 334 - Microprocessors

Final 2021 - 00acf34bf878c133db77d67daa554641 - Can’t solve me ;)

name lastname: ______________________________ student id: _____________

1 21

2 22

3 23

4 24

5 25

6 26

7 27

8 28

9 29

10 30

11 31

12 32

13 33

14 34

15 35

16 36

17 37

18 38

19 39

20 40

Q
Quueessttiioon
n 11 - How to reset only the 15th bit on a register?

A. REG |= ~0x8000;
B. REG &= ~0x8000;
C. REG &= 0x8000;
D. REG ^= ~0x8000;
E. REG |= 0x8000;

Q
Quueessttiioon
n 22 - For a system with 4 sensor connected using SPI protocol, how many pins need to be wired (excluding vdd and ground) to the
microcontroller?

A. 4
B. 2
C. 3
D. 7
E. 8

Q
Quueessttiioon
n 33 - Which one of the following is NOT one of the purposes of a semaphore usage?

A. To sync one task to another


B. To sync both tasks to the same point
C. To protect the integrity of shared resource
D. To organize data transfer from one task to another
E. To hide sensitive information
Q
Quueessttiioon
n44 - Which of the following code snippets will reset the least-significant bit of x?

A. x &= 0x01;
B. x | 0x01;
C. x |= 0x01;
D. x &= ~0x01;
E. x |= ~0x01;

Q
Qu n 55 - How can we see printf function over a UART line properly?
ueessttiioon

A. We don’t have to do anything, since it will be transmitted automatically


B. By routing write system call to UART transmit routine
C. By redefining a function that sends the message over to UART
D. We cannot really see printf since there is no console
E. What is printf?

Q
Quueessttiioon
n66 - Which of the following most accurately describes the use of the static keyword?

A. A variable declared static within the body of a function maintains its value between function invocations.
B. A variable declared static outside the body of a function can be accessed by any function.
C. A function declared static cannot be called and will be optimized.
D. A variable declared static within the body of a function has no meaning.
E. A variable declared static outside the body of a function has no meaning.

Q
Quueessttiioon
n 77 - Which of the following is not inside a program image?

A. vector table
B. startup code
C. reset handler
D. application code
E. heap code

Q
Quueessttiioon
n88 - What can we say about v if the resulting f is true for v > 0?

1 f = (v & (v - 1)) == 0;
2

A. v is a power of 2
B. v is even number
C. v is odd number
D. v is negative integer
E. v is positive integer

Q
Quueessttiioon
n99 - What is the race condition?

A. Conflicting function signatures.


B. Multiple definitions of the same variable.
C. Unexpected result based on the timing of read and write operations.
D. Multiple weakly defiend function blocks.
E. Order of the parameters getting mixed up when calling a function.

Q
Quueessttiioon
n 110
0 - How long (rougly) it takes to transfer 10 bytes of data for 8N1 UART setup for 9600 baud?

A. 1 ms
B. 10 ms
C. 100 ns
D. 1000 ms
E. 100 ms

Q
Quueessttiioon
n 1111 - What is the purpose of the following code piece?

1 ffoorr (c = 0; v; v >>= 1)
2 {
3 c += v & 1;
4 }
5

A. Counts the number of bits on v and writes the result to c


B. Checks if v is odd or even
C. See if v is more than 32-bits
D. Checks if v has enough space to store c bits
E. Invalid, should not compile

Q
Qu n 1122 - Which of the following statements accurately describes the intended e!ect of the declaration int (*a)[10];?
ueessttiioon

A. A pointer to an array of ten integers.


B. An array of ten pointers to function.
C. A function that points to an array of ten integers.
D. An array of ten integers.
E. An array of ten pointers to integers.

Q
Quueessttiioon
n 1133 - Which of the following is responsible for interrupt management and prioritization?

A. SCS
B. Stack
C. RISC
D. Vector Table
E. NVIC

Q
Quueessttiioon
n 114
4 - How to set only the 5th bit on a register?

A. REG ^= ~0x0020;
B. REG |= 0x0020;
C. REG &= 0x0020;
D. REG |= ~0x0020;
E. REG &= ~0x0020;

Q
Quueessttiioon
n 1155 - Which of the following is used to describe an architecture that use a common bus for both data and code?

A. von Neumann
B. Register-Register
C. FISC
D. LISC
E. Harvard

Q
Quueessttiioon
n 116
6 - Which of the following is a memory format that holds the lowest byte in lower address?

A. read only memory


B. big endian
C. read write memory
D. little endian
E. random access memory

Q
Quueessttiioon
n 1177 - Which one of the following is an true for using a non-preemptive kernel in RTOS.

A. Interrupt latency is typically low


B. It’s responsiveness is very high, meaning any higher priority task can run immediately
C. All tasks are guaranteed to run regularly
D. There is no need to define priority for tasks
E. Needs a lot of guards on shared data between tasks

Q
Quueessttiioon
n 118
8 - Which of the following is the most flexible way to declare a C preprocessor macro that takes two arhuments and returns the smaller of
their two values?

A. #define MIN(A, B) A < B ? A : B


B. #define MIN(A, B) (((A) < (B)) ? (A) : (B))
C. #define MIN(A, B) ((A < B) ? A : B)
D. #define MIN(A, B) { if (A < B) A; else B;}
E. #define MIN(A, B) do { A < B ? A : B} while(0)

Q
Quueessttiioon 9 - What is the result of the following operation assuming A = 0x1234?
n 119

1 A &= ~0xFFDF;
2

A. 0xFFFF1234
B. 0x1234FFDF
C. 0x00000020
D. 0x12340000
E. 0x00001234

Q
Quueessttiioon
n 220
0 - Which of the following is NOT a type of real-time system?

A. Middle real-time systems


B. Firm real-time systems
C. Soft real-time systems
D. Hard real-time systems

Q
Quueessttiioon
n 2211 - Which one of the following best describes context switching?

A. Using an RTOS instead of bare-metal for an application (and vice versa).


B. Declaration of a function pointer that points to di!erent functions based on context.
C. Save the current task’s CPU registers in the current task’s stack area, and restore the new task’s registers from the new task’s stack area.
D. Changing the CPU core that the task is running next time.
E. Change the priorirty of the running interrupt with the new priority that is passed to the function.
Q
Qu n 2222 - Which of the following should definitely be declared using volatile keyword?
ueessttiioon

A. A global variable that only used in one function for both reading and writing.
B. We don’t really need volatile keyword, let’s take it out in the next standard.
C. A variable used for a loop.
D. A private variable used within a function.
E. A global variable used within an interrupt service routine.

Q
Quueessttiioon
n 2233 - What is the purpose of an open-drain connection?

A. To make sure each device can talk on the bus


B. To make sure the line does not draw a lot of power when not in use
C. Less area
D. Cheaper option
E. To make sure there are no interference from other devices

Q
Quueessttiioon
n 224
4 - Which of the following best describes a Successive Approximation ADC?

A. It can only work with positive voltages


B. It takes linear time space to reach the desired voltage
C. It has very low noise profile
D. It keeps conversion time constant regardless of the input
E. It is very fast despite taking a large area

Q
Qu n 2255 - Which of the following is a correct way to write the value 0xAA33 to the physical memory address 0x1234?
ueessttiioon

A. uint16_t* p= (uint16_t *) 0xAA33; p = 0x1234;


B. uint16_t p= (uint16_t) 0x1234; p = 0xAA33;
C. *(uint16_t * const)(0x1234) = 0xAA33;
D. uint16_t* p= (uint16_t *) 0x1234; p = 0xAA33;
E. *(uint16_t * const)(0xAA33) = 0x1234;

Q
Quueessttiioon 6 - Which of the following best describes POP operation?
n 226

A. Memory content for the bottom of the stack is written to the register in the instruction, then pointing location is incremented by 4.
B. Memory content for the top of the stack is written to the register in the instruction, then pointing location is decremented by 4.
C. Memory content for the bottom of the stack is written to the register in the instruction, however, pointing location is not changed.
D. Memory content for the bottom of the stack is written to the register in the instruction, then pointing location is decremented by 4.
E. Memory content for the top of the stack is written to the register in the instruction, then pointing location is incremented by 4.

Q
Quueessttiioon
n 2277 - What is the purpose of a Sample and Hold circuit for an ADC?

A. It samples multiple times before conversion and takes the median


B. It samples multiple times before conversion and takes the average
C. It acts as a post amplifier to increase the signal levels
D. It makes sure the signal stays same during the conversion
E. Its sample time is higer for better accuracy

Q
Quueessttiioon
n 228
8 - Which of the following is an example real-time system that can be used for an avionics weapon delivery system in which pressing a
button launches a missile?

A. Hard real-time systems


B. Middle real-time systems
C. Soft real-time systems
D. Firm real-time systems

Q
Quueessttiioon 9 - Which of the following is the most portable way to declare a C preprocessor constant for the number of seconds in a non-leap calendar
n 229
year?

A. #define SECONDS_PER_YEAR (60 * 60 * 24 * 365UL)


B. #define SECONDS_PER_YEAR 60 * 60 * 24 * 365;
C. #define SECONDS_PER_YEAR (60 * 60 * 24) * 365
D. #define SECONDS_PER_YEAR (60 * 60 * 24 * 365)
E. #define SECONDS_PER_YEAR 60 * 60 * 24 * 365

Q
Quueessttiioon
n 330
0 - Which of the following is not a valid exception state?

A. Suspended
B. Inactive
C. Pending
D. Active and Pending
E. Active

Q
Quueessttiioon
n 3311 - What is the purpose of a Watchdog Timer?

A. To be used as a delay in OS applications.


B. To detect and overcome any lockup situations
C. To watch a given register and count how many times it changed
D. To provide a general purpose counter
E. To handle context switching

Q
Quueessttiioon
n 3322 - Which of the following is a memory usage mechanism that allows users to dynamically allocate space?

A. Page
B. Heap
C. Stack
D. Book
E. Scratchpad

Q
Quueessttiioon
n 3333 - WHich one of the following is the responsibility for a minimal RTOS?

A. User Interface
B. Task scheduling
C. Input/Output services
D. Logging
E. Memory protection

Q
Quueessttiioon
n 334
4 - How does I2C devices know that there is a transmission happening?

A. When there is a high-to-low transition on data line when clock line is high
B. When there is a 1 bit sent
C. When the chip select line is activated
D. When there is a low-to-high transition on data line when clock line is high
E. When there is a 0 bit sent

Q
Quueessttiioon
n 3355 - Which of the following is not a common memory section?

A. text
B. array
C. stack
D. data
E. bss

Q
Quueessttiioon
n 336
6 - Which of the following is a memory usage mechanism that allows the system memory to be used as temporary data storage?

A. Stack
B. Page
C. Heap
D. Book
E. Scratchpad

Q
Quueessttiioon
n 3377 - Which of the following can be defined as the specific arrangements of the registers, ALUs, FSMs, memories and other logic building
blocks?

A. Microcontroller
B. Pipeline
C. Processor
D. Microarchitecture
E. Instruction Set Architecture

Q
Quueessttiioon
n 338
8 - What are the first two addresses of the Vector Table?

A. Stack Pointer, Link Register


B. Stack Pointer, Reset Vector
C. Program Counter, Link Register
D. Program Counter, Stack Pointer
E. Link Register, Reset Vector

Q
Quueessttiioon
n 339
9 - Which of the following can be defined as the programmer’s view of the computer?

A. Pipeline
B. Instruction Set Architecture
C. Microcontroller
D. Processor
E. Microarchitecture

Q
Quueessttiioon
n440
0 - What is starving?

A. Functions (or tasks) not getting compiled at compile-time due to size optimization.
B. Functions (or tasks) not getting compiled at compile-time due to speed optimization.
C. Functions (or tasks) not getting compatible parameters on run-time.
D. Functions (or tasks) not having enough time to run.
E. Functions (or tasks) not getting the necessary parameters on run-time.

You might also like