Y. N. Patt, Instructor
TAs: Kathy Buchheit, Laura Funderburg, Chandresh Jain, Onur Mutlu, Danny Nold, Kameswar Subramaniam, Francis Tseng, Brian Ward
Problem Set 1
Due: September 18, 2000
You are welcome, and in fact encouraged to do the homework in groups. Remember to put your names on the solution sheet. Also remember to put the name and discussion section meeting time/day of the TA in whose discussion section you want the homework returned back to you. Good luck!!!
Suppose we wish to put a set of names in alphabetical order. We call the act of doing so sorting. One algorithm that can accomplish that is called the bubble sort. We could then program our bubble sort algorithm in C, and compile the C program to execute on an x86 ISA. The x86 ISA can be implemented with an Intel Pentium III microarchitecture. Let us call the sequence "Bubble Sort, C program, x86 ISA, Pentium III microarchitecture" one transformation process.
Assume we have available four sorting algorithms and can program in C, C++, Pascal, Fortran and COBOL, and have available compilers that can translate from each of these to either x86 or SPARC, and have available three different microarchitectures for x86 and three different microarchitectures for SPARC.
Write the representations of 7 and -7 in 1's complement, signed magnitude and 2's complement integers.
5. (2.10: 1,4)
Convert these decimal numbers to eight-bit 2's complement binary numbers.
6. (2.36: 1)
Write IEEE floating point representation of the decimal number 3.75
7. (2.37: 4)
Write the decimal equivalent for this IEEE floating point number:
1 10000000 10010000000000000000000
A computer programmer wrote a program that adds two numbers. He/she ran the program and observed that when 5 is added to 8, the result is the character 'm'. Explain why the program is behaving erroneously.
9. (2.46: 1,3,5)
Perform the following additions. The corresponding 16-bit numbers are in 2's complement notation. Provide your answers in hexadecimal.
10. (2.47: 3,4)
Perform the following logical operations. Express your answers in hexadecimal notation.
Fill in the truth table for the equations given below. The first line is done as an example.
Q1 = NOT(A AND B)
Q2 = NOT(NOT(A) AND NOT(B))
Express Q2 another way.
12. (Added September 11)
How many bits are needed to represent Avogadro's number (6.02 x 1023 ) in two's complement binary representation? (6.02 x 1023 = 602,000,000,000,000,000,000,000)