ICE winter 2012 midterm

Report 8 Downloads 245 Views
1

McGill University Faculty of Engineering

ECSE-221B Introduction to Computer Engineering

Department of Electrical and Computer Engineering Mid-Te rm Examination Winter 2012

Examine r:

Rola Harmouche

Date:

Friday, March 2, 2012

Time:

11:35 – 12: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 Part 1 consisting of 10 multiple choice questions and Part 2 consisting of 4 problems. The multiple choice questions are equally weighted. You must encircle your answer. You can use the space provided to help yourse lf finding the answers. In Part 1, 2 marks for each correct answer, and 0.5 marks deducted for each wrong answer. Blank entries are not penalized. The 4 problems to be answered in the space provided on the examination sheet. You must encircle your final answer.



The exam has a total of 30 marks.

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

2

Part 1 – Multiple Choice (2 pts for correct ans wer) Question 1: What is the value represented by 110101 in a two’s complement system? (Assume a 6 bit register) a) b) c) d) e)

-11 53 -53 11 21

Answer: a Question 2: What is the logical expression of the following circuit?

a) b) c) d) e) Answer: a

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

3

Question 3: How many 2-input MUX, how many stages, and what is the total delay for a 32 bit multiplexer? (Do not count delay of inverters) a) 30 MUX, 5 stages, 15 units of gate delay b) 30 MUX, 4 stages, 10 units of gate delay c) 15 MUX, 4 stages, 10 units of gate delay d) 15 MUX, 5 stages, 30 units of gate delay e) 30 MUX, 5 stages, 10 units of gate delay Answer: e (30 was replaced by 31) Question 4: What is the base-8 representation of 4A712 ? a) 417

b) c) d) e)

703 1607 1277 407

Answer: d Question 5: In the Flip Flop shown below, what is the next state of the output state variable if D(t) = 1? a) b) c) d) e)

Undefined 0 Toggle 1 None of the above

Answer: d Question 6: What is the minimum logic function of the following Karnaugh map?

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

4

(a) (b) (c) (d) (e) Answer: a Question 7: You are designing a modulo-8 counter using the following 7 segment display and a 3-to-8 decoder:

7 Segment Display

3-to-8 Decoder

A 3-to-8 decoder is used to assert each octal code (0 to 7). The inputs of the decoder represent the octal code in binary. Each segment of the display (a to g) combines 1’s (OR) or 0’s (NOR), depending on which are fewer in the truth table. What is the logic equation for segment b? (a) (b) (c) (d) (e)

a = OR (5,6) a = OR (1,2,5,6) a = NOR(1,4) a = XOR(2,3,5,6,7,8) a = NOR (5,6)

Answer: e

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

5

Question 8: What is the main difference between The J-K master-slave flip- flop and the RISING edge-triggered flip- flop?

a) Toggle mode is undefined for the J-K master-slave flip- flop but is defined for the edge triggered flip flop. b) The edge triggered flip flop is not susceptible to 1’s and 0’s catching whereas the J-K masterslave flip- flop is. c) RACE condition occurs in the J-K master-slave flip- flop but does not occur for the edge triggered flip flop. a) Preset and Clear allow the flip- flop to be forced into an initial state in the The J-K master-slave flip- flop but not in the edge triggered flip flop b) None of the above Answer: b Question 9: How is not a number represented using IEEE-754 format? a) b) c) d) e)

Mantissa = 0, exponent = 0 Mantissa = non-zero, exponent = 0 Mantissa = 0, exponent = 255 Mantissa = 1, exponent = 0 Mantissa = non-zero, exponent = 255

Answer: e Question 10: In what mode is the Master-Slave SR latch at t = 87 units (red dash line)? a) b) c) d)

Set Mode Reset Mode Toggle Mode Memory Mode

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

6

Answer: a

Part 2 Proble m 1 (5 pts): Encode the number -8.573 x 1013 using the IEEE 754 format and express your result as a 8-digit hexadecimal number. Determine the mantissa to equivalent precision.

-0.5 pts for not getting the right number of significant digits -2 pts for bad exponent -2 pts for bad mantissa Sign = 1 log(-8.573 x 1013)/log(2) = 46.285 247 = 1.4074x1014 -8.573 x 1013 x 247 = 1.4074x1014 x (-8.573 x 1013 ) -8.573 x 1013 = (-8.573 x 1013 x 247 ) / 1.4074x1014 -8.573 x 1013 = (-8.573 x 247 ) / 14.074 = 0.6092 x 247 = 1.2184 x 246 # of significant bits : 4/log (2) = 13.28 - > round up = 14 – 1 for the hidden bit normalization = 13 Mantissa: .2183 x 16 = 3.4928 .4928 x 16 = 7.8848 .8848 x 16 = 14.1568 .1568 x 16 = 2.5088 Exponent = 46 + 127 = 173 Answer : 1 1010110 100110111111001000000…

D69BF200

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

7

Proble m 2 (5 pts): Write out the algorithm for binary multiplication. Use the algorithm to perform the multiplication of 10111 and 00101. Assuming 5-bit registers, indicate whether overflow occurred. Soln: Set I = M;

00101 *

set P = 0. For j = 0, 1, 2, …, n-1 do the following: 1. If digit j of N is 1 then set P = P + I Else if digit j of N is 0, do nothing; 2. Shift I left one place.

10111 10111 1011100 1110011

5 * -9

-12 . Overflow occurred.

Things to remove points for: -

shift left after each digit of N do nothing if digit is 0 and add I if digit is 1 the actual multiplication: 1 point overflow detection: ½ a point

Proble m 3 (5 points) Derive the minimal Sum of Product and Product of Sum for the following function:

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. 1.25 points for each map 1.25 points for each circuit

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)

8

Proble m 4 (5 points) Fill in the following state transition tables for the clocked S-R latch and the J-K Flip- flop. Indicate the mode for each input combination. What is the main difference between a clocked S-R latch and a J-K Flip-flop? 1 point for difference 2 points for each truth table J

K

Q

Q

Mode

S

R

Q

Q

Mode

0

0

0

0

Memory

0

0

0

0

Memory

0

0

1

1

Memory

0

0

1

1

Memory

0

1

0

0

Reset

0

1

0

0

Reset

0

1

1

0

Reset

0

1

1

0

Reset

1

0

0

1

Set

1

0

0

1

Set

1

0

1

1

Set

1

0

1

1

Set

1

1

0

1

toggle

1

1

0

-

Not defined

1

1

1

0

toggle

1

1

1

-

Not defined

Main difference: J=1 K=1 defined for JK flip flop. S=1, R=s not defined for SR latch

ECSE-221B 2011 − Introduction to Computer Engineering (Mid-Term Examination)