CSCI 170 (GOLDWEBER)
Spring 08: 2/19/08
Homework 3
Representations and Boolean Logic
Due Date: Thursday February 21, 2008.
There is a possible 35 points for this homework.
A word to the wise: For any of the following problems if you elect not to show your work it will be impossible to award any partial credit for an incorrect answer.
Problem 1. (6 pts.) If a computer uses 20 bits to represent integer values, what is the largest unsigned value that can be represented? What are the largest positive and smallest negative signed integers that can be represented using sign-magnitude notation? What are the largest positive and smallest negative signed integers that can be represented using 2's complement notation?
Problem 2. (8 pts.) Assume that the following 8-bit numbers represent signed integers using sign/magnitude notation. The sign is the leftmost bit and the remaining 7 bits represent the magnitude. What is the base-ten (decimal) value of each?
a) 10010011
b) 10011110
c) 01101101
d) 10000000
Problem 3. (14 pts.) Provide the 8-bit two's complement representation for the following:
a) -33
b) +67
c) -1
d) 0
e) Show how to carry out the arithmetic operation 67+67
f) Show how to carry out the arithmetic operation -33+(-1)
g) Show how to carry out the arithmetic operation 67+(-33)
Problem 4. (7 pts.) We've seen base 2 (binary) notation for values; an example of a base that is less than 10. Bases higher than 10 are also useful. In particular, computer scientists frequently use Hexadecimal (base 16). In this base, the first ten digits are represented as 0-9, with A,B,C,D,E,F representing 10-15.
a) Convert the values E6 and and 34 from Hexadecimal to Base 10 notation.
b) Convert the values 77 and 90 from Base 10 to Hexadecimal.
c) Convert FF from Hexadecimal to base 2 and convert 11010100 to Hexadecimal.
d) Suggest a reason computer scientists use Hexadecimal to represent values.
File translated from
TEX
by
TTH,
version 3.74.
On 19 Feb 2008, 14:55.