Docsity

ECE190 Spring 2009 HW1: Bit Req., 2's Comp. Conv., and Overflow Proof, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE190 โ€“ Spring 2009
Homework 1
(Due: 01/27/2009)
Textbook Problems: 2.2, 2.8, 2.10, 2.17, 2.18, 2.34, 2.46, 2.50
X1. A bag contains three balls: one red, one yellow, and one blue. For a certain game,
you pull a ball at random from the bag, record its color, return the ball to the bag, and
repeat the process.
a) How many bits are necessary to store the color of the first ball
drawn in such a game?
b) The first two balls (including the order)?
c) The first three balls (including the order)?
X2. Given a number in N-bit 2's complement form, explain how you can easily find the
number's representation in (N+2)-bit 2's complement form. Hint: look at the 3-bit, 4-bit,
and 5-bit representations of numbers that can be represented with 3 bits.
X3. Prove that overflow cannot occur when a negative N-bit 2's complement number is
added to a non-negative N-bit 2's complement number. Hint: use a range argument based
on the number of bits N in the numbers.

Partial preview of the text

Download ECE190 Spring 2009 HW1: Bit Req., 2's Comp. Conv., and Overflow Proof and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE190 โ€“ Spring 2009

Homework 1

(Due: 01/27/2009)

Textbook Problems: 2.2, 2.8, 2.10, 2.17, 2.18, 2.34, 2.46, 2.

X1. A bag contains three balls: one red, one yellow, and one blue. For a certain game, you pull a ball at random from the bag, record its color, return the ball to the bag, and repeat the process.

a) How many bits are necessary to store the color of the first ball drawn in such a game? b) The first two balls (including the order)? c) The first three balls (including the order)?

X2. Given a number in N-bit 2's complement form, explain how you can easily find the number's representation in (N+2)-bit 2's complement form. Hint: look at the 3-bit, 4-bit, and 5-bit representations of numbers that can be represented with 3 bits.

X3. Prove that overflow cannot occur when a negative N-bit 2's complement number is added to a non-negative N-bit 2's complement number. Hint: use a range argument based on the number of bits N in the numbers.