Assignment #1: Data Representation and Operations
Assigned: Monday, September 11th
Due: Wednesday, September 20th
Contents:
Overview
Topic(s): Numeric Representation, Binary and Hexadecimal, Place Value, Converting between Bases, Characters & Strings, and Operations on Data
Related Reading: class notes, and Chapter 2 of Bryant and O'Hallaron
Practice Problems
Problems to be Submitted (25 points)
You are allowed to submit your assignment via email, but if you choose to do so, you must bring a hardcopy of your assignment along with a completed cover sheet to the instructor at the next class. (Note: Do not email the instructor any .zip file attachments, as SLU's email may not accept these emails; i.e. the instructor may not receive your email.)
Note: It is important that you show your work for all these numeric conversions. Problems submitted without showing work will be given ZERO CREDIT.
 (2 points) Conversion between Binary and Hexadecimal:
Convert the following numbers directly between hexadecimal and binary without first converting to decimal.
 Convert the hexadecimal number 0x1E7BF6 into binary.
 Convert the binary number 110101001110100110_{2} into hexadecimal.
 (3 points) Radixr to Decimal Conversion:
 Convert the binary number 1101101000110_{2} into decimal.
 Convert the hexadecimal number 0x5B6F into decimal.
 Convert the base7 number 26513_{7} into decimal.
 (4.5 points) Decimal to Radixr Conversion:
 Convert the decimal number 247 into binary.
 Convert the decimal number 2465 into hexadecimal.
 Convert the decimal number 207 into base5.
 (4.5 points) Converting Decimal to Signed Representation:
 Convert the decimal number 76 into 8bit signed (two'scomplement) representation.
 Convert the decimal number 434 into 16bit signed (two'scomplement) representation.
 Convert the decimal number 165 into 16bit signed (two'scomplement) representation.
 (3 points) Interpreting as Signed vs. Unsigned:
 If 10101101_{2} is interpreted as an 8bit signed (two'scomplement) number, what is its decimal value?
 If 10101101_{2} is interpreted as an 8bit unsigned number, what is its decimal value?
 If 10101101_{2} is interpreted as a 16bit signed (two'scomplement) number, what is its decimal value?
 (4 points) Characters & Strings:
Wikipedia has a copy of the ASCII table, but you can find plenty of sources via Google, if desired.

What is the string corresponding to the following series of ASCII values:
0x54 0x68 0x69 0x73 0x20 0x69 0x73 0x20 0x41 0x53 0x43 0x49 0x49 0x21 0x00

Convert the string "Billikens rule!" into ASCII.
 (4 points) Operations on Data:
Show the results for the following data operations:
 1101011001111011_{2} + 0001011100001011_{2}
 0x8F3C5  0x4BC3
 001100010100_{2}  000111010100_{2}
 001100010100_{2} & 000111010100_{2}