Professional Documents
Culture Documents
Ascii: Homework 1 - Text Representation
Ascii: Homework 1 - Text Representation
ASCII and UNIC D! are both used to represent text in computer s"stems. #a$ Describe one ad%anta&e of UNIC D! o%er ASCII.
Larger range of characters, i.e. 65536 an cope !ith the characters of a"" "anguages #b$ Describe one disad%anta&e of UNIC D! o%er ASCII.
#sing #$% &'E each character re(uires ) bytes of storage !hereas in *+ %% 1 byte of storage is re(uired #'$
Homework 2 1.
um!er Representation
ne method of representin& a ne&ati%e inte&er in a computer is b" usin& the two(s comp)ement of the correspondin& positi%e inte&er. *hich of the fo))owin& is the + bit two(s comp)ement representation of ,-. #a$ /////111 #b$ 1////111 #c$ 11111//1 1 c 11111,,1
2.
-he number is bro.en do!n in to the mantissa and the e/ponent and each part is stored separate"y in memory. 3. *hat is the + bit two0s comp)ement representation of the number ,-2. 1,11 1,,, 1
'.
In computer s"stems1 inte&ers are stored usin& two(s comp)ement representation. *hat wou)d be the ran&e of inte&ers which cou)d be stored in one b"te if two(s comp)ement representation was used. 1
,12+ to 122. In computer s"stems1 )ar&e numbers are stored usin& f)oatin& point representation. State the effect of increasin& the number of bits used to store3 #i$ the mantissa4 #ii$ the exponent. 2 (i (ii 5. %ncreased precision of number stored increased range of numbers can be stored 2
6i%e two reasons wh" computers use binar" numbers to represent and store data. on"y four ru"es of addition , and 1 easi"y represent on and off signa" degradation has no effect
-.
*hich one of the fo))owin& is the +,bit two(s comp)ement representation of ,1'. #a$ 1111///1 #b$ 1111//1/ #c$ 1///111/ #d$ 1111//11 b 1111 ,,1,
+.
7.
8epresent the decima) number 9-3 usin& + bit two0s comp)ement. 1,11 ,111
1/.
Con%ert this +,bit two0s comp)ement binar" number into a decima). 11/1//11 015
#12$
H %ones &nterprises
=i&ure 1 Describe two wa"s in which this ima&e cou)d be represented in memor".
'
As a bitmap. -he comp"ete image is represented by a grid of pi/e"s. Each pi/e" is assigned a number !hich represents its co"our or tone. -his number is stored in memory. As a vector. Each ob4ect is represented by a set of ob4ect attributes. E.g. a "ine may be described by its starting point, "ength and thic.ness. -he 5a"ues of the ob4ect attributes are stored in memory. 3. A scanned ima&e measures 3 inches b" ' inches. It was scanned at 5// dpi in 225 co)ours. Ca)cu)ate the stora&e re;uirements for the scanned ima&e in me&ab"tes. Show a)) "our wor>in&. 2 6,, / 3 / 6,, / 1 / 8 3156,,,,(bits)28 13),,,,(bytes)21,)1 1)18.8(.b)21,)1 1.1 3b '. <wo %ersions of the ima&e be)ow ha%e been created. the other in a %ector &raphic pac>a&e. ne in a bit,mapped &raphic pac>a&e and
If a circ)e is added to the centre of the &raphic1 what is the effect on the fi)e si?e in each case. 2 %t !ou"d ha5e no effect on the fi"e si6e of the bit0mapped graphic and the fi"e si6e of the 5ector graphic !ou"d increase.
2.
@ohn uses his di&ita) camera to ta>e photo&raphs. It has a 212 Me&ab"te memor" card. :is camera uses 151---1215 co)ours and is set to a reso)ution of 3/// A 2/// pixe)s. #a$ Ca)cu)ate the fi)e si?e of a sin&)e ima&e. Bour answer shou)d be in appropriate units. Show a'' wor>in&. 3 3,,, / ),,, / )1 111,,,,,,(bits)28 18,,,,,,(bytes)21,)1 17578.1(.b)21,)1 17.) 3b #b$ *hat is the maximum number of ima&es of this si?e that can be stored on @ohn0s memor" card. 2 51)217.) )7.) therefore )7 pictures can be stored #c$ :e chan&es the settin& in his camera to reduce the bit,depth. Describe one effect that this wi)) ha%e. it !i"" reduce the co"our (ua"ity in the picture
5.
-.
Caro)"n reduces the bit,depth of photo&raphs from 2' bits to 15 bits before sa%in& them onto the hard dis> of her computer. #a$ Describe one ad%anta&e of reducin& the bit,depth of the photo&raphs from 2' to 15. 2 it !i"" be "ess demanding on storage #b$ Describe one disad%anta&e of reducin& the bit,depth of the photo&raphs from 2' to 15. it !i"" reduce the co"our (ua"ity #c$ A ' inch b" 5 inch photo&raph with a reso)ution of 5// dpi and usin& 15,bit co)our depth is stored. Ca)cu)ate the fi)e si?e of the photo&raph. State "our answer usin& appropriate units. Show a)) "our wor>in&. 3 1 / 6,, / 6 / 6,, / 16 138)1,,,,(bits)28 17)8,,,,(bytes)21,)1 16875(.b)21,)1 16.5 3b
#2'$