Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CMP 334 Exam 1 (Fall 2017) 1) Fill in the first table with binarydecimal hexadec

ID: 3590508 • Letter: C

Question

CMP 334 Exam 1 (Fall 2017) 1) Fill in the first table with binarydecimal hexadecimal 1191181 equivalent value in each row and values in each column in the indicated base 136 2) Use a truth table to prove or disprove: -(a b)3(b 3) Design a combinational circuit for the function described infomally below a) draw a "black box" with labeled inputs and output(s) for the circuit, b) make the description formal by supplying the appropriate truth table C) derive a Boolean formula (in Disjunctive Normal Form) for the circuit, and d) draw the circuit for this formula (do not try to minimize the formula). Informal description: the input should be a binary number between 0 and 15 and the output should be true if that number is equal to 2 modulo 5 (that is 2,7, or 12) 4) For each (X. Y) pair of 8-bit integers in the second table a) Convert X and Y to binary b) Add X and Y in binary c) Which condition flags would be set by the addition in part b? d) Compute the two's complement of Y e) Use two's complement arithmetic to compute X-Y 8x59 8x2F 8x9F ex61 5) Execution of program P on computer X entails 6 billion fixed-point instructions and 3 billion floating-point instructions (you do not need to be concemed about what these instructions do yet). The CPI for fixed-point instructions on X is 4 and that for floating-point instructions is 12. The clock rate for X is 5 billion Hertz a) What is the average CPI for the instructions of P? b) How long does it take P to execute? c) What would be the overall speed up of an improvement reducing the fixed-point CPI to 3 d) What would be the overall speed up of an improvement reducing the loating-point CPI to 8 CISC, and Stack machine assembly instructions for the following high-level code x=(x-y) (x + y)

Explanation / Answer

1)

binary decimal hexadecimal

0b01101101 109 6D

0b10001011 139 8B

0b11010101 213 D5

2)

a b c ~(a.b) + c a' + ~(b.c')

F F F T T

F F T T T

F T F T T

F T T T T

T F F T T

T F T T T

T T F F F

T T T T T

From the truth table, LHS = RHS

3)

Let Input = b3 b2 b1 b0

Output is true when the number is 2 modulo 5. Hence,

Output = b3'b2'b1b0' + b3'b2b1b0 + b3b2b1'b0'

4)

X Y   

0x59 0x2F

1011001 0101111

X+Y: 010001000

2's complement of Y: 11010001

X-Y : 0101010

b)

X Y   

0x9F 0x61

010011111 01100001

X+Y: 100000000

2's complement of Y: 10011111

X-Y : 0111110

c)

X Y   

0x84 0xE5

010000100 011100101

X+Y: 0101101001

2's complement of Y: 100011011

X-Y : 10011111