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

  1. ASCII and hexadecimal
    1. Find an ASCII table in the prep materials or online and provide a link to it.
    2. In the table, find ASCII codes for the characters C, S, and !, and write them in decimal, hexadecimal, and binary formats. For the character C, explain how the hexadecimal representation is derived from the binary representation.
  2. Unicode, UTF-8, and UTF-16
    1. 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.
    2. Find the Unicode codepoint for the character 💻 (laptop computer emoji), for example, here.
    3. 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?
    4. 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?
    5. 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.
      1. 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 select Open PowerShell window (or Open in Terminal, depending on your Windows version).

      2. 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.txt in the current directory, containing the bytes that correspond to the string CMSC-100 in ASCII.

      3. Open the file in a text editor and verify that it displays CMSC-100.

    6. Similarly to the instructions above, create a text file cs.txt from raw bytes that correspond to the UTF-8 encoding of CS!💻.
      1. Open the file in a text editor and verify that it displays CS!💻.

      2. Open the file in a web browser (for example, by dragging and dropping the file into the browser window) and check what it shows.

      3. Type (or copy) the following command to the same terminal window as before and press Enter:

        Format-Hex cs.txt
      4. Write down your observations.

    7. Similarly to the above, create a text file cs-utf16.txt from raw bytes that correspond to the UTF-16 encoding of CS!💻. 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.
    8. 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, and cs-utf16.txt.
  3. 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.