CSCI 112 Spring 2024
Exploring Computer Science
Archived Class
Charles Cusack
Computer Science
Hope College
Main
Schedule
Grading
Gradebook
Homework

Policies
Advice
College
    Policies

Notes
Programs
Tutorials

CSCI 125
CSCI 255
Others

Admin

Homework 4

Details

For each problem make sure you clearly and neatly show all of your work! Each part/problem is worth 5 points.

  1. Add the floating-point numbers 00110101100001001000111110001000 and 00101101010110010010111111110100 by converting to fixed point, doing the appropriate shift, adding, performing an appropriate shift (if necessary), and converting back to floating-point.
  2. Let x = 1.23456×1012 and y = 9.87654×10-5.
    1. What is x+y?
      (Compute it by hand or use something like WolframAlpha to compute the exact answer directly using this representation)
    2. If x and y where stored in 32-bit floating-point notation and we computed x+y and stored the result in 32-bit floating point, what would the answer be and why? (Hint: You should not have to actually do the conversion, but just enough work to justify what is happening.)
  3. Compute the sum of the following 2 numbers that are represented in 12 bit two's complement: 111100001010 and 110011010111. Clearly indicate whether or not overflow occurred and explain how you know.