Rutgers University CS 211 Sections 1 and 2, Spring 2006
Computer Architecture
Midterm Examination
Read this question paper carefully. Write your answers in the bluebooks
provided. Make sure to write your name and your section number (1 or 2)
on your bluebook. Do not write anything you want graded on the question
paper. If you need another bluebook or if you have a question, please
come to the front of the classroom.
- Recall the first homework assignment where you wrote a program to
convert between number bases. Given the following arguments, write the
expected output of the program. For instance, for "h d 10"
you would write "hexadecimal 10 is decimal 16."
- h d 40
- d b 15
- h b a5a5a5
- b d 11000
- h d 100
- b h 11011010
- Write the following decimal numbers as 8-bit binary numbers in two's-complement:
- Suppose x is 0x5a5a and y is 0xa5a5. Write the values, in hexadecimal, of the following C expressions:
- x & y
- x | y
- x && y
- x ^ y
- ~ x
- ! y
- Let f(n) be true if and only if n is a
prime number. Recall that a positive integer n is prime if and
only if it is evenly divisible by exactly two positive integers: itself
and 1. The number 1 is not prime.
- Suppose n is allowed to be a 4-bit number consisting of
bits n0, n1, n2,
and n3, where n0 is the least significant bit. Write the truth table for the f function.
- Using a Karnaugh map, find the minimal sum of products (OR of ANDs) form for the 4-bit f function. Show your work as well as the final formula you come up with.
- Draw a circuit diagram for the 3-input majority function using only NAND gates. (You may use 2 or 3 input NAND gates.)
- For each of the following, write T for true and F for false:
- NAND gates have fewer transistors than AND gates in CMOS logic.
- On an x86 computer, if the 4-byte value 0x1234abcd is stored in memory
beginning at address 0x100, the value in address 0x101 is 0xab.
- Intel is a company with a large share of the microprocessor market.
- An inverter, or NOT gate, has 3 transistors in CMOS.
- The register file is a file on the disk where CPU registers
are stored when the computer is turned off.
- In x86 machine language, an instruction can be 1 byte.
- In x86 machine language, an instruction can be 3 bytes.
- The Intel Pentium was the first microprocessor to use transistors.
- In a Karnaugh map for the 3-input parity function, none of the 1's
is adjacent to any other 1.
- An NMOS transistor is switched on when the gate is set to zero.