Docsity

Computer Science Assignment: Binary and Hexadecimal Representation, Assignments of Computer Science

Toggle sidebar
bg1
CMSI 182
IN T R O D U C T I O N T O CO M P U T E R SC I E N C E
Fall 2007
Assignment 0913
As a reminder, note that the assignment number (“0913”) indicates the due date; I will ask for submissions
at the beginning of class on that day.
Not for Submission
Read Chapter 1 in the Brookshear book.
For Submission
1. Below is a table listing numbers “as we know them” in the first column, their binary representation (in 8
bits) in the second column, and their hexadecimal representation in the third column. Fill in the blanks.
“Normal” Number
Binary Representation
Hexadecimal Representation
22
6B
254
128
0111 1000
AB
2D
0000 1010
99
99
2. Let’s play The Adventure of the Dancing Bits — encode or decode the following messages using ASCII. If
the message is to be encoded, use hexadecimal. Watch out for upper vs. lower case, spaces between
words, and punctuation — they matter!
a. encode: TTYL
b. decode: 48 65 6C 6C 6F 20 77 6F 72 6C 64 21
c. encode: Meet at midnight
d. decode: 4D 41 59 20 54 48 45 20 46 41 52 43
45 20 42 45 20 57 49 54 48 20 54 48 45 45
e. encode: I have a SECRET...
3. Suppose an alien race wishes to learn about binary data storage from you. They understand English
very well, and are excellent at following instructions. Write up the following “how-to” recipes as pre-
cisely as possible, so that they can perform these tasks correctly without having to really understand
what they’re doing.
a. How to represent any number from zero to 15 as a four-bit binary number.
b. How to convert any letter of the English alphabet into its equivalent ASCII hexadecimal code.

Partial preview of the text

Download Computer Science Assignment: Binary and Hexadecimal Representation and more Assignments Computer Science in PDF only on Docsity!

CMSI 182

I N T R O D U C T I O N T O C O M P U T E R S C I E N C E

Fall 2007

Assignment 0913

As a reminder, note that the assignment number (“0913”) indicates the due date; I will ask for submissions at the beginning of class on that day.

Not for Submission

Read Chapter 1 in the Brookshear book.

For Submission

  1. Below is a table listing numbers “as we know them” in the first column, their binary representation (in 8 bits) in the second column, and their hexadecimal representation in the third column. Fill in the blanks. “Normal” Number Binary Representation Hexadecimal Representation 22 6B 254 128 0111 1000 AB 2D 0000 1010 99 99
  2. Let’s play The Adventure of the Dancing Bits — encode or decode the following messages using ASCII. If the message is to be encoded, use hexadecimal. Watch out for upper vs. lower case, spaces between words, and punctuation — they matter! a. encode: TTYL b. decode: 48 65 6C 6C 6F 20 77 6F 72 6C 64 21 c. encode: Meet at midnight d. decode: 4D 41 59 20 54 48 45 20 46 41 52 43 45 20 42 45 20 57 49 54 48 20 54 48 45 45 e. encode: I have a SECRET...
  3. Suppose an alien race wishes to learn about binary data storage from you. They understand English very well, and are excellent at following instructions. Write up the following “how-to” recipes as pre- cisely as possible, so that they can perform these tasks correctly without having to really understand what they’re doing. a. How to represent any number from zero to 15 as a four-bit binary number. b. How to convert any letter of the English alphabet into its equivalent ASCII hexadecimal code.