A3 — Data representation continued
Practice using different text encodings and create an image from raw bytes.
Due Sep 16, 2026
Estimated time to complete (just the assignment, excluding the prep materials): 1–1.5 hours.
Prep materials: Week 3: Data representation continued
What to do
Submit all your answers to Assignment 3 Submission on Brightspace. You can use a text response field, a text file, or a Markdown file for the main response, and you need to attach any files you’ve created.
Part 1. Data representation
- ASCII and hexadecimal
- Find an ASCII table in the prep materials or online and provide a link to it.
- In the table, find ASCII codes for the characters
C,S, and!, and write them in decimal, hexadecimal, and binary formats. For the characterC, explain how the hexadecimal representation is derived from the binary representation.
- Unicode, UTF-8, and UTF-16
- If you have at least two different devices, such as a computer and a phone, check how the character
💻is displayed on each device. If you have only one device, check how the character is displayed in at least two different applications (for example, a web browser and a text editor). Describe what you see and explain why it might be different. - Find the Unicode codepoint for the character
💻(laptop computer emoji), for example, here. - Convert
CS!💻to a list of Unicode codepoints (you can use the Internet for that). How do you know that the codepoints are correct? How does the result compare to the ASCII codes you found in the previous question? Why is that? - Write down the UTF-8 encoding of
CS!💻in hexadecimal and decimal formats. You can use the Internet for that, but you need to explain how you know that the result is correct and provide a link to the source you used. How many bytes are used to encode each character? - Create a text file from raw bytes. Instructions below are for Windows. If you use another operating system, you can find similar instructions online or ask the instructor for help on Discord.
Navigate to the directory where you want to create the file in your Windows File Explorer and open the terminal (Powershell). For that, you can either: click on the address bar at the top of the window, type
powershell, and press Enter; or hold Shift and right-click an empty area of the folder window, and then selectOpen PowerShell window(orOpen in Terminal, depending on your Windows version).Type (or copy) the following command in the terminal and press Enter:
[System.IO.File]::WriteAllBytes("cmsc-100.txt", [byte[]](67, 77, 83, 67, 45, 49, 48, 48))This will create a file named
cmsc-100.txtin the current directory, containing the bytes that correspond to the stringCMSC-100in ASCII.Open the file in a text editor and verify that it displays
CMSC-100.
- Similarly to the instructions above, create a text file
cs.txtfrom raw bytes that correspond to the UTF-8 encoding ofCS!💻.Open the file in a text editor and verify that it displays
CS!💻.Open the file in a web browser (for example, by dragging and dropping the file into the browser window) and check what it shows.
Type (or copy) the following command to the same terminal window as before and press Enter:
Format-Hex cs.txtWrite down your observations.
- Similarly to the above, create a text file
cs-utf16.txtfrom raw bytes that correspond to the UTF-16 encoding ofCS!💻. You can use the Internet to find the correct bytes, but you need to make a note on which exact encoding you used. Open the file in a text editor and the web browser and write down your observations. - Find out how to see the encoding of a text file in your text editor. Write down what you see for all three files you created:
cmsc-100.txt,cs.txt, andcs-utf16.txt.
- If you have at least two different devices, such as a computer and a phone, check how the character
- Watch this video or search on the Internet how to create a .ppm file. Create a .ppm file that contains a 3x3 pixel image where the top row red, the left bottom corner is green, the right bottom corner is blue, the middle bottom pixel is white, the center pixel is black, and the remaining two pixels are gray (with the depth of your choosing but no less than 50). Attach the .ppm file to your submission.
Part 2. History and technologies
Focus on the figure in computing that you picked in Assignment 1. If you haven’t done that part of the assignments, check it out, pick a figure, and also answer the questions from Assignment 2 if you haven’t done that before.
Find answers to the following questions and cite the sources (you can use AI to help you find the information, but you need to consult the sources):
- What major events were happening in the world during their lifetime?
- Did they encounter barriers due to their age, gender, race, nationality, social class, disability, or other circumstances?
- Who taught, mentored, or inspired them?
Grading
Part 1 is graded for correctness, and Part 2 is graded for completion.