9 February 2011 CSE-1520R Test #1 [B4] p. 1 of 8
Sur / Last Name:
Given / First Name:
• Instructor: Parke Godfrey
• Exam Duration: 45 minutes
• Term: Winter 2011
The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.
There are ﬁve parts, each with questions. Points for each question are as indicated. Each question
is multiple choice, true/false, or ﬁll in the blank, as indicated.
For multiple choice, choose the one best answer. There is no negative penalty for a wrong answer.
Assume that any number you see is in decimal (base 10), unless it is clear otherwise.
The test is out of 50 points.
Total /50 9 February 2011 CSE-1520R Test #1 [B4] p. 2 of 8
1. (10 points) Binary & Number Systems
a. (2 points) You see the byte 01101100. You know it represents
A. the ASCII character ‘l’ (lowercase ‘L’).
B. the natural number 108.
C. the negative integer −20
D. the ﬂoating point number 3.0.
E. There is not enough information to determine.
b. (2 points) A natural way to “store” positive and negative (signed) integers in a byte
would seem be to use the most signiﬁcant bit as a sign bit—say, 1 means positive and
0 means negative—and encode the magnitude of the integer in the remaining seven bits
in direct binary representation.
This is not done, though, because
A. we are not allowed to use the most signiﬁcant bit ever.
B. this encodes twice as many positive integers as negative, which is awkward.
C. addition would be impossible with this format.
D. one would have two diﬀerent representations.
E. zero would have two diﬀerent representations.
c. (4 points) Fill in the blanks.
byte format value
8-bit ﬂoating point 61
11111110 8-bit signed integer, 2’s complement
d. (2 points) Consider storing signed integers in 16 bits in two’s complement format. The
largest integer that can be represented is
F. 65,536 9 February 2011 CSE-1520R Test #1 [B4] p. 3 of 8
2. (10 points) File Systems
a. (2 points) The directory that is not contained in any other directory is called
A. the source.
B. the root directory.
E. Such a directory is not possible.
b. (4 points) Mark as true or false whether each of the following ﬁle types are likely text
ﬁles (in ASCII or Unicode).
c. (2 points) An absolute path in the ﬁle system to a ﬁle is a list of the directory (folder)
names—from the topmost directory down to the directory the ﬁle is in—followed by the
In UNIX or Mac OS, what is the ASCII code in hexadecimal of the separator character
used between the directory names in the path?
d. (2 points) What is a named collection of data, used for organizing secondary memory,
A. a disk
B. a directory
C. a ﬁle
D. a byte
E. a bit 9 February 2011 CSE-1520R Test #1 [B4] p. 4 of 8
3. (10 points) Data Representation
a. (2 points) Consider a 250×400 pixel image in RGB format with 8-bit depth per channel
stored in BMP (a direct format with no compression or meta-data). The ﬁle size in
b. (2 points) Recording (analog) audio in a digital format requires
A. the MP3 format.
B. that one cap the frequency band, meaning it is necessarily lossy.
C. stereo, recording in at least two channels.
D. that one use decimal, not binary, representation.
E. that one record only the deltas between frames.
c. (2 points) You encounter an ASCII ﬁle with the content
Best on the test!
(Ignore any linefeed or carriage return characters that might be in the ﬁle.)
What is the ﬁle’s size in bytes?
d. (4 points) Dr. Dogfurry gets an image ﬁle mugshot.bmp (284 × 207 pixels). BMP is a
direct format with no compression or meta-data. He uses an image converter application
to take the same image to put it into the JPG, PNG, and TXT formats (mugshot.jpg,
mugshot.png, and mugshot.txt, respectively).
JPG does a decent, lossy compression.
PNG does moderate, lossless compression.
TXT represents the RGB values in ASCII for each pixel on a separate line, for easy
reading. (E.g., 252,35: ( 40, 39, 37)#2827