This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ECE320 Solution Notes to Homework 4 Spring 2006 Cornell University T.L.Fine Please hand in this assignment at the end of lecture on Tuesday, 28 February. Use only your assigned three-digit code and not your name. Throughout, give reasons for your answers. 1. (a) Generate a prefix code C containing 6 codewords. For example, 00 , 01 , 100 , 101 , 110 , 111 . This cannot be done with all codewords of lengths 1 or 2. (b) Sketch a binary tree representation for the code of (a). 1 1 1 1 1 e 111 00 01 101 100 110 Figure 1: Binary Tree (c) Consider the code with the three codewords 10 , 1011 , 10011. Is this a prefix code? No, 10 is a prefix of both remaining codewords. (d) Sketch a binary tree representation for the code of (c). (e) Is the code of (c) uniquely decodable? Yes, it is. All codewords begin with a single 1 and end with either 0 or 11. Working from the right end of a concate- nated string of codewords, if it ends in 0 then the last codeword is 10 and can be removed from the string. If it ends in 11 then the last codeword is either 1011 or 10011 and whichever it is it can be removed from the string. We have nowor 10011 and whichever it is it can be removed from the string....
View Full Document
- Spring '06