Test 1
Translate each of the following binary representations into its equivalent base ten representation 1100 10001
12 17
Which of the following is not a means of repeating a block of instructions? A. Pretest loop B. Posttest loop C. Recursion D. Assignment statement
Assignment statement
Suppose the binary search algorithm was being used to search for the entry Tom in the list Nathan, Oliver, Pat, Quincy, Rodger, Stan, Tom A. What would be the first entry in the list to be considered? B. What would be the second entry in the list to be considered?
Quincy Stan
Explain why such terms as kilo, mega, and giga have acquired double meanings. Kilo, mega, and giga have double meanings because they are used as prefixes in computing and electronics. When referring to speed, these prefixes modify a base ten exponent but when referring to data storage, these prefixes modify a base two exponent
Read
Which of the following is a technique for controlling access to a critical region?
Semaphore
Which of the following is not a way of representing algorithms? A. Stepwise refinement B. Pseudocode C. Flowchart D. Programming language
Stepwise refinement
List two popular operating systems
Windows MacOS
Using a two's complement system, what value is represented by the pattern 11111111111111001
-7
Which of the following representations in two's complement notation represents the largest value? A. 00000010 B. 11110000 C. 00000001 D. 11111111
00000010
Which of the following bit patterns represents the value 9 in two's complement notation? A. 00011010 B. 11111011 C. 00001001 D. 11111011
00001001
A7DF is the hexadecimal representation for what bit pattern?
1010011111011111
Represent the bit pattern 1111010010011011 in hexadecimal notation
F49B
Which of the following is not contained in a CPU?
Memory cell
When searching within the list: Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom which of the following entries will be found most quickly using the binary search algorithm?
Pat
Which of the following is an activity? A. Algorithm B. Program C. Process
Process
The following is a routine encoded in the machine language described in the language description table. Explain (in a single sentence) what the routine does. 12A0 32B0 12A1 32B1 12A2 32B2
This routine is transferring data from memory cells A0, A1, and A2 to memory cells B0, B1, and B2 using register 2
Describe a scenario that leads to deadlock in a computer system
Two registers have info each other needs so neither can continue
Under the assumption that X takes on only integer values, which of the following is the termination condition for the following loop? repeat: ... until (X<5) A. X<5 B. X>4 C. X>5
X<5
Using a two's complement notation system in which each value is represented by a pattern of six bits, represent the value 5
000101
If register 0 contains the pattern 01101001 before executing the instruction A003 (see the language description table), what bit pattern will be in register 0 after the instruction is executed?
00101101
Assuming that each of the following bit patterns originally had even parity, which one contains an error? A. 100110100 B. 110000011 C. 010011000 D. 100011001
010011000
Rewrite each of the following values (represented in base ten notation) in binary notation 7 23
0111 10111
Which of the following representations in two's complement notation represents the largest value? A. 01000010 B. 01110000 C. 00000001 D. 01111111
01111111
What mask in register F would cause the instruction 8AAF (refer to the language description table) to put a 0 in the most significant bit of register A without disturbing the other bits?
011111111
What sequence of numbers would be printed if the following function were executed with the value of N being 0? def xxx(N): print(N) if (N<2): xxx(N+1) else: print(N) print(N)
0122210
What is the result of the following addition problem (using two's complement notation)? 00001111 +10101010 ______________
10111001
Which of the following bit patterns represents the value -9 in two's complement notation? A. 00011010 B. 111110111 C. 10001001 D. 11111011
111110111
At most, how many entries in a list of 5000 names will be interrogated when using the binary search algorithm?
13
Which of the following instructions will not produce the same result as the other two? A. 9555 B. 2500 C. 1500
1500
What sequence of numbers would be printed if the function named xxx as described below were executed with the value of N being 2? def xxx(N): print(N) if (N<3): yyy(4) print(N) def yyy(N): print (N) xxx(5) print(N)
245542
What sequence of values would be printed if the function xxx described below were executed with the value of N being 9? def xxx(N): if (N<4): print(N) yyy(7) else: yyy(2) print(N) def yyy(N): if (N<5): print(N) zzz(6) else: zzz(5) def zzz(N): if (N==5): print(7) else: print(8)
289
Which of the following instructions (as described in the language description table) places 00000000 in register A? A. 1A00 B. 2A00 C. 3A00 D. 200A
2A00
Consider the base represented by grouping five digits of a binary string and assume the same convention used in creating hexadecimal digits. In that base, what is the largest one digit number we can represent (i.e. How would we write the value of the largest one-digit value in that base?)
31
What would be printed if the following instructions were executed? X=3 while (X>0): print(X) X=X-1
321
For the base described in 106 above, convert the following hexadecimal number into that base. E7FC 1000 C3F7
32133330 01000000 30033313
For 106 above, what is the maximum three-digit value
333
Answer the following questions in terms of the function xxx below. def xxx(N): if (N<7): print(N) else: N=n+3 print(N) A. What value would be printed if the following function were executed with the value of N being 4? B. What value would be printed if the following function were executed with the value of N being 9?
4 12
At most, how many entries in a list of 5000 names will be interrogated when using the sequential search algorithm?
5000
What sequence of values will be printed when the following instructions are executed? X = 5 while (X<7): print(X) X = X+1 print(X) while (X>2): print(X) X = X-2
567753
For the base described in 106 above, what is the base 10 values of the following? 21022 10000 11111
586 256 341
What sequence of values will be printed when the following instructions are executed? X=5 if (X<7): print(6) Y=6 else: print(4) Y=4 if (Y<5): print(3) else: print(2)
62
Encode each of the following commands in terms of the machine language described in the language description table: ADD the contents of registers 5 and 6 as thought they were values in floating-point notation and leave the result in register 4
6456
When searching for the entry X within the list R, S, T, U, V, W, Z how many entries will be considered before discovering that the entry is not present? (Note that the list is in alphabetical order.)
7
Encode each of the following commands in terms of the machine language described in the language description table: AND the contents of registers 5 and 6, leaving the result in register 4
8456
Which of the following instructions (as described in the language description table) places 00000000 in register 5? A. 25FF B. 9555 C. 15FF D. 8555
9555
List three of the primitives in the pseudocode developed in this chapter (5)
Assignment Conditional selection Repeated execution
Which of the following instructions (as described in the language description table) will not change the contents of register 5? A. 1508 B. 2508 C. A503 D. A508
A508
Which of the following bit patterns (represented in hexadecimal notation) represents a negative number in two's complement notation? A. 3F B. 55 C. A6 D. 7E
A6
Encode each of the following commands in terms of the machine language described in the language description table: ROTATE the contents of register 7 to the right 5 bit positions
A705
Which of the following Boolean operations produces the output 1 for the fewest number of input patterns?
AND
Decode each of the following instructions that were encoded using the language description table: 8023
AND the bit patterns in registers 2 and 3 and put them in register 0
Which of the following lists would not be obtained at some point when applying the insertion sort algorithm to the list below? Sylvia, Nancy, Lois, Alice A. Nancy, Sylvia, Lois, Alice B. Alice, Lois, Nancy, Sylvia C. Alice, Sylvia, Nancy, Lois D. Lois, Nancy, Sylvia, Alice
Alice, Sylvia, Nancy, Lois
Which of the following best describes the NOR operation?
An OR followed by a NOT
The end of a time slice is indicted by occurrence of a signal called
An interrupt
Explain the difference between application software and system software
Apps help the user, system software dictates hardware
Which of the following instructions (as described in the language description table) is essentially an unconditional jump? A. B033 B. B133 C. B233 D. B333
B033
Encode each of the following commands in terms of the machine language described in the language description table: JUMP to the instruction at address B2 if the content of register 2 equals that of register 0
B2B2
Name three four letter words you can spell with hexadecimal digits
BEEF, DEAF, CADE
We have seen if we group a binary strung of digits into fours we get base 16, three we get base 8, etc. What base would we get if we grouped digits in groups of two?
Base 4
Execution of an operating system is initiated by a program called the
Boot loader
The following is an error-correcting code in which any two patterns differ by a Hamming distance of at least three Symbol Representation A 000000 B 001111 C 010011 D 011100 E 100110 F 101001 G 110101 H 111010 010011 101010 011000 101101
C H D F
Which of the following storage systems is best suited for storing and retrieving long strings of data that are processed in their sequential order?
CDs/DVDs
Circle the portion of the program below in which control of the loop is initialized. Draw a rectangle around the portion in which the test for termination is performed. Underline the portion in which the state of the loop is moved toward the termination condition. X=3 while (X<9): X=X+1
Circle x=3 Rectangle while (X<9) Underline X=X+1
Which of the following is a task that is not performed by the kernel of an operating system?
Communicate with the user
A section of a program that should be executed by at most one process at a time is called a
Critical region or section
Which of the following events is detrimental to an operating system's performance?
Deadlock
Which of the following components of an operating system is executed as the result of an interrupt signal?
Dispatcher
Which of the following is not an activity performed entirely within a CPU?
Fetch instructions
Which of the following mass storage system does not require physical motion?
Flash drives
Identify a flaw in the control of the following loop X=3 while (X != 8): X = X+2
If x=3, not matter how many times the code adds two x will never equal 8 so the program will loop forever
Decode each of the following instructions that were encoded using the language description table: B288
Jump to the instructions in memory cell 88 if the bit pattern in register 2=the bit pattern in register 0
When searching within the list: Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom which of the entries will be found most quickly using the sequential search algorithm?
Lewis
Decode each of the following instructions that were encoded using the language description table: 2345
Load the register 3 with the bit pattern 45
Which of the following data storage systems provides the most efficient random access to individual data items?
Main memory
Decode each of the following instructions that were encoded using the language description table: 4034
Move the bit pattern in register 3 to register 4
Multitasking in a computer with only one CPU is accomplished by a technique called
Multiprogramming
Which of the following is not an attempt to provide security?
Multitasking
Under the assumption that N takes on only integer values, which of the following is the termination condition in the following recursive function? def xxx(N): if (N<5): print(N) else: xxx(N-1) A. N<5 B. N>4 C. N>5
N<5
Which of the following is the base case in the recursive function below? def xxx(N): if (N==0): print(N) else: xxx(N-1) A. N>0 B. N=0 C. N<0
N=0
Fill in the blank in the function below so that the function prints the integers from 0 up to the integer value it was given for N. That is, the function is executed with the value of N being 3, it should print 0, 1, 2, 3 def xxx(N): if (______): xxx(N-1) print(N)
N>0
Under the assumption that N takes on only integer values, which of the following is the termination condition in the following recursive function? def xxx(N): if (N<5): xxx(N+1) else: print(N) A. N<5 B. N>4 C. N<4
N>4
Which of the following is a loop invariant at the point at which the test for termination is performed in the following loop structure? X=3 while(X<5): X=X+2 A. X>5 B. X<5 C. X>=5 D. X<=5
X<=5
Under the assumption that X takes on only integer values, which of the following is the termination condition for the following loop? while (x<5): ... A. X<5 B. X>4 C. X<4
X>4
In general, an algorithm in which of the following categories is considered more efficient? A. pheta(log2n) B. pheta(n) C. pheta(nlog2n) D. pheta(n2)
pheta(log2n)
The binary search algorithm is an example of an algorithm in which of the following classes? A. pheta(log2n) B. pheta(n) C. pheta(nlog2n) D. pheta(n2)
pheta(log2n)
The insertion sort algorithm is an example of an algorithm in which of the following classes? A. pheta(log2n) B. pheta(n) C. pheta(nlog2n) D. pheta(n2)
pheta(n2)
Use a repeat loop structure to produce a non-recursive program segment that prints the same sequence of numbers as the following recursive function. def xxx(N): print(N) if (N<5): xxx(N+1)
while (N<=5): print(N) N=N+1