DOC PREVIEW
UW-Madison EMA 202 - exam1a_sol

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERINGCOMPUTER SCIENCES DEPARTMENTUNIVERSITY OF WISCONSIN—MADISONProf. Mark D. Hill & Prof. Mikko LipastiTAs Sanghamitra Roy, Eric Hill, Samuel Javner, Natalie Enright Jerger, & Guoliang JinMidterm Examination 1In Class (50 minutes)Monday, October 1, 2007Weight: 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# ______________________________________________________________1ProblemNumberMaximumPointsGraded By1 4 EH2 3 EH3 3 NEJ4 4 NEJ5 4 SR6 4 SJ7 4 GJ8 4 SJ/SR/NEJTotal 302Problem 1 (4 points)a)What is the largest (most positive) integer that can be represented as an unsigned integer using 13 bits?1111111111111b = (213 – 1)d = 8191dFull credit for any one of (213 – 1)d or 8191db)What is the largest (most positive) integer that can be represented as a two’s complement integer using 13 bits?0111111111111b = (212 – 1)d = 4095dFull credit for any one of (212 – 1)d or 4095dProblem 2 (3 points)Consider bitwise logical operations: Compute (1101 AND 0111) OR (NOT 0011)(1101 AND 0111) OR (NOT 0011) = (0101) OR (1100) = 11013Problem 3 (3 points)Convert the number -84 (base ten) into two's complement representation with 8 bits.+84d = 01010100b-84d = 10101011b + 1b = 10101100bProblem 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?10010010b = 128 + 16 + 2 = 146db) A two’s complement integer?10010010b = -(01101101 + 1)b = -(01101110)b = -(64 + 32 + 8 + 4 + 2)d = -110d4Problem 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.11100 - There is 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.01101 - There is no 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.)“F4n” = 0x46347E = 01000110 00110100 01111110 (00000000 at end OK)b) Convert the binary value 0010010001101011 into an ASCII string.0010010001101011 = 0x246B = “$k”5Problem 7 (4 points)a) What is the base ten (decimal) value represented by binary 110.101 ?110.101 = 1 x (22) + 1 x (21) + 0 x (20) + 1 x (2-1) + 0 x (2-2) + 1 x (2-3)= 4 + 2 + 0 + 1/2 + 0 + 1/8= 6 5/8 (or 53/8, 6.625, etc.)b) The bits for an IEEE floating point number are allocated as follows:sign (1 bit) exponent (8 bits) fraction (23 bits)where N = (-1)S x 1.fraction x 2exponent-127 Convert 1 10000001 11000000000000000000000 to decimal.N = (-1)1 x (1.11)b x 2129-127 = -1 x (1.11)b x 22 = -(111)b = -7Problem 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/÷) calculatorb. A laptop computer running Windows XPc. 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 definedb. The algorithm’s variables must not overflow a fixed number of bitsc. The number of unknowns and equations is the samed. None of the above6ASCII TableCharacter Hex Character Hex Character Hex Character Hex nul 00 sp 20 @ 40 ` 60 soh 01 ! 21 A 41 a 61 stx 02 " 22 B 42 b 62 etx 03 # 23 C 43 c 63 eot 04 $ 24 D 44 d 64 enq 05 % 25 E 45 e 65 ack 06 & 26 F 46 f 66 bel 07 ' 27 G 47 g 67 bs 08 ( 28 H 48 h 68 ht 09 ) 29 I 49 i 69 lf 0A * 2A J 4A j 6A vt 0B + 2B K 4B k 6B ff 0C , 2C L 4C l 6C cr 0D - 2D M 4D m 6D so 0E . 2E N 4E n 6E si 0F / 2F O 4F o 6F dle 10 0 30 P 50 p 70 dc1 11 1 31 Q 51 q 71 dc2 12 2 32 R 52 r 72 dc3 13 3 33 S 53 s 73 dc4 14 4 34 T 54 t 74 nak 15 5 35 U 55 u 75 syn 16 6 36 V 56 v 76 etb 17 7 37 W 57 w 77 can 18 8 38 X 58 x 78 em 19 9 39 Y 59 y 79 sub 1A : 3A Z 5A z 7A esc 1B ; 3B [ 5B { 7B fs 1C < 3C \ 5C | 7C gs 1D = 3D ] 5D } 7D rs 1E > 3E ^ 5E ~ 7E us 1F ? 3F _ 5F del 7F7Scratch Sheet (in case you need additional space for some of your


View Full Document

UW-Madison EMA 202 - exam1a_sol

Download exam1a_sol
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view exam1a_sol and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view exam1a_sol 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?