|
![]() |
![]() |
![]() |
![]() |
Due: Thursday, April 8, at 11 pm.
The purpose of this assignment is to get some practice with binary encodings of numbers and characters. All binary and hexadecimal integers should be treated as 16-bit numbers, 2's complement integers.
General hint: When converting between binary and decimal, it may be faster to convert to/from hexadecimal first, rather than dealing with the individual bits one by one. However, you should know how to do the conversions either way (directly from binary, or via hex numbers).
Obviously, many of these questions can be answered trivially by typing numbers into a calculator and pushing a button. Please be sure you can do them without having to rely on that.
We suggest you show your work or partial results so if your answer isn't completely correct we can fairly assign partial credit.
0000 1000
0011 0101
0101 0000 1100 1101
1111 1110 1101 0101
1000 0000 0000 0001
0x019a
0xff3d
0xFACE
0x1010
0x0017 + 0x0042
0x0017 - 0x0042
0x0BAD + 0xF00D
0x1101 - 0xff0f
"Foo"
would
be stored in 4 bytes with the hex value 0x466f6f00
. "Hi y'all!"
"x+1=17?"
0x4974 2773 2061 2022 7365 6372 6574 2221 2100
0x596f 7527 7265 2064 6f6e 652e 00
Turn-in Instructions: Use the turn-in drop box link on the main course web page to submit a file containing your solutions. You can use any common file format, including plain text, word, or pdf. If you wish, you could also scan in a hand-written solution and submit that, but if you do that, please be sure your handwriting is neat and legible. Please be sure to include your name at the top of your answers.
![]() |
Computer Science & Engineering University of Washington Box 352350 Seattle, WA 98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to Hal Perkins] |