hw2_sol - My UW | UW Search CS/ECE252 Introductionto...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
My UW | UW Search Computer Science Home Page > ~markhill Home Contact Info Schedule LC-3 Simulator Grading Examinations Homework CS/ECE 252  Introduction to  Computer  Engineering Fall 2007 Section 3 Instructor Mark D. Hill TAs Sanghamitra Roy, Eric Hill, Samuel Javner, Natalie Enright Jerger, & Guoliang Jin URL: http://www.cs.wisc.edu/~markhil l/cs252/Fall2007/ Homework 2 Solutions Problem 1 a. Assume that there are exactly 267 students in your class. If every student is to be assigned a unique bit pattern, what is the minimum number of bits required to do this? b.How many more students can be admitted to the class without requiring additional bits for each student's unique bit pattern?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
using i bits is 2 i . We need at least 267 unique bit patterns. The cleanest approach is to compute log 2 267 and take the ceiling (round up). This yields 9 as the answer. I accept trial and error is an acceptable technique. 2. With 9 bits, we can represent up to 512 unique bit patterns; we can represent 512 - 267 = 245 more students without requiring additional bits. (4 points.) Problem 2 Using 7 bits to represent each number, write the representations of 26 and -26 in signed magnitude and 2's complement integers. Signed Magnitude 2's Complement 26 0011010 0011010 -26 1011010 1100110 (2 points.) Problem 3 a. What is the largest positive number one can represent in an 11-bit 2's complement code? Write your result in binary and decimal. b. What is the greatest magnitude
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2010 for the course CS 252 taught by Professor Wood during the Fall '08 term at Wisconsin.

Page1 / 8

hw2_sol - My UW | UW Search CS/ECE252 Introductionto...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online