Unformatted text preview:

Homework 2 Homework 2 is due on Saturday October 7 On Blackboard Please submit your Homework on BlackBoard as a pdf file and follow the complete submission guidelines Homework Please ask all questions about this assignment during office hours or post them on Campuswire Be sure to show your work on all your homework problems otherwise you risk not receiving credit It is recommended that you do not use a calculator or online tools etc when you do your homework Remember that there will be no calculators allowed on exams a Assume that the numbers are represented in and give the decimal values of the operands and the sum Does overflow occur 8 bit unsigned binary For each example perform the addition in binary i show the binary carries e Note Give the decimal value of the 8 bit sum even if there is overflow i e even if the sum is incorrect b Repeat part a assuming that the numbers are represented in 8 bit 2 s complement 8 bit 2 s complemen t subtractions Show all steps in your solution including the translation to binary addition State if overflow Binary Representation and Arithmetic 1 Binary addition unsigned and 2 s complement Consider the following 3 addition problems 1 2 3 0100 0101 1101 0101 0110 1110 0110 1110 1011 1101 1101 1011 2 2 s complement subtraction Do the following occurs 1 0100 0101 0101 1110 2 1100 0001 1110 0110 3 0110 0110 1010 1011 3 Interpretation of Data Types Give the value represented by string x716C if the data type encoded is the following Note If it is not a valid representation answer none and explain Note Your result should not be in binary 1 2 3 4 Unsigned 2 s complement single precision IEEE 754 floating point Extended 8 bit ASCII string 4 Conversion from 2 s complement the positional weighting method If X x n 1 x n 2 2 1 0 x x x is an n bit 2 s complement number then the decimal value of X is x n 1 2 x 2 n 2 0 x 2 x 2 x 2 1 2 2 1 0 n 2 n 1 Example The 2 s complement number 1110 has decimal value 2 1 2 1 2 0 2 8 4 2 0 2 2 1 0 3 a Use the positional weighting method to convert the following 2 s complement numbers into their decimal representations 1 2 3 101100 1010011 1110101000 5 Logical operations b Repeat part for these same 3 examples using the 2 s complement method a a Perform the following bitwise logical operations Part 1 uses binary strings and the result should be in binary Part 2 operates on hex strings and the result should also be in hex 1 NOT 0001 OR NOT 0100 AND 1011 2 NOT x3E OR x8C AND x99 b Let a b c be Boolean variables i e each of a b c can have the value 0 or 1 Corresponding to the above equations complete the 3 variable 8 row truth table given below Q1 NOT NOT a AND b OR NOT c Q2 a OR NOT b AND c c NOT a AND b a OR NOT b Q1 Q2 a 0 0 0 0 1 1 1 1 b 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 1 2 15 4375 2 3 What can you say about Boolean expressions for Q1 and Q2 6 Conversion to floating point data type Convert the following decimal numbers into their 32 bit floating point representation IEEE single precision For long binary strings please insert spaces in order that the bits are in groups of 4 You may use a calculator to do the required multiplications but you must show your work not just the solution Hint 1 Not all numbers have an exact representation using the floating point data type so do not expect to always reach 0 after many multiplications Hint 2 If your calculation has a repeating decimal you may either truncate or round to get the last rightmost least significant bit Hint 3 You may wish to convert your answer back to decimal to check the accuracy of your calculations Convert the following 32 bit floating point numbers IEEE single precision into their decimal representation For long binary strings please insert spaces in order that the bits are in groups of 4 As always show your work you may use a calculator for your arithmetic x operations 7 Conversion from floating point data type 1 1100 0100 1101 1001 0000 0000 0000 0000 2 0011 1110 1011 0110 0000 0000 0000 0000


View Full Document
Download Homework 2
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework 2 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?