Embedded System Trivia Quiz!

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Adeel Ahmad
A
Adeel Ahmad
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,650
Questions: 15 | Attempts: 1,650

SettingsSettingsSettings
Embedded System Trivia Quiz! - Quiz

.


Questions and Answers
  • 1. 

    SFRs are used for:

    • A.

      Storing variables

    • B.

      Storing static variables

    • C.

      Creating dynamic variable

    • D.

      Configuring peripherals

    Correct Answer
    D. Configuring peripHerals
    Explanation
    SFRs, or Special Function Registers, are used for configuring peripherals. These registers are specific to a microcontroller and are used to control and interact with various hardware peripherals such as timers, UART, ADC, GPIO, etc. They provide a way to configure and control the behavior of these peripherals by writing or reading specific values to/from these registers. Therefore, the correct answer is "Configuring peripherals".

    Rate this question:

  • 2. 

    To flash an LED @ 5Hz, the ON/OFF time (in ms) for the LED shall be

    • A.

      100/200

    • B.

      200/200

    • C.

      200/300

    • D.

      100/100

    Correct Answer
    D. 100/100
    Explanation
    To flash an LED at 5Hz, the LED needs to turn on and off 5 times per second. This means that the LED should have a cycle time of 1/5 seconds or 200ms. Since the LED needs to be on for half of the cycle and off for the other half, the ON/OFF time for the LED should be equal, which is 100ms. Therefore, the correct answer is 100/100.

    Rate this question:

  • 3. 

    We want to round off x, afloat, to an int value, The correct way to do is

    • A.

      Y = (int)(x + 0.5)

    • B.

      Y = int(x + 0.5)

    • C.

      Y = (int)x + 0.5

    • D.

      Y = (int)((int)x + 0.5)

    Correct Answer
    A. Y = (int)(x + 0.5)
    Explanation
    To round off a float value x to an int value, the correct way is to add 0.5 to x and then cast the result to an int. This is done in the expression y = (int)(x + 0.5). By adding 0.5, we ensure that the decimal part of x is properly accounted for in the rounding process. Casting the result to an int truncates the decimal part, giving us the rounded off int value.

    Rate this question:

  • 4. 

    The following program fragment  char xyz[3][4] = {“bag”, “set”, “hat”}; char (*ptr)[4] = xyz; putchar(* (xyz[1] + 1));

    • A.

      Prints a

    • B.

      Prints b

    • C.

      Prints h

    • D.

      Prints e

    • E.

      Prints t

    Correct Answer
    D. Prints e
    Explanation
    The program fragment initializes a 2-dimensional character array called xyz with three strings: "bag", "set", and "hat". It then declares a pointer to an array of 4 characters called ptr and assigns it the address of the first element of xyz. The expression *(xyz[1] + 1) is equivalent to *(ptr + 1), which accesses the second character of the second string in xyz, which is 'e'. Therefore, the program prints 'e'.

    Rate this question:

  • 5. 

    Which of the following data structure can be used to search an element in constant time?

    • A.

      Binary Search Tree

    • B.

      Hash Table

    • C.

      Priority Queue

    • D.

      Expression Tree

    • E.

      Linked List

    Correct Answer
    B. Hash Table
    Explanation
    A hash table can be used to search an element in constant time because it uses a hash function to map the element's key to its corresponding index in the table. This allows for direct access to the element, making the search operation efficient. In a properly implemented hash table, the time complexity for searching an element is O(1), regardless of the size of the data structure.

    Rate this question:

  • 6. 

    If the machine in which the following program is executed is little-endian void main() {           int y=0x12530001;           printf("%X", (*(char *)&y)); } the output will be   

    • A.

      01

    • B.

      00

    • C.

      12

    • D.

      Compile error

    • E.

      Garbage value

    Correct Answer
    A. 01
    Explanation
    The program is using a pointer to access the memory address of the integer variable 'y' as a character pointer. Since the machine is little-endian, the least significant byte of the integer 'y' (0x01) will be printed first. Therefore, the output will be '01'.

    Rate this question:

  • 7. 

    The output of the following section of code is: unsigned int x = ~((unsigned int)0xc5); printf(“0x%x”, x);

    • A.

      0x3a

    • B.

      0xff3a

    • C.

      0x5c

    • D.

      0x3aff

    Correct Answer
    B. 0xff3a
    Explanation
    The code starts by assigning the bitwise complement of the hexadecimal value 0xc5 to the unsigned int variable x. This means that all bits in the hexadecimal value are flipped. Then, the printf statement prints the value of x in hexadecimal format. The correct answer, 0xff3a, is the hexadecimal representation of the bitwise complement of 0xc5.

    Rate this question:

  • 8. 

    If n has the value 3, then the statement a[++n] = n++ ;

    • A.

      Assigns 3 to a[5]

    • B.

      Assigns 4 to a[5]

    • C.

      Assigns 4 to a[4]

    • D.

      Compile error

    Correct Answer
    C. Assigns 4 to a[4]
    Explanation
    The given statement assigns the value of n (which is 3) to a[4]. The prefix increment operator (++n) increments the value of n by 1 before it is assigned to a[4]. The postfix increment operator (n++) increments the value of n by 1 after it is assigned to a[4]. Therefore, the value of n becomes 4 and it is assigned to a[4].

    Rate this question:

  • 9. 

    In an architecture with an int type equal to 2 bytes, the output of the following piece of code is unsigned int *x; printf(“%x,”, x); *x = 5; x++; printf(“%x”, x);   

    • A.

      Bff5a400,bff5a401

    • B.

      Bff5a400,bff5a402

    • C.

      Bff5a400,bff5a404

    • D.

      Bff5a400,6

    • E.

      Compiler error

    Correct Answer
    B. Bff5a400,bff5a402
    Explanation
    The code declares a pointer variable `x` of type `unsigned int`. Since the architecture has an `int` type equal to 2 bytes, the size of `unsigned int` is also 2 bytes.

    In the first `printf` statement, the address of `x` is printed using `%x` format specifier. This will print the hexadecimal representation of the memory address of `x`, which is `bff5a400`.

    Then, `*x = 5` assigns the value 5 to the memory location pointed to by `x`.

    After that, `x++` increments the value of `x` by the size of `unsigned int`, which is 2 bytes. So, the new address pointed to by `x` is `bff5a402`.

    In the second `printf` statement, the new address of `x` is printed, which is `bff5a402`.

    Rate this question:

  • 10. 

    What will be the output of the following:   int a = 1; while(a) {     printf("value of a: %d", a--); } do {           printf("value of a: %d\n", a--); }while(a);

    • A.

      Value of a: 1

    • B.

      Value of a: 1 value of a: 1

    • C.

      Value of a: 1 value of a: 0

    • D.

      Value of a: 0 value of a: -1

    Correct Answer
    C. Value of a: 1 value of a: 0
    Explanation
    The output of the code will be "value of a: 1" and "value of a: 0".

    In the first part of the code, the while loop will execute as long as the condition "a" is true. Since "a" is initially set to 1, the loop will execute once and print "value of a: 1". Then, the value of "a" is decremented by 1.

    In the second part of the code, the do-while loop will execute at least once before checking the condition. Since "a" is now 0, the loop will execute once and print "value of a: 0". Then, the value of "a" is decremented by 1 again. Since "a" is now -1, the condition of the do-while loop is false and the loop terminates.

    Rate this question:

  • 11. 

    If the frequency is reduced by half, the dynamic power will

    • A.

      Remain same

    • B.

      Double

    • C.

      Reduce to half

    • D.

      Reduce to 1/4th

    Correct Answer
    C. Reduce to half
    Explanation
    When the frequency is reduced by half, the dynamic power will also reduce by half. This is because dynamic power is directly proportional to the frequency. As the frequency decreases, the number of clock cycles per second decreases, resulting in a decrease in the power consumed by the circuit. Therefore, the dynamic power will reduce to half when the frequency is reduced by half.

    Rate this question:

  • 12. 

    :The collector-base junction in a transistor has:

    • A.

      Forward bias at all times

    • B.

      Reverse bias at all times

    • C.

      Low resistance

    • D.

      None of the above

    Correct Answer
    B. Reverse bias at all times
    Explanation
    The collector-base junction in a transistor is always reverse biased. This means that the collector terminal is at a higher voltage than the base terminal. Reverse biasing helps to control the flow of current in the transistor. It creates a depletion region at the junction, preventing the flow of majority carriers (electrons in an NPN transistor). This allows the transistor to operate in its active region, where it can amplify and control currents effectively. Forward biasing the collector-base junction would lead to excessive current flow and potentially damage the transistor.

    Rate this question:

  • 13. 

    In the diagram shown below if Vin = 10V, what will be the voltage across resistor Vout after an infinite time?

    • A.

      7.5V

    • B.

      10V

    • C.

      0V

    • D.

      5V

    Correct Answer
    C. 0V
    Explanation
    The voltage across resistor Vout will be 0V after an infinite time because the circuit shown in the diagram is a voltage divider circuit. In a voltage divider circuit, the voltage across the resistor is determined by the ratio of the resistance of the resistor to the total resistance in the circuit. In this case, the resistor Vout is connected in parallel with a short circuit, which means that the total resistance in the circuit is effectively 0Ω. Therefore, the voltage across the resistor Vout will be 0V.

    Rate this question:

  • 14. 

    To tune a parallel resonant circuit to a higher frequency, the capacitance should be

    • A.

      Increased

    • B.

      Left alone

    • C.

      Decreased

    • D.

      Replaced with inductance

    Correct Answer
    C. Decreased
    Explanation
    To tune a parallel resonant circuit to a higher frequency, the capacitance should be decreased. This is because in a parallel resonant circuit, the frequency of resonance is determined by the product of the inductance and capacitance. By decreasing the capacitance, the resonant frequency will increase. This can be achieved by either reducing the value of the capacitance or by replacing the capacitor with a lower value capacitor.

    Rate this question:

  • 15. 

    When the frequency of the voltage applied to a series RC circuit is decreased, the impedance:

    • A.

      Increases

    • B.

      Decreases

    • C.

      Remains the same

    • D.

      Doubles

    Correct Answer
    A. Increases
    Explanation
    When the frequency of the voltage applied to a series RC circuit is decreased, the impedance increases. This is because the impedance of a series RC circuit is inversely proportional to the frequency. As the frequency decreases, the impedance increases, and vice versa.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 03, 2017
    Quiz Created by
    Adeel Ahmad
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.