Tags:
create new tag
view all tags

Mid - Semester Quiz

Embedded Systems course

General remarks:

In the following quiz more than one answer may be correct or all of the answers may be wrong.

Linux commands

  1. You have downloaded the file yesterday.txt into your Downloads directory, which is a sub-directory of your home directory, as is the directory exercises.
    You want to copy this file into the exercises/solutions/exercise_2
    First you do:

    cd ~/exercises/solutions/exercise_3

    Which of the following commands will copy the file as desired?

  • cp ~/Downloads/yesterday.txt .

  • cp $HOME/Downloads/yesterday.txt .

  • cp $HOME/Downloads/yesterday.txt ..

  • cp ~/Downloads/yesterday.txt exercises/solutions/exercise_2

  • cp ~/Downloads/yesterday.txt $HOME/exercises/solutions/exercise_2

  • cp ~/Downloads/yesterday.txt ~/exercises/solutions/exercise_2

  1. You are the super user and you do:

    cd /
    rm -rf

    This will:

  • print “permission denied” and do nothing

  • remove a file named ‘*’

  • wipe your complete operating system off the disk including all user files

  • delete all files in the / directory except of directory files and their contents

  1. You type:

    ls ~/Downloads > downloads.txt

    What will it print?

  • All the file names in your Download directory

  • nothing, but it will create an empty file named downloads.txt

  • nothing, but it will create a file named downloads.txt with all the names of the files in ~/Downloads in it

  • it will count the number of files you have in your Downloads directory

C programming

  1. What does this function do?

    sine.png

  • It calculates and returns the value of the sin function of an angle, which must be given in degrees (the angle parameter must be a double value in degrees)

  • It calculates and returns the value of the sin function of an angle, which must be given radians (the angle parameter must be a double value in radians)

  • It returns an error message

  • It is simply plain wrong and does not compile

  1. Here is an add function and its calling main program in a single file . The file is named “add.c”. What does this program do?


    add.png

  • It fails because the main program does not call the add function

  • It fails because the main program should call the add function with the right variable names num1 and num2 and not val1 and val2

  • It prints 6.0000 + 7.0000 = 13.0000

  • If does not compile because the add function must be in a different file

  • It does not compile because there is no add.h include file

  1. Pointers
    You declare a pointer in this way:

    char *helloWorld=”Hello World!”;
    char *helloPtr = helloWorld;

    What is the value of the helloPtr?
  • The address of the character ‘H’

  • The character H, which has the hex value of 0x48

  • It contains all the characters of the string “Hello World!”

  • The same value as helloWorld

  • none of the above

The Raspberry Pi

  1. What is gpio?

  • a General Purpose Input Output pin

  • the name of a command defined in the wiringPi library

  • a Generalized Peripheral Interface Option

  • The Raspberry Pi does not have such a thing

  1. What is the I2C bus?
  • A university shuttle bus taking Uli to the I2C hostel

  • An industry standard serial bus with only 3 connections:

    • Vcc

    • ground

    • a signal pin

  • An industry standard bus with 4 connections:

    • Vcc

    • ground

    • a data line (SDA)

    • a clock line (SCL)

  • The parallel bus connecting the CPU to memory and/or peripherals

  • none of the above

Understanding data sheets

Please read the attached data sheet and find out what the device does

  • It is an April’s joke of a Sygnetics engineer and it is complete nonsense

  • It is a device that is used to store non-volatile information in a micro-controller chip such as the ARM processor we use on the Raspberry Pi

  • It is a memory type specially designed for embedded systems

  • It is a memory type used within sensors

Good luck!

Solutions:

The correct answers are highlighted in blue.

-- Uli Raich - 2017-11-15

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng add.png r1 manage 20.1 K 2017-11-15 - 16:14 UnknownUser  
PNGpng sine.png r1 manage 14.2 K 2017-11-15 - 16:16 UnknownUser  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2017-11-16 - uli
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback