Homework 1 CS 61 Fall 2005 Prof. Frank Vahid See course web page for due date. 5% extra credit if working in study group of 3 or more -- see below. Show work, not just answers, for every problem, to receive credit. Turn in your work electronically as a plain text file (e.g., not a Word doc) with the file named cs61_hw1_firstname_lastname.txt. 1. Convert the following binary numbers to a decimal number. (a) 0111 (b) 1010 (c) 1111100 2. Convert the following decimal numbers to an 8-bit binary number. (a) 8 (b) 33 (c) 254 3. Perform the following additions using 4-bit binary numbers. (a) 9 + 5 = 14 (b) 2 + 2 = 4 (c) 8 + 7 = 15 (d) 9 + 11 = 20 (note: overflow) 4. Convert the following decimal numbers to an 8-bit binary number in two's complement format. (a) 1 (b) -1 (c) -17 (d) 0 (e) What is the range of possible numbers (smallest negative to biggest positive, in decimal) for a 5-bit binary two's complement representation? Express your answer as both as both binary and base 10 numbers. 5. Perform the following computations using 4-bit two's complement binary numbers. (a) 2 + 2 = 4 (b) 2 - 1 = 1 (c) -7 + 2 = -5 (d) 3 - 5 = -2 (e) -7 - 7 = -14 (note: overflow) 6. If you worked in a study group of 3 or more people, list names of study group partners, and date/time/place of meeting. Submissions should each be unique, but explaining concepts, answering each others' questions, and comparing answers for correctness is encouraged. ### end ###