Tags:
tag this topic
create new tag
view all tags
<p align="center"><font face="Liberation Sans, sans-serif"><font size="6"> *Mid - Semester Quiz* </font></font></p> <h2 align="center">Embedded Systems course</h2> <h2 align="left">General remarks:</h2> <p align="left">In the following quiz more than one answer may be correct or all of the answers may be wrong.</p> <h2 align="left">Linux commands</h2> 1 <p align="left">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.<br /> You want to copy this file into the exercises/solutions/exercise_2<br /> First you do:<br /><br /> <font face="Courier New, monospace">cd </font><font face="Courier New, monospace">~/</font><font face="Courier New, monospace">exercises/solutions/exercise_3<br /><br /> </font><font face="Liberation Serif, serif" size="3"> *Which of the following commands will copy the file as desired?* </font></p> * <p align="left"><font face="Courier New, monospace"><font size="3">%BLUE%cp ~/Downloads/yesterday.txt%ENDCOLOR% .</font></font></p> * <p align="left">%BLUE%<font face="Courier New, monospace"><font size="3">cp $HOME/Downloads/yesterday.txt .</font></font>%ENDCOLOR%</p> * <p align="left"><font face="Courier New, monospace"><font size="3">cp $HOME/Downloads/yesterday.txt ..</font></font></p> * <p align="left"><font face="Courier New, monospace"><font size="3">cp ~/Downloads/yesterday.txt exercises/solutions/exercise_2</font></font></p> * <p align="left">%BLUE%<font face="Courier New, monospace"><font size="3">cp ~/Downloads/yesterday.txt $HOME/exercises/solutions/exercise_2</font></font>%ENDCOLOR%</p> * <p align="left">%BLUE%<font face="Courier New, monospace"><font size="3">cp ~/Downloads/yesterday.txt ~/exercises/solutions/exercise_2</font></font>%ENDCOLOR%</p> <ol start="2"> <li> <p align="left"><font face="Liberation Serif, serif"><font size="3"> *You are the super user and you do:* </font></font></p> <p align="left"><font size="3"><font face="Courier New, monospace">cd /<br /> rm -rf <b><br /></b></font><font face="Liberation Serif, serif"><br />This will: </font></font></p> </li> </ol> * <p align="left"><font face="Liberation Serif, serif"><font size="3">print “permission denied” and do nothing</font></font></p> * <p align="left"><font face="Liberation Serif, serif"><font size="3">remove a file named ‘*’</font></font></p> * <p align="left">%BLUE%<font face="Liberation Serif, serif"><font size="3">wipe your complete operating system off the disk including all user files</font></font>%ENDCOLOR%</p> * <p align="left"><font face="Liberation Serif, serif"><font size="3">delete all files in the / directory except of directory files and their contents</font></font></p> <p align="left"> </p> <ol start="3"> <li> <p align="left"><font face="Liberation Serif, serif"><font size="3"> *You type:* </font></font></p> <p align="left"><font face="Courier New, monospace"><font size="3">ls ~/Downloads > downloads.txt<br /><br /> <font face="Liberation Serif, serif"> *What will it print?* </font></font></font></p> </li> </ol> * <p align="left"><font face="Liberation Serif, serif"><font size="3">All the file names in your Download directory</font></font></p> * <p align="left"><font face="Liberation Serif, serif"><font size="3">nothing, but it will create an empty file named downloads.txt</font></font></p> * <p align="left">%BLUE%<font face="Liberation Serif, serif"><font size="3">nothing, but it will create a file named downloads.txt with all the names of the files in ~/Downloads in it</font></font>%ENDCOLOR%</p> * <p align="left"><font face="Liberation Serif, serif"><font size="3">it will count the number of files you have in your Downloads directory</font></font></p> ---++ C programming 1 <p><b>What does this function do?<br /><br /><img alt="sine.png" height="172" src="%ATTACHURL%/sine.png" title="sine.png" width="439" /><br /></b></p> * <p>%BLUE%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)%ENDCOLOR%</p> * <p>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)</p> * <p>It returns an error message</p> * <p>It is simply plain wrong and does not compile</p> <ol start="2"> <li> *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?* <b><br /></b><img alt="add.png" height="226" src="%ATTACHURL%/add.png" title="add.png" width="380" /> </li> </ol> * <p>It fails because the main program does not call the add function</p> * <p>It fails because the main program should call the add function with the right variable names num1 and num2 and not val1 and val2</p> * <p>%BLUE%It prints 6.0000 + 7.0000 = 13.0000%ENDCOLOR%</p> * <p>If does not compile because the add function must be in a different file</p> * <p>It does not compile because there is no add.h include file<br /><br /></p> <ol start="3"> <li><b>Pointers<br /></b>You declare a pointer in this way:<br /><br /><font face="Courier New, monospace">char *helloWorld=”Hello World!”;<br /> </font><font face="Courier New, monospace"><font size="3">char *helloPtr = helloWorld;<br /><br /></font></font><font face="Liberation Serif, serif"><font size="3"><b>What is the value of the helloPtr</b></font><font face="Liberation Serif, serif"><b>?</b></font> </font></li> </ol> * <p>%BLUE%<font face="Liberation Serif, serif"><font size="3">The address of the character ‘H’</font></font>%ENDCOLOR%</p> * <p><font face="Liberation Serif, serif"><font size="3">The character H, which has the hex value of 0x48</font></font></p> * <p><font face="Liberation Serif, serif"><font size="3">It contains all the characters of the string “Hello World!”</font></font></p> * <p>%BLUE%<font face="Liberation Serif, serif"><font size="3">The same value as helloWorld</font></font>%ENDCOLOR%</p> * <p><font face="Liberation Serif, serif"><font size="3">none of the above</font></font></p> ---++ The Raspberry Pi 1 <p> *What is gpio?* </p> * <p>%BLUE%a <b>G</b>eneral <b>P</b>urpose<b> I</b>nput<b> O</b>utput pin%ENDCOLOR%</p> * <p>%BLUE%the name of a command defined in the wiringPi library%ENDCOLOR%</p> * <p>a <b>G</b>eneralized <b>P</b>eripheral <b>I</b>nterface <b>O</b>ption</p> * <p>The Raspberry Pi does not have such a thing</p> <ol start="2"> <li> *What is the I2C bus?* </li> </ol> * <p>A university shuttle bus taking Uli to the I2C hostel</p> * <p>An industry standard serial bus with only 3 connections:</p> * <p>Vcc</p> * <p>ground</p> * <p>a signal pin</p> * <p>%BLUE%An industry standard bus with 4 connections:%ENDCOLOR%</p> * <p>Vcc</p> * <p>ground</p> * <p>a data line (SDA)</p> * <p>a clock line (SCL)</p> * <p>The parallel bus connecting the CPU to memory and/or peripherals</p> * <p>none of the above</p> ---++ Understanding data sheets Please read the [[http://www4.vmi.edu/faculty/squirejc/Research/IC_Datasheets/digital_cmos/Write%20Only%20Memory.pdf][attached data sheet]] and find out what the device does * <p>%BLUE%It is an April’s joke of a Sygnetics engineer and it is complete nonsense%ENDCOLOR%</p> * <p>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</p> * <p>It is a memory type specially designed for embedded systems</p> * <p>It is a memory type used within sensors</p> <p align="center"><font face="Liberation Sans, sans-serif"><font size="6"> *Good luck!* </font></font></p> <h2 align="left">Solutions:</h2> The correct answers are highlighted in %BLUE%blue.%ENDCOLOR% -- %USERSIG{UliRaich - 2017-11-15}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
add.png
r1
manage
20.1 K
2017-11-15 - 16:14
UnknownUser
png
sine.png
r1
manage
14.2 K
2017-11-15 - 16:16
UnknownUser
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r3 - 2017-11-16
-
uli
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
Embedded_Systems Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback