1 CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN—MADISON Prof. Mark D. Hill & Prof. Mikko Lipasti TAs Sanghamitra Roy, Eric Hill, Samuel Javner, Natalie Enright Jerger, & Guoliang Jin Midterm Examination 1 In Class (50 minutes) Monday, October 1, 2007 Weight: 15% CLOSED BOOK, NOTE, CALCULATOR, PHONE, & COMPUTER. The exam has four two-sided pages. Plan your time carefully, since some problems are longer than others. NAME: __________________________________________________________ SECTION: __________________________________________________________ ID# ______________________________________________________________2 Problem Number Maximum Points Actual Points 1 4 2 3 3 3 4 4 5 4 6 4 7 4 8 4 Total 303 Problem 1 (4 points) a) What is the largest (most positive) integer that can be represented as an unsigned integer using 13 bits? b) What is the largest (most positive) integer that can be represented as a two’s complement integer using 13 bits? Problem 2 (3 points) Consider bitwise logical operations: Compute (1101 AND 0111) OR (NOT 0011)4 Problem 3 (3 points) Convert the number -84 (base ten) into two's complement representation with 8 bits. Problem 4 (4 points) Consider the 8-bit binary bit pattern 10010010. What is its decimal (base ten) value if the bit pattern is interpreted as: (a) An unsigned integer? (b) A two’s complement integer?5 Problem 5 (4 points) (a) Add the following 5-bit two's complement binary numbers: 01111 + 01101. Express your answer in 5-bit two's complement. Please indicate if there was an overflow. (b) Add the following 5-bit two's complement binary numbers: 11110 + 01111. Express your answer in 5-bit two's complement. Please indicate if there was an overflow. Problem 6 (4 points) (a) Convert the ASCII string “F4n” into binary. (See attached ASCII table. Only convert the characters between the quotation marks.) (b) Convert the binary value 0010010001101011 into an ASCII string.6 Problem 7 (4 points) (a) What is the base ten (decimal) value represented by binary 110.101 ? (b) The bits for an IEEE floating point number are allocated as follows: sign(1bit) exponent(8bits) fraction(23bits) where N = (-1)S x 1.fraction x 2exponent-127 Convert 1 10000001 11000000000000000000000 to decimal. Problem 8 – Circle the correct answer (2 points each) I. Which of the following is a universal computing device? a. A 16-button(0-9, period, =/+/-/x/÷) calculator b. A laptop computer running Windows XP c. An ultrafast supercomputer d. All of the above e. Both (b) and (c) II. When referring to an algorithm, definiteness means: a. Each step must be precisely defined b. The algorithm’s variables must not overflow a fixed number of bits c. The number of unknowns and equations is the same d. None of the above7 ASCII Table CharacterHex CharacterHex CharacterHex CharacterHexnul 00 sp 20 @ 40 ` 60soh 01 ! 21 A 41 a 61stx 02 ʺ 22 B 42 b 62etx 03 # 23 C 43 c 63eot 04 $ 24 D 44 d 64enq 05 % 25 E 45 e 65ack 06 & 26 F 46 f 66bel 07 ʹ 27 G 47 g 67bs 08 ( 28 H 48 h 68ht 09 ) 29 I 49 i 69lf 0A * 2A J 4A j 6Avt 0B + 2B K 4B k 6Bff 0C , 2C L 4C l 6Ccr 0D ‐ 2D M 4D m 6Dso 0E . 2E N 4E n 6Esi 0F / 2F O 4F o 6Fdle 10 0 30 P 50 p 70dc1 11 1 31 Q 51 q 71dc2 12 2 32 R 52 r 72 dc3 13 3 33 S 53 s 73dc4 14 4 34 T 54 t 74nak 15 5 35 U 55 u 75syn 16 6 36 V 56 v 76etb 17 7 37 W 57 w 77can 18 8 38 X 58 x 78em 19 9 39 Y 59 y 79sub 1A : 3A Z 5A z 7Aesc 1B ; 3B [ 5B { 7Bfs 1C < 3C \ 5C | 7Cgs 1D = 3D ] 5D } 7Drs 1E > 3E ^ 5E ~ 7Eus 1F ? 3F _ 5F del 7F8 Scratch Sheet (in case you need additional space for some of your
View Full Document