• 沒有找到結果。

Homework 1 October 8, 2007 Due date: October 22, 2007 •

N/A
N/A
Protected

Academic year: 2022

Share "Homework 1 October 8, 2007 Due date: October 22, 2007 •"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

922 25300 Computer Organization and Assembly Languages National Taiwan University

Fall 2007 Department of CSIE

Homework 1

October 8, 2007 Due date: October 22, 2007

• Signed integers are represented using two’s complement representation.

• Please use the following notations for logic gates. Feel free to change the orientations of the gates and the positions of inputs and outputs. You are free to use other circuits. However, if they are not introduced in the class, you have to implement them before using them.

NOT gate AND gate OR gate NAND gate XOR gate

1. (10%) What are the 8-bit binary representations of the following signed decimal integers? Convert them into hexadecimal.

a. 51 b. -5

2. (10%) Prove that (a){NOT, OR} and (b) {NAND} are universal.

3. (10%) (a) Create the truth table for the 3-input Boolean function, Even, which returns 1 if the number of zeros in inputs is even, 0 otherwise. (b) Implement this function with logic gates AND, OR and NOT.

4. (20%) Follow the conventions in the following figure. 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

5. (15%) As shown in the following diagram, design a 4-bit comparator which has two 4-bit unsigned integer inputs, X3X2X1X0and Y3Y2Y1Y0, and a 3-bit output for the conditions of X > Y , X = Y and X < Y , respectively. Hint: design a 1-bit comparator first.

4-bit comparator

X Y

4 4

X>Y X=Y X<Y

X>Y X=Y X<Y

1

(2)

6. (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. 7. (15%) Refer to the following figure for TOY architecture. Please specify the operations of M U XA, M U XB, M U XC, M U XD, M U XE, REGW, M EMW and ALUOP during the execution stage for the instructions ”load address”, ”store indirect” and ”branch zero”. For example, the answer for ”jump and link” would be M U XA = 0, M U XB = ∗, M U XC = ∗, M U XD = 1, M U XE = 01, REGW = 1, M EMW = 0, ALUOP = ∗.

1 2

1 2

1 2

1 2 11

12 21

MUXA

MUXB

MUXC

MUXD MUXE

000 add/sub 001 and 010 xor 011 shift 100 input 2

ALUOP

MEMW

REGW

2

參考文獻

相關文件

The prospectors, named Andrews, Blake, Johnson, and Kelly, can walk through the shaft in one minute, two minutes, four minutes, and eight minutes, respectively?. When two walk

[r]

(a)  is the rate at which the percentage of the city’s electrical power produced by solar panels changes with respect to time , measured in percentage points per year..

(b) 0 = IV, since from left to right, the slopes of the tangents to graph (b) start out at a fixed positive quantity, then suddenly become negative, then positive again..

(b)- IV, since from left to right, the slopes of the tangents to graph (b) start out at a fixed positive quantity, then suddenly become negative, then

So we check derivative of f and g, the small one would correspond to graph (b) and the other to (c)(i.e.. Moreover, f is

(18%) Determine whether the given series converges or diverges... For what values of x does the series

2) A 900 g sample of pure water is shaken with air under a pressure of 0.95 atm at 20 °C. The vapor pressures of the pure compounds at 25°C are 331 mm Hg for cyclopentane and 113 mm