922 25300 Computer Organization and Assembly Languages National Taiwan University
Fall 2009 Department of CSIE
Homework 1
September 28, 2009 Due date: October 12, 2009
1. (12%) What is the binary representation of the following hexadecimal numbers? What are the decimal numbers they represent when interpreted as unsigned and signed integers.
a. 25 b. ED
2. (8%) Prove that (a){NOT, OR} and (b) {NAND} are universal.
3. (10%) Let Q= A + B(A + C) + AC. Prove that (a) Q = A + BC. (b) Draw a circuit to implement Q.
4. (10%) (a) Create the truth table for the 3-input Boolean function, mod3, which returns X%3 for the input X. If the input X2X1X0= 101, then the output Z1Z0= 10 since 5%3 = 2. (b) Implement this function with logic gates AND, OR and NOT.
5. (20%) Design a 7-segment display driver which accepts a 4-bit input (ABCD where A is the MSB) and outputs 7 bits which controls the on/off status of a 7-segment display as shown in the above figure. (a) List the truth table for the driver. (b) Write down the Boolean expressions for segments a and e.
(a) 7-segment display driver (b) names of segments (c) Configurations for 16 hexadecimal digits
6. (20%) (a) A 4-bit 2-sorter (Figure (a)) has two 4-bit inputs A, B and two 4-bit outputs X, Y. The inputs A and B are unsigned integers. The output X is the larger one of A and B and Y is the smaller one of A and B.
Design a 4-bit 2-sorter using the components introduced in the class. [Hint: one possibility is to composite 4-bit comparators and 4-bit 2-multiplexers to complete the task.] (b) A 4-bit 3-sorter (Figure (b)) has three 4-bit inputs A, B, C and three 4-bit outputs X, Y, Z, where X, Y and Z are the result of sorting A, B, C so that X ≥ Y ≥ Z. Use 4-bit 2-sorters to composite a 4-bit 3-sorter. (c) A 4-bit 4-sorter (Figure (c)) has four 4-bit inputs A, B, C, D and four 4-bit outputs W, X, Y, Z with W ≥ X ≥ Y ≥ Z. Design a 4-bit 4-sorter.
4-bit 2-sorter
A B
4 4
4
X
4
Y
4-bit 3-sorter
A B
4 4
4
X
4
Y C
4
4
Z
4-bit 4-sorter
A B
4 4
4
X
4
Y C D
4 4
4
W
4
Z (a) 4-bit 2-sorter (b) 4-bit 3-sorter (c) 4-bit 4-sorter
7. (20%) Design a binary multiplier that multiplies two 3-bit unsigned integers, X = X2X1X0 and Y = Y2Y1Y0, and a 6-bit output Z = Z5Z4. . . Z0and Z = X × Y , where X0, Y0and Z0are LSBs. You may use the notation X[n..m] to identify a portion of wires. For example, X[2..1] means the set of wires, X2X1.
1