Download Exam 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Canonical normal form wikipedia , lookup

Transcript
CIS 300 Quiz 1
Name:
1. Match each computer with a description:
a) IBM 370
b) Eniac
c) Connection Machine
d) Intel 8080
e) Cray 1
1)
2)
3)
4)
5)
Pioneering Supercomputer
Predecessor of today’s Pentium
Highly successful mainframe
Made of vacuum tubes
Lots of CPUs doing the same thing
2. True / False
a) Computers are commercially successful strictly due to their speed / cost
b) Placing an entire processor on a single chip made computers much cheaper
c) The number of transistors on a chip is twice as many now as there were 10 years ago
d) The goal of the computer architect is to make it easy to program the computer
e) Supercomputers go so fast because they are able to do many things at once
3. When you run standard benchmarks to see how fast a computer is, which aspects of the
system are being tested?
a) The raw speed of the processor
b) The quality of the compiler that generates the code
c) The ability of the programmer to write a fast benchmark
d) The quality of the operating system as it manages the memory and page table
4. Consider a circuit that computes the parity of a 3 bit input. If the number of 1’s is even, the
output is 0. If the number of 1’s is odd, the output is 1.
a) Draw the truth table of this circuit:
XYZ
Output
000
001
010
011
100
101
110
111
b) Write an equation for this circuit in SOP form
5. Demonstrate DeMorgan’s law by showing two equivalent logic circuits
6. Simplify the following Boolean equation:
XYZ + XY’Z + XX’
7. Consider the following state machine with one input, X:
X=1
X=0
0
1
X=1
a) Draw the truth table that defines this machine
b) Draw a circuit for this machine
c) What does this machine do?
X=0
8. Consider an array “a” of 32 bit integers in which register $a0 is pointing to the array. Register
$a1 contains the value of variable “i”. Show code sequences that place the following into $t0:
a) a[4]
b) a[i-1]
c) a[4*i]
9. Consider the following C function:
int f(int x, int y) {
return(x+y-10); }
What would the MIPS code for this function look like?
10. Consider manipulations on a word containing more than one bit field (like the TCP header)
a) To clear (set to 0) a field you use the ________ instruction
b) To extract a field and place it in a register by itself, you need to use a _____________
instruction to move the field to the right of the word and then a ________________ to clear out
other fields.
c) To set a field to all 1 bits, a ___________________ instruction would be used.
d) If a field contains a signed integer, when it is extracted into a register the upper bits of
the register need to contain the _____________ bit of the field.
11. What is wrong with the following alleged MIPS instructions?
a)
add $s1, $s2, 4($s3)
b)
addi $t1, $t2, FFFFFF (the FFFFFF is a hex value)
c)
lw $t1, $s1($s2)
d)
sw $a1, 3($zero)
12. Convert the following instruction into a 32 bit binary number:
sw
$s0, -4($fp)
Show your answer in binary and hex
Extra Credit: Consider a state machine with one input and one output whose output is a 1
whenever the most recent two inputs are 1. Can you create this using just two flip flops and one
AND gate? How?