ECE 368_ project2 - Google Docs.pdf

ECE 368_ project2 - Google Docs.pdf - ECE368 Project 2...

This preview shows page 1 - 3 out of 14 pages.

ECE368 Project 2: Huffman Coding Milestones and final are due at 11:59pm EDT on the due dates Important notice: 1. Backup your code regularly. 2. Make sure your ECN account works. Inform the instructor/TA any issue early on. Any ECN issue reported to the instructor/TA within 48 hours before the deadline will not be considered for accommodation. 3. Debugging: the instructor/TA will provide abundant, specific suggestions for debugging. However, to ensure fairness among all students, the instructor/TA cannot debug code for individual students. Report your performance | Sample input + binaries Big data challenge (optional) sign up here huge input files: Introduction ASCII coding From ASCII coding towards Huffman coding Towards a Coding Tree Prefix codes Huffman Coding Implementation The Compression or Huffing Program Building the Table for Compression/Huffing Header Information The pseudo-EOF character WHAT YOU NEED TO DO? WHAT CAN YOU ASSUME? MILESTONE1: WHAT YOU NEED TO SUBMIT? FINAL: WHAT YOU NEED TO SUBMIT? FINAL: HOW TO SUBMIT? FINAL: HOW WILL WE GRADE YOUR SUBMISSION?
Image of page 1

Subscribe to view the full document.

Introduction In this project, you will utilize your knowledge about queues and trees to design our own simple version of a file compression and decompression utility (similar to zip and unzip ). You will base your utilities on the widely used algorithmic technique of Huffman coding. In case you did not know it, Huffman coding is used in JPEG compression as well as in MP3 audio compression. Let us see how the procedure of coding works. ASCII coding Many programming languages use ASCII (which stands for American Standard Code for Information Interchange) coding to represent characters. In ASCII coding, every character is encoded (represented) with the same number of bits (8-bits) per character. Since there are 256 different values that can be represented with 8-bits, there are potentially 256 different characters in the ASCII character set. For your reference, the ASCII character table is available at . Note that you must assume that all possible ASCII values may appear in the input text file. Let us now look at a simple example of ASCII encoding of characters. We'll look at how the string " go go gophers " is encoded in ASCII. Using ASCII encoding (8 bits per character) the 13-character string " go go gophers " requires 13 * 8 = 104 bits. The table below shows how the coding works. Character ASCII code 8-bit binary value g 103 1100111 o 111 1101111 p 112 1110000 h 104 1101000 e 101 1100101 r 114 1110010 s 115 1110011 Space 32 1000000 The given string could be written (coded numerically) as 103 111 32 103 111 32 103 111 112 104 101 114 115 . Although not easily readable by humans, this would be written as the following stream of bits (the spaces would not be written, just the 0's and 1's) 1100111 1101111 1100000 1100111 1101111 1000000 1100111 1101111 1110000 1101000 1100101 1110010 1110011
Image of page 2
From ASCII coding towards Huffman coding Next, let us see how we might save bits using a simpler coding scheme. Since there are only 8 different characters in " go go gophers ", it is possible to use only 3-bits to encode the 8 different characters. We might, for example, use the coding shown in the table below (keep in
Image of page 3
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern