This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS231 Fall 2010 Homework 4 solutions Due at 5:00pm, Wednesday, October 13, 2010 CS 231 drop box, Siebel Center (in basement) Introductory notes: Write your name, your netID , and CS 231 clearly on the first page. You must follow the Formatting Guidelines listed on the assignments page or your score will be penalized. There are 8 questions in this homework worth a total of 100 points. It covers material from lectures 9 and 10 on Additon, Multiplication, and Subtraction. You must work individually on homework. You may discuss material with other students, the TAs, and the Professor for the purpose of understanding, but your work must be your own. See the syllabus for our cheating policy . The general guideline for doing assignments is that you must convince us that you know what youre doing. To receive credit, make sure your solutions are neat and legible, and that you show enough work . Turn in the assignment at the CS231 drop box. You may turn in the assignment up to 24 hours after the due date (ie by Thursday, October 14, at 5:00pm ), but you will receive a 20% late penalty . Homework will NOT be accepted after this (as this is when we will post the solutions). See the syllabus for our late policy . You are encouraged to use book problems for practice. Those marked with a star have solutions available at the books website: http://www.writphotec.com/mano/ Please staple all your pages together with a real metal staple . Feel free to ask us questions at office hours or on the course newsgroup . See the syllabus for instruc tions on setting up the newsgroup. 1 1. Convert the following values to the specified format (16 points) a. 120 to 8bit Ones Complement Binary 0111 1000 The number is positive, so no need to change anything, just straight decimal to binary b. 55 to 8bit Ones Complement Binary 1100 1000 For Ones complement, we just invert each bit of the number. So first we start with 55 = 0011 0111 (padded with zeros to make 8 bits long and then we invert each bit to get 1100 1000) c. 73 to 8bit Twos Complement Binary 0100 1001 The number is positive, so no need to change anything, just straight decimal to binary d. 113 to 8bit Twos Complement Binary 1000 1111 The number is negative, so first we convert 113 to 8bit binary, 0111 0001, complement it and add 1 (0000 0001) e. 1001 1111 from 8bit Ones Complement Binary into Decimal96 We just need to note that the value is negative since the sign bit is 1, invert the bits and convert the...
View
Full
Document
 Spring '08
 
 Computer Architecture

Click to edit the document details