CS 16 (101) Spring 2009 Test #1 Answers

1.       F  -  The unsigned representation cannot handle negative numbers.

2.       A  -  First, we find the 6-bit signed representation of +8, which is 001000.  Next, we need to invert the bits and then add 1.  Inverting the bits gives us 110111, and adding 1 we obtain 111000.

3.       C  -  Colossus was the machine developed at Bletchley Park during World War II used to decipher German codes.

4.       B  -  This is the famous “Moore’s Law”, named after Gordon Moore because he was the one who made this observation in the 1960s.

5.       D  -  Remember that each hex digit = 4 bits and each octal digit = 3 bits.  The letter ‘f’ represents the number 15, which is 1111 in binary.  Thus, 0xff is an 8-bit expression:  1111 1111.  To convert this into octal, we need to group the bits in threes, working from right to left.  The grouping looks as follows:  11 111 111.  Each group of 3 bits represents an octal digit, so we obtain 377.

6.       D  -  If you write out this number in binary, and again remember that we’d like to arrange the bits into groups of 4 for the sake of hexadecimal shorthand, we obtain this: 

0101 0000 0000 0000 0000.  This corresponds to 50000 in hex.

7.       C  -  First, we need to know what –7 looks like in the signed representation.  +7 in 5 bits would look like this:  00111.  Then we invert the bits:  11000, and then we add 1:  11001.  Now, we need to interpret 11001 as a sign-magnitude number.  The first thing to notice is that the leftmost bit is 1, which means it’s a negative number.  The remaining 4 bits represent the magnitude of the number, and 1001 is the binary form of the number 9.  Thus, our number is –9.

8.       D  -  In Excel, whenever you see a ‘$’ in front of a column or row in a cell reference, this means that the particular column or row will not change when you copy the formula.  In this case, we want to copy the formula one row down and one column to the right.  Thus we need to “add one” to the row and column, except for where you see the ‘$’.  The original formula is

=$C4 + C5.  The first C will not change.  But the ‘4’ changes to ‘5’, the second ‘C’ changes to ‘D’ and the ‘5’ changes to ‘6’.  Thus, the new formula is $C5 + D6.

9.       D  -  Pixelation means that the pixels have gotten so large that we can easily see them.  This occurs when the resolution is too low.

10.   E  -  The first condition asks whether C5<D5.  Plugging in the numbers, we see that 10 < 8 is false.  Therefore, we need to look at the “value if false”, which is another if formula.  Next, we evaluate the condition, which asks if C5<2*D5.  In other words, if 10 < 2*8.  This is true.  The value if true is 2*C5 = 2*10 = 20.

11.   D  -  The number 11 (eleven) in binary is 1011.  To divide by 64 means we divide by 2 six times.  Every time we divide by 2, the ‘.’ point moves one position to the left.  Therefore, our answer is 1011 with the point moved 6 places to the left, which gives us .001011.

12.   C  -  Pie charts are used to show portions of a whole, as in percentages.

