Docsity

Homework 2 on Computer Organization | CS 061, Assignments of Computer Science

Toggle sidebar
bg1
Homework 2 โ€“ Due as hard copy (printed!!) at start of class Wednesday 1/21 - 5 points
Collaboration policy:
Collaboration on this homework is strongly ENCOURAGED.
The homework is intended for practice, not assessment -- most people who turn in decent work
should get an A or B. Forming study groups is strongly encouraged. You shouldn't simply copy
answers from any source -- each other, the book, the web, other books, previous solutions, etc.
But you can certainly discuss how to solve the problems, look over each others solutions and help
"debug" them, compare answers and redo problems if you determine your answer is wrong, and
most importantly, explain concepts related to the problems and solutions.
1) Convert the following unsigned binary numbers to decimal:
Binary Decimal
1010101
1100011.1011
2) Convert the following decimal numbers to unsigned binary, using only as many bits as needed:
Decimal Binary
421
135
3) Write the 8-bit, 2's complement of the following binary numbers, and then give the decimal equivalent of the resulting
value:
Binary 2โ€™s Complement Decimal
01110110
10000111
4) Perform the following arithmetic operations in binary using 8-bit 2's complement representation for negative
numbers. (Hint: do subtraction by adding the complement).
a. 27 โ€“ 14 =
CS 061 - Computer Organization Winter 2004
pf2

Partial preview of the text

Download Homework 2 on Computer Organization | CS 061 and more Assignments Computer Science in PDF only on Docsity!

Homework 2 โ€“ Due as hard copy (printed!!) at start of class Wednesday 1/21 - 5 points

Collaboration policy:

Collaboration on this homework is strongly ENCOURAGED.

The homework is intended for practice, not assessment -- most people who turn in decent work

should get an A or B. Forming study groups is strongly encouraged. You shouldn't simply copy

answers from any source -- each other, the book, the web, other books, previous solutions, etc.

But you can certainly discuss how to solve the problems, look over each others solutions and help

"debug" them, compare answers and redo problems if you determine your answer is wrong, and

most importantly, explain concepts related to the problems and solutions.

  1. Convert the following unsigned binary numbers to decimal: Binary Decimal 1010101
  1. Convert the following decimal numbers to unsigned binary, using only as many bits as needed: Decimal Binary 421 135
  2. Write the 8-bit, 2's complement of the following binary numbers, and then give the decimal equivalent of the resulting value: Binary 2โ€™s Complement Decimal 01110110 10000111
  3. Perform the following arithmetic operations in binary using 8-bit 2's complement representation for negative numbers. (Hint: do subtraction by adding the complement). a. 27 โ€“ 14 =

CS 061 - Computer Organization Winter 2004

b. 19 โ€“ 28 =

  1. Represent ๏ฏ (pi) in IEEE 32-bit Floating Point Representation to 4 decimal places of precision โ€“ i.e. work with the approximation 3.1416 for ๏ฏ (Hint: first work out how many bits to the right of the binary point will be needed to get within +/- .0001 (decimal) of the desired number by working out decimal values for 2-1, 2-2, 2-3, etc.) Decimal S Exponent Fraction

Hexadecimal representation: 2