UIT2201: Tutorial Set 7 (Spring 2013)
(Solution Sketch to Selected Problems)
** NOT TO BE GIVEN TO FUTURE UIT2201 STUDENTS **

Solution sketches are provided as guidelines only. Do not think of them as *model answers*. As you have noticed from our tutorial discussions, there can be many answers and approaches. So keep an open mind. (More importantly, DO NOT CIRCULATE these solution sketches.)


T7-D1: (Binary Representations)
DIY (See solution sketch for T7-Q1.)


T7-D2: (ASCII and UNICODE encoding) -- SOLUTION SKETCH

      Message: "My secret spot in U-Town" (Do not include the surrounding "" marks.)

(a) in ASCII code --- 24 bytes = 24x8 bits = 192 bits
(b) in UNICODE --- 48 bytes = 48x8 bits = 384 bits
(Note: Count everything between ""; spaces, punctuations, etc.)



T7-Q1: [Binary Representations] --- SOLUTION SKETCH





T7-Q2: (5 points) (Storing Image) -- SOLUTION SKETCH
(Colour digital picture: true colour with 24 bits per pixel)
(a) Uncompressed:  (16 x 106) x 24 bits = 384 x 106 bits = 48 x 106 bytes 
     A 8-GBytes memory stick can store 8*230 / 48 x 106 = 178.957 images
        namely  178 images

(b) Compressed 20:1 ratio: 178.957 x 20 = 3579 songs


T7-Q3: (5 points) (Storing Sound) -- SOLUTION SKETCH
(MP3 format sound) 3 minute song
     [From textbook, MP3 format: sample rate 44,100 and bit depth 16 bits]
(a) Uncompressed:   44100 samples/sec x 16 bits/sample x (60 x 3) sec = 127,008,000 bits
                       = 127,008,000/(220) M-bits = 15.14 MBytes
     A 8-GB memory stick can store about 541 songs (3mins per song)
                8GB/15.14 MBytes = 8*1024MBytes / 15.14MBytes = 541.1
 
(b) With compression ratio 11:1 ratio: 127,008,000/11 = 11,546,181.8 bits = 1.37641 MBytes
     A 1-GB memory stick can store 8*1024MBytes / 1.376MBytes = 5951 songs


UIT2201: CS & IT Revolution; (Spring 2013); A/P Leong HW