Winter 2010 Midterm

Report 10 Downloads 259 Views
1

McGill University Faculty of Engineering

ECSE-221B Introduction to Computer Engineering

Department of Electrical and Computer Engineering Mid-Term Test Winter 2010 Examiner:

Prof. Odile Liboiron-Ladouceur

Date:

Monday, February 15, 2010

Time:

9:35 – 10:25

Student Name:

McGill ID:

Signature: ______________________________________________ INSTRUCTIONS: 

This is a CLOSED BOOK EXAM.



FACULTY STANDARD CALCULATOR permitted ONLY.



Read through ALL of the questions before beginning.



Print your name legibly at the top of this page, fill in your student ID number and sign on the line below.



Initial each page of the exam paper (nine pages in total) in case the sheets should get separated.



The exam consists of 11 questions for a total of 30 marks.



The answers must be written on the question sheet in the space provided.

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

2 Question 1 (2 pt): Convert 27.310 in base 2. Round to the correct number of significant digits. 27 = 11011 log(10)/log(2) ~ 3 rounded up to 4. .3 * 2 = 0.6 .6 * 2 = 1.2 .2 * 2 = 0.4 .4 * 2 = 0.8 .8 * 2 = 1.6

0 1 0 0 1

We get 11011.01002 Question 2 (2 pt): Perform the following subtraction: 39A016 – 2CEB16. Give the answer in hexadecimal. 0011 1001 1010 0000 - 0010 1100 1110 1011 (2’s complement)

0011 1001 1010 0000 + 1101 0011 0001 0101 0000 1100 1011 0101

The answer in hexadecimal is 0CB516. Question 3 (2 pt): Write the logic function corresponding to the circuit shown below implemented in TTL technology.

Answer is [AB’ + (BC)’]’

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

3

Question 4 (3 pt): Write the subtract-shift algorithm for binary division. Then divide 1010112 by 1012 using your subtract-shift algorithm. Show all your work. Remainder = Dividend For i = n-1 to 0 if Remainder – 2i x Divisor ≥ 0 qi = 1 Remainder = Remainder – 2i x Divisor else qi = 0 The longest string as 6 bits, so n = 6. for i = 5

00101011 10100000 10001011

for i = 4

00101011 1010000 11011011

for i = 3

00101011 101000 000011

for i = 2

00000011 10100 101111

for i = 1

000011 1010 111001

for i = 0

000011 101 111110

|101 > 0?

no, q5 = 0 |101

>0?

no, q4 = 0 |101

>0?

yes, q3 = 1 |101

>0?

no, q2 = 0 |101

>0?

no, q1 = 0 |101

>0?

no, q0 = 0

The answer is 10002 rem 112 Question 5 (3 pt): Encode the number -2.463 x 10-11 using the IEEE 754 format and express your result as a 8digit hexadecimal number. Determine the mantissa to equivalent precision. Negative bits: 1

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

4 Exponent: logbX=log10X/log10b -> log2(2.463 x 10-11)=log10(2.463 x 10-11)/log10(2) = -35.24 2-36 =1.455 x 10-11 -2.463 x 10-11/1.455 x 10-11=-1.693  -2.453 x 10-11=1.693 x 2-36 Exponent bits: -36+127 = 91 9410 = 0101 10112 Mantissa: # of significant bits = log(2463)/log(2)= 11.2 -> 12 calculate in hex: .693 x 16 = 11.088 .088 x 16 = 1.408 .408 x 16 = 6.528 1011 0001 0110 1000 Need only 11 bits since 1 is hidden sign = 1 exp = 01011011 mantissa = 10110001011000000000000 1010 1101 1101 1000 1011 0000 0000 0000 A D D 8 B 0 0 0 Question 6 (3 pt): A modified version of the IEEE 754 single precision floating point scheme is used to represent 5 significant digits in decimal (base-10). Note that the resulting mantissa is shorter than in the standard IEEE 754 format. The bits not used from the mantissa are added to the exponent field. Determine the lengths (i.e. number of bits) of the mantissa and exponent fields respectively, and the range of numbers that can be represented. The number of bits to represent a decimal number to 5 significant digits if given by the following expression: # bits in base a * log(a) = # bits in base b * log(b) 5 * log(10) = # bits in base-b * log(2) # bits in base-b = 5/log(2) = 17 – 1 hidden = 16 bits The number of bits for the exponent is 8 + (23-16) = 15 bits The range of number is ±2^(2ne-1)=± 2^(214) Question 7 (4 pt): Derive the minimal Sum of Product and Product of Sum for the following function:

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

5

F

 1,4,5,6,9,12,13,14 A, B ,C , D

Show the corresponding NAND-NAND and NOR-NOR implementations and draw the circuit diagram using simple gates for the NAND and for NOR.

Question 8 (2 pt): Derive the minimal Sum of Product and Product of Sum for the logical function defined in question 7, but with ‘don’t cares’ for [A,B,C,D] = [0,0,0,0], and [1,0,0,0]. Prove that the two canonical forms are equals.

Question 9 (4 points) Show the logical circuit of a 2-way routing switch (clearly label all inputs). Show how the logical function in question 8 can be implemented using this 8-input multiplexer consisting of a cascade of 2-way routing switches. Assuming that each gate have a propagation delay of 1 us (microsecond), calculate the propagation delay of an 8-input multiplexer (note: do not count the inverter in the switch, but count the input inversters).

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

6

Propagation delay of one 2-way switch is 2 unit gate delay. log2(8) = 3 depth. Total propagation delay is 3 x 2 = 6 unit gate delays. So the total propagation is 6 microseconds.

Question 10 (2 pt): Determine the state transition table of the circuit shown below.

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

7

This is the clocked S-R Latch

Question 11 (3 pt): Fill in the timing diagram corresponding to the circuit shown below.

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)

8

ECSE-221B Introduction to Computer Engineering (Mid-Term Test)