13.   D  -  The basic formula to determine execution time is :
time = (# inst) * (CPI) / (clock rate).  If we look at the numerator first, we have 1 million instructions and 3 cycles per instruction, so this is 3 million cycles.  The denominator is 500 million cycles per second.  Dividing we obtain 3/500 second = 6 milliseconds.

14.   E  -  A formula will change if what we are deleting is either inside the range we are summing, or to the left, or above the range.  Looking closely at the answer choices, we see that row 2 is inside our range and column D is to the left of the range.  Deleting either of these will change our formula.  Note that deleting anything below or to the right will have no effect.

15.   C  -  Double clicking the border between 2 columns will make the first column exactly wide enough to fit the widest data in that column.  Try it the next time you’re in Excel.  J

16.   C  -  To choose a noncontiguous range, hold down on the control key while selecting the second part.  If you hold down on the shift key instead, you will actually select everything in between, which is probably more than what you want.

17.   C  -  Sequential access is used for tape.  The tape drive can only go backwards or forwards unlike a disk drive that can operate in 2 or 3 dimensions.  Remember that in general, direct access is used for disks and random access is used for RAM, cache and flash memory.

18.   D  -  CD-ROM and floppies are types of disk technology.  RAM is not.

19.   F  -  Save means to copy information from RAM to disk.  Note that going in the opposite direction basically means we “open” a file.  To copy information from RAM to CPU is usually called a load or a fetch.  And moving data from CPU back to RAM is usually called a store.

20.   A  -  In ASCII code, the codes for the letters are in consecutive order.  It is also case sensitive, which means ‘a’ and ‘A’ have different values.    A general feature of any code is that each type of character (including invisible ones like tabs, spaces and control characters) should be assigned a different value; otherwise the computer would not be able to distinguish them.

21.   D  -  In the 500-page book, each page has about 2 KB of text.  An indexed color image uses 1 byte per pixel, so 60,000 pixels would give us about 60 KB (slightly less).  So we have approximately 62 KB of information on each page.  Multiply by 500 and we have a little under 31 MB of information in all.

22.   E  -  ‘M’ is the 13th letter of the alphabet, so its code should be 12 higher than that of ‘A’.  65 + 12 is 77.

23.   E  -  These ideas are by John von Neumann.  (Remember:  Fetch, decode, execute)

24.   B  -  Duplicating information means we want to “copy”, and if we don’t want to change cell references in the formula, we must specify them using absolute addresses.  Absolute addresses are the ones that include the ‘$’, as in $B$7.  A reference without ‘$’ like B7 is called a relative reference.  A reference with only one $ such as $B7 or B$7 is called a mixed reference.

25.   E  -  Excel is very flexible with editing charts.  You can do all of these things after the chart is created:  changing what data the chart is based on, chart type, and cosmetic changes such as inserting eyecatchers or text boxes.

26.   C  -  Note that in this question, we are using relative addresses.  If we insert a new row above the formula, then the row numbers in the current formula will become 1 higher.   Thus, =B3 + C4 becomes =B4 + C5.  The column references in the formula do not change.

27.   C  -  Notice that the second parameter to the vlookup formula is a range of cells.  This is where are grading scale is.  The last parameter is a number.  The meaning of this number is to tell us which column in the grading scale contains our result.  If the first column of the table is C and we want the 3rd column, this is column E.

28.   A  -  The mantissa is used to precisely specify a specific real number once we have decided on the sign and power of 2.  Looking at some of the answer choices, we can see that (a) defines the mantissa, (b) talks about the mantissa, and (c) describes the sign bit.

29.   C  -  The given range contains these values:  1, 2, 4, 5, 7, 8.  The countif function is asking how many of these values are less than or equal to 6.  The answer is 4.

30.   C  -  In the signed representation, if we want the largest number, we know this must be a positive number, so the first bit needs to be 0.  The rest of the bits are 1.

31.   E  -  BCD is similar to hexadecimal.  The idea is that every 4 bits represents a decimal digit 0-9.  For a BCD to be invalid, we would have a digit value that is out of range.  In other words, bigger than 9.  In answer choice E, the first digit’s value is 1011 = eleven, which is not possible.

32.   D  -  Overflow means our mathematical answer is beyond the range of what can be represented.  Its magnitude is too large.  This can happen for positive or negative numbers.  On the other hand, getting too close to zero is called underflow.

33.   A  -  Let’s look at each statement a-c.  The first statement says we only have a finite number of values that can be represented.  If this wasn’t the case, we’d need an infinite amount of memory.  So (a) is definitely true.  Concerning (b), we know that there are about 8 million representable values (in single precision) between each two consecutive powers of 2.  But since the powers of 2 get farther apart as they increase, this means the density of representable values becomes more sparse.  Thus, (b) is false.  Finally, we remember that we have 8 bits for the exponent and 23 for the mantissa, so (c) isn’t even close.  So, (a) is the only correct statement.

34.   D  -  In unsigned, the largest number is 2n – 1.  Here, n = 32.  Remember our shortcut to estimating large powers of 2.  32 = 30 + 2.  So, our answer is approximately 230 times 22 which is about 1 billion times 4, or 4 billion.

35.   B  -  In the fetch/decode/execute cycle, the step before executing is decoding.

36.   C  -  12 in binary is 1100.  We handle the 0.6 separately. 

.6 * 2 = 1.2

.2 * 2 = 0.4

.4 * 2 = 0.8

.8 * 2 = 1.6

.6 * 2 = 1.2  And at this point we see that we are repeating a pattern.  So the four bits “1001” repeat after the ‘.’  So our answer is 1100.1001 1001 1001 1001 …  (Or you could simply put a bar over the 1001.)

37.   D  -  RAM is smaller than the hard drive, and requires electricity.  This is why you need to “save” your files before losing power.  The registers are inside the CPU, which is not part of RAM.

38.   F  -  In our first lab, we saw that if we put a 1 at the right end of an unsigned number, this has the effect of doubling the number and adding 1.  In other words, x becomes 2x + 1.  In this question, we are doing this operation twice.  This result 2x + 1 is itself doubled and we add 1:  2(2x + 1) + 1 = 4x + 3.  Mathematically we could say it this way: 

f(x) = 2x + 1, so f(f(x)) = 2(2x + 1) + 1 = 4x + 3.

39.   A  -  Hexadecimal uses 16 total digit symbols.  The first ten are 0-9, so the remaining six come from letters of the alphabet, a-f.  The digit ‘a’ corresponds to 10, so if we count up we see that the value of ‘f’ is 15. 

40.   E  -  A pivot table is essentially a two-dimensional subtotal.

41.   A  -  We want to use absolute references for numbers that are constant, and relative references for numbers that change.  In this case, we want the interest rate to change, so it is the relative reference, while the principal and term are absolute.

42.   D  -  Once we have read the bits “100”, we are now in state C.  From state C, it turns out that we have no hope of ever going back to B (the accept state):  we can only wind up in state C or state D.  Thus, the word cannot be accepted no matter what the subsequent bits are.

43.   E  -  Noting that the accept state is C, we have to try each word to see which one arrives in state C when we are finished reading it.  Eventually, we find that 101001 does finish in state C, while the other 5 words do not.

44.   F  -  The given machine is designed to accept input strings that start with “00”.  The accept state is C.  So, if we read a word and wind up in state C, we know that our word begins with “00”.  This means that if we read a word and finish in any other state, we know the word did not begin with “00”.  So, to change the machine to accept this complement language, we need to change the accept states to be these other states, A, B and D.

45.   D  -  We are told that we need exactly 7 bits to write down a binary number.  To convert to hex, we need 8 bits because 8 is a multiple of 4.  If you change a 7 bit number into 8 bits, the new bit on the left end of the number is 0.  The 2nd of these 8 bits (or first of the original 7) must be a 1, or else 6 bits would have sufficed.  The first 4 bits of our 8 bit value would be:  0100, 0101, 0110 or 0111.  In hex, these are the values 4-7.

46.   A  -  The number of cycles = (# inst) + (# stages) – 1 = 20 + 5 – 1 = 24.

47.   B  -  The relationship between the clock cycle period and the clock rate is that they are reciprocals of each other.  Thus, all we need to do is to take the reciprocal of 10 microseconds.  How many seconds is this?  A microsecond is 10-6 second, so 10 of these would give us 10-5 second.  Its reciprocal is 105 cycles per second = 100 KHz.

48.   A  -  The question tells us that the output of an XOR gate is 1.  This means that the two input values, x’ and y, are different.  The two possible cases are x’ = 0 and y = 1, or x’ = 1 and y = 0.  But x’ is just the opposite of x.  Thus, x and y are the same.

49.   D  -  The counta function asks how many cells in a range are not blank.  In this case the answer is 9.

50.   E  -  Our formula is a fraction.  The numerator of our fraction is the number of each type of house in each state.  In this case, we want both the row and column to change as we copy the formula, so use a relative reference, i.e. f2.  For the denominator, we want just the total number of houses in a state.  In this case, we want just the row to change, not the column, so we need a mixed reference where the ‘$’ sign is in front of the column.  Thus, our formula is =f2/$e2.