# CS/ECE 252 Introduction to Computer Engineering

Spring 2013 Section 1 & 2
Instructors Mark D. Hill and Guri Sohi
TAs Preeti Agarwal, Mona Jalal, Rebecca Lam, Pradip Vallathol

URLs: http://www.cs.wisc.edu/~markhill/cs252/Spring2013/ and http://www.cs.wisc.edu/~sohi/cs252/Spring2013/

## Homework 2 [Due at lecture on Wed, Feb 6]

Primary contact for this homework: Pradip Vallathol [pradip16 at cs dot wisc dot edu]

You must do this homework in groups of two. Please write the full name and the student id of each member on every page and staple multiple pages together.

### Problem 1 (4 points)

1. Assume that 453 scientists have been invited to attend a conference. If every scientist is to be assigned a unique bit pattern, what is the minimum number of bits required to do this?
2. How many more scientists can be invited to the conference, without requiring additional bits for each person's unique id?

### Problem 2 (8 points)

Using 7 bits to represent each number, write the representations of 25, -25 and 0 in signed magnitude, 1's complement and 2's complement notations.

 Number Sign-Magnitude 1's Complement 2's Complement 25 -25 0

### Problem 3 (4 points)

The following binary numbers are 5-bit 2's complement binary numbers. Which of the following operations generate overflow? Justify your answers by translating the operands and results into decimal.

1. 00111 + 00110
2. 10111 - 11110
3. 11000 - 00011
4. 10110 + 10011

### Problem 4 (2 points)

Compute the followings:

1. (10100 OR 01101) AND (NOT(10101))
2. (10101 OR 00100) AND (NOT(00101) OR 01010)

### Problem 5 (4 points)

Convert the following decimal numbers into 6-bit 2's complement binary numbers. Explain any problem that you encounter for these conversions.

1. 23
2. -33
3. 32
4. -32

### Problem 6 (2 points)

Perform the specified arithmentic operation for the following 2's complement binary numbers:

1. 11001 + 1011
2. 00111 - 010
Note:
1. All numbers beginning with 1 are negative.
2. Don't forget to sign-extend when required.

### Problem 7 (4 points)

Write the decimal equivalents for the following IEEE floating point numbers.

1. 1 01111110 01000000000000000000000
2. 0 10000001 10100000000000000000000

### Problem 8 (2 points)

Write the IEEE floating point representation of the decimal number 2.50.

Computer Sciences | UW Home
 Page last modified: Friday, 25-Jan-2013 16:32:12 CST Feedback or content questions: send email to sohi@cs.wisc.edu Technical or accessibility issues: lab@cs.wisc.edu Copyright © 2002, 2003 The Board of Regents of the University of Wisconsin System.