Docsity

Computer CDA 3100 Homework 1, Schemes and Mind Maps of Computer science

Partial preview of the text

Download Computer CDA 3100 Homework 1 and more Schemes and Mind Maps Computer science in PDF only on Docsity!

Homework Assignment #1 – Number Representations

Problem 1 (30 points, 10 points each) Convert the following decimal numbers into (a) 8-bit, (b) 16-bit, and (c) 32-bit binary numbers. For negative numbers, use the 2’s complement. State “overflow” if a number cannot be represented correctly. Hint: You may want to use the sign extension rule.

  1. (^89) ten.
  2. -33 (^) ten.
  3. -2,800 (^) ten. Problem 2 (30 points) What decimal number does each of the following two’s complement binary number represent?
  4. 1111 1111 1111 1111 1111 1111 1100 0101 (^) two.
  5. 1111 1111 1111 1111 1111 1111 1010 1011 (^) two.
  6. 1111 1111 1111 1111 1111 1111 1111 0101 (^) two. Problem 3 (40 points, sub-problem 3 is 20 points, others 10 points each) Show the IEEE 754 binary representation for the following floating-point numbers in single and double precision. Give your results in hexadecimal format.
  7. (^27) ten.
  8. -1.375 (^) ten.
  9. 0.3ten.

Axel Reich

n 1.

2

Flip

3 Add^1

n 12 0000 0000 0000 0000 0000 000 0010 0000

2 flip

S O

0

2 0 3 I

27 1.1011^2

Sign bit o Exponent

mantissa (^1011 0000 0000 0000 0000 000 23) bit

(^2) 1.375 (^) 1,0 12

0.5 (^2) I

sign

bit I

Exponent 01111111

Montiss 01100000000000000000000

I 01111111

n x2 bit

0.6 1.2 I

0.8 (^1 6 ) 0.6 1.2^1 bit (^1) repeating 0 0100110011 2 sign bit O Exponent (^2 1275 12510 ) mantissa (^0011001100 23) bits 0 01111101 0011001100 23 bits