COMPUTER SCIENCE NOTES - Ashwin Ahuja

41
COMPUTER SCIENCE NOTES AQA AS Level Ashwin Ahuja

Transcript of COMPUTER SCIENCE NOTES - Ashwin Ahuja

COMPUTERSCIENCENOTESAQAASLevel

AshwinAhuja

1:FundamentalsofProgrammingMuchofthissectionrequiresonetounderstandhowtocompleteanumberoftasks,suchasiteration,whichwouldbespecifictothelanguageofuse,andarerathertrivial.

ALGORITHM:Setofrulesorsequenceofstepsspecifyinghowtosolveaproblem.Thespecificationindicatesthatthestepsindicatedbythealgorithmmustterminate,butmanydisagreewiththis.AnAlgorithmgenerallycontainsanINPUTstep,aPROCESSINGstepandanOUTPUTstep.

DataTypes:Differenttypesofdataarestoreddifferentlyinthecomputer’smemory;theseare:

• Integers:Numberwrittenwithoutafractionalcomponent,isamemberof • Real(floats):Numberwrittenwithafractionalpart.• Boolean:Variablewithtwopossiblevalues,‘true’and‘false’• Character:Asinglenumber,letter,etc.• String:Arrayofcharacters• Date/Time:Storageofthedateandtime• Arrays:Collectionofanumberofsimilarvariables–ofteninrowsandcolumnsinatablelikestructure• Records(Struct):Collectionoffields,oftenwithanumberofdifferentvariables.

ProgramConstructs:Therearethreebasicprogrammingconstructs:Sequence,SelectionandIteration.

• Sequenceisonestatementaftertheother.• Selection statements are used to findwhich statement should be performednext,making use of

conditionaloperators.• Iteration:Twotypesofiteration,definiteandindefiniteiteration–withdefiniteiterationinvolvinga

clearassignmentatthebeginningoftheloopofhowmanyloopcycleswouldoccurfor.Meanwhiletheindefiniteloopwouldoftenmakeuseofconditions,(suchasinawhileloop),wheretheloopwouldoccurwhiletheconditionisbeingmet.

UsingVariables:Theprocessinvolvesthreesteps,declaration,followedbyassignmentandthenuse.

IdentifierNames:Thesenamesareusedforeverythingfromthenamesofvariablestothenamesofclassesandfunctions.Itishelpfultoimportanttouseusefulidentifiernamesasitmakesiteasierfortheprogramtobeeasilyreadablebyyouorindeedbyothers.

IntegervsFloatDivision:Integerdivisionreturnstheanswerwithouttheremainder,whereasfloatdivisionwillreturntheanswertothedivisioninadecimalform.Inordertogetjusttheremainder,modulardivisioncanbeused.

Truncation:Processbywhichthenumberofdigitsafterthedecimalpointarelimited.

BooleanOperations:Booleanoperationsareeffectivelypassing variables through logic gates, suchas theAND,OR,andNOTgate.

VariablesvsConstants:Variablesareidentifierswhicharegiventoaspecificmemorylocationwherethevaluewill change over the course of the program. Constants are instead values which will remain constantthroughouttherunningoftheprogram–inalongprogram,theyofferpeace-of-mindtoaprogrammer,thattheycouldnotchangethisvalue.

ExceptionHandling:Exceptionhandlingisamechanismbywhichtheprogramwillcaterforanypossibleissuesthatoccurthroughtherunningoftheprogram,suchasaccessingnon-existentvariables,etc.

Subroutines:Asubroutineisablockofcodewhichperformsaspecifictaskwithinaprogram.Therearetwomaintypesofsubroutines,functionsandprocedures.Thereareanumberofbuiltinfunctions,forexampleinC#,functionsincludeConsole.ReadLine().Somefunctionsreturnaresult,whilesomearevoid,thereforenotreturningaresulttothemainprogram.Afunctioniscalled,alwaysassigningthevalueofthereturnvaluetoavariable.Aprocedureiscalledbywritingtheidentifierwithoutsettingthevalueofthereturnvaluetoavariable.Inthesamewaythatsubroutinescanreturnvaluestothemainprogram,themainprogramcanbepassedasparameterstothesubroutine.

Structured Programming:When a program is short and simple, there is no need to break it up intosubroutines.However,whentheprogramis long, it isoftenusefultobreaktheprogramintoanumberofsubtasks.Thisoffersanumberofadvantages.

1- Easiertoreadfortheprogrammerandsomeoneelsereadingtheprogram.2- Easiertoedittheprogram–maintainability.3- Easiertowriteanalgorithm–wheretheproblemcanbedividedintoanumberofsubtasks.4- Reducedcomplexity.

Hierarchy Charts can be showed to show the structure of the program, including how it flows, includingsubroutines and subroutines inside these subroutines.However, theprogramdoesnot show thedetailedprogramstructuresineverymodule,thereforeitdoesn’thavetherequiredcomplexity.Thesecanbeshowninastructurechart.

2:TheoryofComputationStagesinSoftwareDevelopment:Thereareanumberofstagesinwritingsoftware,hence:

• Analysis:Therequirementsandgoalsoftheprojectmustbeestablishedandthemodelcreated.Theneedsoftheendusermustbeconsideredandalternativesolutionstotheproblemsuggested.

• Design:Thedatastructures,algorithms,userinterfacesandallotherscreensmustbedefined.• Implementation:Thecodewillbewritten.• Testing:Thesystemmustbetestedforerrors,testingallpossibledata.• Evaluation:Thesystemisevaluatedaccordingtothecriteriadefinedduringtheanalysis.

ProblemSolvingTechniques:1- Exhaustive Search: An exhaustive search involves making all the possible attempts to solve the

problem,testingthesolutiontoseeifitisthecorrectsolution,beforemovingonifitisincorrect.2- DivideandConquer:Anotherstrategyinvolvesusingabinarysearch,separatingthepossiblesolutions

intotwoeverytime.

Algorithms:Agoodalgorithmisclearandcontainspreciselystatedstepsthatproducethecorrectoutputforanysetofvalidinputs.Itshouldalsoallowforinvalidinputs,executingefficiently,inasfewstepsaspossible.Thebookmentionsthealgorithmhavingaterminationandbeingeasilyreadable.However,Idisagreewithboth,sincethealgorithmdoesn’thavetoterminate,andthefactthatitisreadableislessaboutthealgorithmandmoreabouthowitiswritten.

Examplesofalgorithmsincludeinternetalgorithmsandsortingalgorithms,suchasBubbleSort.BubbleSortisanalgorithmwhichswapsthenumbersinalistwhenthenumberisoutofplace,continuouslydoingthisuntilthelistofnumbersiscorrectlysorted.

Testing:Thepurposeoftestingistotryanduncoverundetectederrors.Testinginvolvestestinginputteddatawhichcould create issues, including using normal data, boundary data (at the edge of expected values) anderroneousdata,whichshouldbecateredforintheprogram.

Inorder to testanalgorithm,onecaneasilycompleteadry run,makinguseofa trace table to track thevariablesandthevaluesinthem.

AbstractionRepresentationalAbstractioncanbedefinedasarepresentationarrivedatbyremovingunnecessarydetails.Abstraction by generalisation or categorisation is a grouping by common characteristics to arrive at ahierarchicalrelationshipofaspecifictype.Abstractionisusedmajorlyinprogramming,especiallyinhighlevelprogramming languages,wherewords are using instead ofmachine code, in 1s and 0s, and a number oftediouselementsoccurontheirown,duringthecompilationofthecode.

InformationHiding:Informationhidingisanoftenusedtacticthatisusedtosimplifyaproblem,toallowasolutiontobefoundmoreeasily.Thisisthroughexcludingalltheinformationthatisunrequired.Forexample,inthebridgesofKonigsbergproblem,LeonhardEulercompiledtheentiremapintoamapofthebridges,thenmovingtosimplyagraphwithanumberofnodesonthediagram.

ProceduralAbstraction:ProceduralAbstractioninvolvesensuringthatthevaluesinasystemcouldeasilybealteredwithoutcreatinganyproblemswiththeactualprogramitself.Thiscanbethroughtheuseoflocalandthoughlargelynotrecommendedduetohoweasilyitwouldbetolosetrackofthem,localvariables.

FunctionalAbstraction:This involves theuseofanumberof functions tocarryoutspecificsub-problems,whichmakesiteasierforausercodingthemainpartofthecode,asthemethodofthefunctionisnotneededto be known. Though the book indicates they are largely referring to pre-built functions, the method offunctionalabstractioncouldalsobeusedwhenthefunctionsarebeingmadein-house.

DataAbstraction:Themannerinwhichthedataisstoredishidden,thisislargelycarriedoutbythetranslators,whichcompletealltheworkintohowthememoryofthecomputerworks.Forexample,whenonedefinesaninteger,theexactwayinwhichthenumberisstoredisunimportant.

ProblemAbstraction:Thedetailsofaproblemcanbesimplifieduntiltheproblemismuchsimplerthantheoriginalprogram,thereforebeingeasytobesolved,asproblemslike ithavebeensolvedmanytimes.Thebookofferstheexampleoftheproblemwheretherearefourknightsona3x3chessboard,andonewantstoswitch the black and white knights’ positions in the corners. This problem can easily be distilled into anoctagonalchain,whichwouldshowhowtheproblemisrelativelyeasytosolveandcomplete.

Decomposition:Decompositionisbreakingdownacomplexproblemintoanumberofsub-problems,eachofwhichplaysapartinthecompletesolution.Thesesub-problemscanalsobesub-dividedandsoforthuntiltheproblemhas been split into enough chunkswhich could be dealtwith separately. Thismethod is used inproceduralabstraction(andfunctionalabstraction)wheretheindividualfunctionsorprocedurescompleteaspecifictask.

Composition: In composition, a number of functions or procedures can be combined to formcompoundprocedures,whichwouldbeabletosolvetheproblem.Compositioncanalsoinvolvecombiningdata,formingacompounddatastructure,whichcanbestoredinanumberofmethods,fromarrays,tolists(vectors).

Automation:Automationinvolvesputtinginplacetheabstractionsoftheprobleminreallife.PhysicalWorld–createanabstraction --->MathematicalModel–automate--->Automaton–tellsusmoreabout--->PhysicalWorld.Hencetheautomationcantellusmoreaboutthephysicalworld,byfindingthemathematicalcorrelationsandcausationswhichcanbefoundwhenthesituationismodelled.

FiniteStateMachines:Afinitestatemachineisamodelofcomputationusedtodesigncomputerprogramsandsequentiallogiccircuits,abstractingthesolutionintoanumberoffinitesteps.TheMachinecanonlybeinonestateatatimenormallytransitioningfromonestatetoanotherinresponsetoaneventorcondition.AFiniteStateMachinewhichdoesnothaveanoutputisknownasaFiniteStateAutomaton,wherethereisastartstateandanendstatewithnoresultsthatwouldoccurasoutputsduetoachangeinstates.IfachangeofstatesiscausedbyaninputitisknownasaDeterministicFinalStateAutomaton.

Symbol Meaning

State

StartState

EndState

Transition

InadditiontoEndStates(oracceptstates),therearedeadstateswherethemachinewillstayatwhenthemachinecanneverreachtheendstate.

State Transition Tables: State transition tables indicate how the path through the machine will changedependingondifferentinputs,showingthecurrentstate,thedifferentpossibleinputsandthedifferentnextstatestheywouldleadto.

3:FundamentalsofDataRepresentationNumberSystemsN:NaturalNumbers –positive integerornonnegative integer (somepeople choose to include zerowhileothersdonot)

Z:Integers–numberswhichcanberepresentedwithoutafractionalordecimalpart.Thenaturalnumbersareasubsetoftheintegers.

Q:RationalNumbers–numberswhichcanberepresentedasa fraction. Irrationalnumberssuchasπarenumberswhichcannotberepresentedasafraction

R:RealNumbers–setincludingallnatural,rationalandirrationalnumbers.

OrdinalNumbers:Indicatethenumericalpositionofobjects–1st,2ndetc.

NumberBasesDifferentnumberbasesshowhowmanypossiblenumberscouldberepresentedbyasinglecharacter.

Denary:Base10–makesuseof‘0’to‘9’

Binary:Base2–makesuseof‘0’and‘1’

Hexadecimal:Base16–makesuseof‘0’to‘9’and‘A’to‘F’

Conversion

1. DenarytoBinarya. Findthelargest2^nthatwouldfitintothenumberandthensubtractthisfromtheoriginal

number.Fromhere,lookatallpossible2^n-xwheren-x>=0,puttinga0ifitwouldnotfitinwhatisleftofthenumberora1ifitwould,thensubtractingthisfromthenumber.

2. BinarytoDenarya. Using themultipliers of each column, add up the values to find the original number, for

example:

0 1 1 1x8 x4 x2 x10 4 2 1Therefore0111=0+4+2+1=7

3. BinarytoHexadecimala. Lookateachnibble(fourbits)ofthenumberseparately,convertingeachintohex,(largely

throughconvertingthroughdenary) thencombiningeachhexequivalentofeachnibbletoformonecompletehexadecimalnumber.

4. HexadecimaltoBinarya. Convert each hexadecimal digit directly into a nibble, converting through denary, then

recombiningthevalueafterwards.5. DenarytoHexadecimal

a. Followthesameprocessasfordenarytobinaryjustfor16asopposedto2.6. HexadecimaltoDenary

a. Usingthemultipliersofeachdigit,addupthevaluestofindtheoriginalnumber.

HexadecimalAdvantages:

1. Usedtorepresentbinarysinceitcanrepresentabyteinonlytwodigitsratherthantheeightrequiredifbinaryweretobeused.

2. Easyfortechniciansandcomputerusertorememberhexadecimaldigits.3. Easytoconverttoandfromrawvaluesonthecomputer,sincebinarycanbeeasilyconvertedtohex.

BinaryTerminology

• Bit=fundamentalpieceofinformation–asingle1or0• Byte=setofeightbits• Nibble=setoffourbits• Signed Integers are when the binary can represent both positive and negative numbers, where

integersareunsignedwhenthatcanonlyrepresentnonnegativeintegers.

UnitNomenclature

Name Symbol PowerKibi Ki 210Mebi Mi 220Gibi Gi 230Tebi Ti 240Pebi Pi 250Exbi Ei 260Zebi Zi 270Yobi Yi 280 Kilo K 103Mega M 106Giga G 109Terra T 1012Peta P 1015Exa E 1018Zetta Z 1021Yotta Y 1024

ASCIITable

ThestandardmannerforrepresentingthecharactersonakeyboardiscalledASCII(AmericanStandardCodeforInformationInterchange).ASCIIoriginallyonlyused7bits,buttherewasanincreaseintoan8bitversionto attempt to include more characters such as those in foreign languages. Subsequently, there was theproductionofUnicode (UTF-16 andUTF-32)whichhave all thepossible characters that couldbeneeded.However, this ensured that the first 128 characterswere the sameas those inASCII to ensure therewascompletecompatibilitywiththis.

ImportantCharacters:

• ‘’=32• ‘0’=48• ‘A’=65• ‘a’=97

RepresentingNegativeNumbersTwo’s Complement: Two’s complement is a system where the most significant bit of the sum indicateswhetherthenumberispositiveornegative,whiletherestofthesystemdeterminethevalueofit.Therangethatcanbegivenbyatwo’scomplementnumberishence:

− 2#$% 𝑡𝑜2#$% − 1(𝑤ℎ𝑒𝑟𝑒𝑛𝑖𝑠𝑡ℎ𝑒𝑛𝑢𝑚𝑏𝑒𝑟𝑜𝑓𝑏𝑖𝑡𝑠𝑢𝑠𝑒𝑑)

Therefore,foraneightbittwo’scomplementnumber,anynumberbetween-128and127canberepresented.

ConvertingDenarytoTwo’sComplement

• Denary=-10• Binaryof10=00001010• FLIPthebits=11110101• Addone=11110110

ConvertingTwo’sComplementtoDenary

• Two’scomplement=11100101• FLIPthebits=00011010• Addone=00011011• Therefore,positivedenary=1+2+8+16=27• Therefore,originalwas-27

OR

1 1 1 0 0 1 0 1-128 64 32 16 8 4 2 1-128 64 32 4 1-128+64+32+4+1=-27

RepresentingFractionsThebinarysystemcontinuesfrom20to2-1(0.5)etc,henceallowingustorepresentdecimals.However,itisimportant tonote that thesystem is lessuseful thanthedecimalsystemasmanydecimalswouldrequireinfinitebitstorepresentthem,suchas0.2and0.3.

Toconvertfromdecimaltofixedpointbinaryissimilartoconvertfromdenarytobinary,whereoneattemptstofindthelargest2nthatwouldfitinthedecimalbeforemovingfurthertolowern,untiltheentiredecimalhasbeenrepresentedinthebinaryusing2n+2m…

Anotherwayofrepresentingfractionsismakinguseoffloatingpointnumbers,however,thisisnotpartoftheASCourse.

ErrorCheckingParityBits:Thiswasdevelopedespeciallywhentherewasanextrabit,when7bitASCIIcodewasused.Thisextrabitcouldhelptofindiftherewasasinglechange.Therearetwotypesofparitybits,evenparityandoddparity.Thisworksbyensuringthatthenumberof1sinthebyteareevenoroddrespectivelybyusingthe8thbitasa0or1asrequired.Thisensuresthatifthereisachangeintherestofthebyte(orindeedintheparitybit),thereceiveronattemptingtoverifyit,wouldfindthattherewasaproblem,andhencerequestretransmission.However,iftherearetwo(orevennumber)ofproblems,thiswouldnotfindthat.

MajorityVoting:Majorityvotingisasystemwhichwouldrequirethesamebittobesentthreetimes.Onthereceivingend,theseareevaluatedforeachbitanditchoosesthemajorityreceipt(0or1)tobethecorrectonethathadbeensent,assumingthatthemajorityoftransmissionswouldbecorrect.

Checksums:Checksumsworkbyaddingupthevalueofallofthebytesseparatelyandsendingthisvalueinadditiontoeverythingelse.Therefore,itislikely(thoughnotguaranteed)thatifthereareanychangesinanyofthebytesitwouldchangethevalueofthechecksum,henceregisteringaproblemonthereceivingend.Thiswouldthenallowthereceivingcomputertorequestretransmissionoftheinformation.

Checkdigit:Acheckdigitissimilartoachecksumandincludesanadditionaldigitattheendofthestringoftheothernumbers.AnexampleofauseofcheckdigitsisintheISBN(InternationalStandardBookNumber)andEAN(EuropeanArticleNumber)whichisspecifictoeachbook.Theymakeuseofthemodulo10system.

ISBN 9 7 8 0 9 5 6 1 4 3 0 5 1Weight 1 3 1 3 1 3 1 3 1 3 1 3 Multiplication 9 21 8 0 9 15 6 3 4 9 0 15 Addition Numbersareaddedtogether 99Remainder Theanswerisdividedby10withtheremainderbeingfound(99%10) 9Subtraction Theanswerissubtractedfrom10 1

RepresentingGraphicsBitmappedImages

Abitmap(orraster)containsmanypictureelementsorpixelsthatmakeupthewholeimage.Apixelisthesmallestidentifiableareaofanimage.Eachpixelisattributedabinaryvaluewhichrepresentsasinglecolour.

TheResolutionof the image can be expressed bywidth in pixels x height in pixels. It is sometimes alsoexpressedasthenumberofpixelsperinch,PPI,andreferstothedensityofthepixels.Forprinting,thereisasimilarmeasureofDPI(dotsperinch)whichreferstotheprintingqualityofaprinter.

TheColorDepthoftheimagereferstothenumberofbitsassignedtoeachpixelstakentodescribethecolourofthepixel.Themorebitswhichareused,thegreateraccuracyofcolourthatwilloccur.Thecurrentstandardis3bytesperpixel,allowingforonebyteforred,oneforgreenandoneforblue.Sometimesanextrabyteisusedasanalphachanneltocontroltransparency.

TheMetadataspecifiesthepropertiesoftheimage,includingthecolourdepth,widthandheightoftheimage.

VectorGraphics

Vectorgraphicsallowsforthestorageofanimageintermsofgeometricshapesorobjectssuchaslines,curve,arcsandpolygons.Avectorfilestoresthenecessarydetailsabouteachshapetoredrawtheobjectwhenthefileloads,includingitsposition,andforexampleforacircle,radius,fillcolour,linecolour,linestyleandlinewidth.Thesepropertiesarestoredinadrawinglistwhichspecifieshowtoredrawtheimage.

VectorGraphics BitmappedGraphicsScaling Vector graphics scale perfectly,

regardless of how large or small theimageshouldbe.

Bitmapped images do not scale well, simplyincreasing the sizes of the pixels leading toblurringatlargescaling.

FileSize For simple images, with lots ofgeometricshapes,vectorgraphicsaremuchmore efficient, taking upmuchless space on disk. However, forcomplexshapeswith lotsofchangingcolours, and few geometric shapes,which could be abstracted from theimage,thefilesizeisverylarge,oftenwith a specific list item (square)required for every single pixel, beingfarlargerthanthebinaryequivalent.

Bitmapped images are worse for simpleshapesbutmoreefficientforcompleximages,especiallywith imageswithcontinuousareasofchangingcolours.

Manipulation Vectorgraphicsareeasytomanipulatein changing the position andpropertiesoftheobjectshoweveritisvery hard to change small specifics,since the only changes that areallowed are to the properties of theobject.

Whilelargescalemanipulationisharder,finechanges are much more simple, with thephotobeingabletomanipulatedtothepixel.

RepresentingSoundSampleResolution:Theresolutionofasoundisincreasedbyagreateraudiobitdepthwhichdescribesthenumberofbitswhichwouldbeusedtodescribetheamplitudeofthesoundatagivenpointintime.Eachpointatthesampleratemustberepresentedbyabinaryvalueandhencethemorebitsusedtodescribethisamplitudemeansagreateraccuracycomparedtotheoriginalanalogsound.

SampleRate:Thesamplingrateistherateatwhichonerecordstheamplitudeofthesound.Themoreoftenthe sample is taken, the smoother the playback is, with fewer large changes in the amplitude between

samples.However,thegreaterthesamplingrate,themorespaceisrequiredfortheinformationaboutthesong,henceleadingtothesongtakingupmorespaceontheharddisk.

Nyquist’sTheorem:HenryNyquistin1928foundthatinordertoproduceanaccuraterecording,thesamplerateshouldbedoublethemaximumfrequencyoftheoriginalsignal,withthetheorybeingprovedbyClaudeShannon.Therefore,musicisgenerallysampledat44,100Hz(themaxaudiblefrequencyforhumansisaround20,000Hz).

ADC:

• Inordertoconvertanalogmusicintodigitalmusic,amicrophonemustrecordsamplesataregularinterval(thesamplerate).Eachsampleisthenquantised,wherethewaveheightismeasuredandgivenan integervalue,whichcanberepresented inbinary,usingaspecificaudiobitdepththat isbeingused.

• Tooutputasound,thebinaryvaluesforasamplepointaretranslatedbackintoanaloguesignalsorvoltagelevelsandsenttoanamplifier.

MIDI

AMusicalInstrumentDigitalInterfaceisalistofinstructionsthatallowadevicetosynthesiseasoundbasedondigitalsamplesandsamplesofsoundscreatedfromdifferentsourcesofinstruments.Therefore,thefileisgenerallymuchsmaller(1,000times)thanconventionalrecordings).Hence,theyareoftenusedforphoneringtones.

EventMessages:SinceMIDIfilesgeneratemusicusedatimedsequenceofinstructions,theycanalsosendeventmessagedtootherinstrumentstosynchronisetempoorcontrolpitchandvolumechanges.

Metadata:MIDIfilescontaintheinformationforacomputertorecreateitaccuratelyincludingthedurationofthenote,theinstrument,volumeandtimbre.

DataCompressionDatacompressiontechniquesattempttoreducethesizeoffilesonthedisk.Thisishighlyimportantpreviouslywhenthecostofstoragewasveryhigh,however,itisstillquiteimportantwhenthesizeofthefileisimportantasthefilemustbetransmittedovertheinternet.Compressioncanbelossywhenthequalityofthefileafterthecompressionisreducedandlosslesswhenthelosslesscompressionretainsallinformationtoensuretheoriginalfilecanbereplicatedexactly.

LossyCompressionThisworksbyremovingnon-essentialinformation.Inimages,thisoftenworksbyreducingthecolourdepthad inreducingthepixelsize. Inmusic files, frequencieswhichcouldnototherwisebeheardareremoved,whilequietsoundswhichareplayedatthesametimeasloudonesarealsoremoved,meaningthefinalfileisaround10%oftheoriginalsize.Whenwetalkoveratelephone,thesystemmakesuseoflossycompression.

LosslessCompressionLosslesscompressionlooksatpatternsinthefiletoreducethesizeofthedata.Usingthepatternsandasetofinstructionsonhowtousethem,thecompressedfilecaneasilybereturnedtotheoriginal.

RunLengthEncoding(RLE):Insteadofrecordingeveryiteminarepeatingsequence,RLEfindthesesequencesandrecordshowmanytimesandwheretheseareused,thereforesavingthespacerequiredtorepeatthesemanytimes.

Dictionary-BasedCompression:The system is usefulwhen sending text files.Words are lookedup into acommondictionary,findingtheirplaceinthedictionary.Therefore,thisnumbercanbetransferredinsteadof

theactualword.Forexample,‘pelican’whichwouldotherwiserequire7bytestobesentcanbesentintwobytes.

EncryptionEncryption isthetransformationofdatafromoneformtoanothertopreventanunauthorisedthirdpartyfrombeingabletounderstandit.

CaesarCipher

Oneoftheearliestformofciphers,asusedfamouslybyJuliusCaesar,toensuresecrecyinmessageswasashift cipherwhereeach letterof themessagewasmovedacertainnumberof charactersupordownthealphabet,suchthatashiftencryptionwitha3-shiftofCATisFDX.Thisisinessenceaverysimplecipher,andreliedmostly upon the reader not spending the time to break thenumber of possibilities, clearly 26, thenumberofpossibleshiftsthatcouldoccur,eachoneproducingadifferentresult.

Over time,amoresophisticatedformofbreakingshiftciphersand in factanumberofotherciphers,wasdeveloped by the Arab polymath, Al Kindi, in his paper, ‘A Manuscript on Deciphering CryptographicMessages’1,byinvestigatingthetextoftheQu’ran.

Theprocessreliesuponthefact that incertain languagesthefrequencyofcertain letters ischaracteristic.Thus,byinvestigatingthefrequencyoflettersintheencryptedtext,onecaneasilyseethecode,asthegraph

1(Singh,n.d.)

would likely be shifted to the side, such that the peaks and troughswould bemoved a certain amount.Therefore,onecaneasilyfindthelikelyshifts,reducingthenumberofattemptsrequiredtofindtheexactshiftused.

VernamCipher

TheVernamCipheristheonlyciphertostillbeprovenasunbreakable(byClaudeShannon).Itreliesontheuseoftheone-timepad.

OneTinePad

Accordingtomany,ClaudeShannonisthefatherofmoderncryptographywhoseconceptsarestillusedtoday,whendesigningnewciphers.Shannon’sworkaddressedthe‘problemsofcryptography’2.Helargelyseparatedthetypesofcryptographyintotwocategories,onewherethecipherwasdesignedtoprotectagainsthackerswhohaveinfiniteresources,nowknownasunconditionalsecrecyandasecond,wherethecipherprotectsagainsthackerswith finiteamountof resources.Healsobegan todefine the ideaof ‘PerfectSecrecy’ theciphertextconveys‘noinformationaboutthecontentoftheplaintext’3.ThemannerinwhichthiscanoccurisusingtheOne-TimePad,wherefrequencyanalysisandothercryptanalytictechniqueswouldhavenoeffectupontheencryptedtext.TheOne-TimePadissimilartothePolyalphabeticandSubstitutionCipherexceptthatthecode(key)isentirelyrandom(asopposedtopseudorandom)andaslongasthetexttobeencoded,suchthatthereisnorepetitionoftheentirecode,whichleavesthepolyalphabeticcodevulnerable.Shannonprovedthatperfectsecrecywasonlypossibleifthiswastrue.ItmakesuseofthebitwiseXORoperator,whichiscarriedoutonthekeyandtheplaintextforeachbit.

Plaintext:M Key XOR1 0 10 1 10 0 01 1 01 0 10 1 11 1 0

ThoughtheOne-TimePadisbyfarthemostsophisticatedtypeofcipherthatwehaveencounteredsofar,thereareafewissuesthatitintroduces.Firstly,thelengthofthecodemustbeatleastaslongifnotlongerthanthemessagethatthepeoplewishtoencrypt,thustakingupalotoflength.Thismakesitverydifficulttorememberanduseeffectively.Additionally,thequestionbecomeshowtoensurethatbothpartieshavethesamecode,todecryptandencryptthemessage,sincemuchofthecommunicationisnotinpersonandrelyupon inherently insecure systems such as the internet. The mechanisms of fixing these issues werefundamentallyfixedinRSAandtheDiffie-HelmanKeyExchangeSystem.

2(UniversityofCaliforniaSanDiego,2008)3(UniversityofCaliforniaSanDiego,2008)

4:FundamentalsofComputerSystemsHardware&SoftwareHardware is thetermusedtodescribethephysicalpartsofacomputerand its input,outputandstoragedevices.

Softwarecomprisesofalloftheprogramsthatarewrittentomakecomputersfunction.Thesoftwareoperatesonthehardwareandcannotexistwithoutit.Ontheotherhand,thehardwarecanexistwithoutsoftware.

ClassificationofSoftwareSoftware is broadly classified into system software and application software. Application Software issoftwarecompletingataskwhichwouldneedtobedonewhetherornotthepersonhadacomputer.Ontheotherhand,SystemSoftwarewouldbeunrequiredifthepersondoesnothaveacomputer.

SystemSoftwareSystemsoftwareisthesoftwareneededtorunthecomputer’shardwareandapplicationprograms,includingtheoperatingsystem,utilityprograms,librariesandprogramminglanguagetranslators.

OperatingSystem:Anoperatingsystemisasetofprogramsthatliesbetweenapplicationsoftwareandthecomputerhardware.Itservesmanydifferentfunctionsincluding:resourcemanagement–managingallthecomputerhardwareincludingtheCPU,memory,diskdrives,IOdevicesandprovisionofauserinterfacetoenableuserstoperformallthetasksrequired.

UtilityPrograms:Utilitysoftwareisasystemsoftwaredesignedtooptimisetheperformanceofthecomputerorperformtaskssuchasbackingupfiles,restoringcorruptedfilesfrombackup,etc.ExamplesincludeaDiskDefragmenterisaprogramwhichwillreorganisetheharddisksothatfileswhichhavebeensplitupintoblocksandstoredalloverthedisk.Thedefragmenterrecombinesthefilesintosequentialblocks.Aviruscheckerisanotherexampleofautilityprogramwhichchecksyourharddrivetoensurethattherearen’tanyviruses.

Libraries: Library programs are ready-compiled which can be run when needed and which are groupedtogether in software libraries.Most compiled languages have their own libraries of pre-written functionswhichcanbeinvokedinadefinedmannerfromwithintheuser’sprogram.

Translators: Programming Language Translators fall into three categories: compilers, interpreters andassemblers.

ApplicationSoftwareApplicationSoftwarecanbecategorisedasGeneralPurpose,SpecialPurposeorCustom-Written.

GeneralPurpose:Software suchasword-processor, spreadsheet softwarewhichcanbeused formultiplepurposes.

Special-Purpose:Softwarewhichcompletesasinglespecifictaskorsetoftaskstoserveaniche.Examplesincludepayrollandaccountssoftware.Softwarecanbeboughtas‘off-the-shelf’or‘bespoke’software.Whilebespokesoftwareislikelytomorecorrectlyandproperlysatisfytherequirementsoftheuser,itislikelytobefarmoreexpensive,aswellasrequiringtheusertowelldefinetheexactrequirementsofthesoftwarewhichcanbechallenging.

RoleofanOperatingSystemAnoperatingsystemisaprogramorsetofprogramsthatmanagestheoperationsofthecomputerfortheuser.Itactsasabridgebetweentheuserandthecomputer’shardware,sinceausercannotcommunicatedirectlywithhardware.

FunctionsofanOS

1. CreationofaVirtualMachinea. TheOSdisguisesthecomplexitiesofmanagingandcommunicatingwith itshardwarefrom

theuserviaasimpleinterface.Throughthisinterface,ausercancompletealltheactionstheywanttodo.

b. AVirtualMachineisanyinstancewhensoftwareisusedtotakeonthefunctionofthemachine,including executing intermediate code or running an operating system within another toemulatedifferenthardware.

2. MemoryManagementa. TheRAMofacomputerisnotlargeenoughtostoreallrunningprogramssimultaneouslyso

thattheharddiskisusedasvirtualmemory.SincethevirtualmemoryismuchslowertoaccessthantheRAM,itisimportantfortheOStoensuretheprogramsthatarebeingusedarestoredontheRAM,whiletheothersarestoredintheVirtualMemory.

3. ProcessorSchedulinga. Whenmultipletasksarebeingcompletedatthesametime,theOSisresponsibleforallocating

processortimetoeachoneastheycompetefortheCPU.WhileoneapplicationisbusyusingtheCPUforprocessing,theOScanqueueupthenextprocessrequiredbyanotherapplicationtomakethemostefficientuseoftheprocessor.

b. Italsoensuresthatcomputerswithlagerprocessorscancompletemultipletasksatthesametime(bycompletingsmallpartsofeachlargertaskinsequence).

c. The scheduler is the module responsible for ensuring that the processor time is used asefficientlyaspossible.

i. Objectives1. Maximisethroughput2. Ensureallusersonamulti-usersystemreceivetheirrequirements3. Provideacceptableresponsetimetoallusers4. Ensuresthathardwareresourcesarekeptasbusyaspossible.

4. BackingStoreManagementa. This stores the areas of the diskwhere the files are stored, andwhere the free space is,

containinganindexofwhatisineverypartofthedisk.5. PeripheralManagement

a. This manages all the Input / Output devices connected to the computer – including thekeyboard,mouse,printer.

6. InterruptHandlinga. An interrupt is a signal from a peripheral or software program that causes the operating

systemtostopprocessingitscurrentlistofinstructionsandcarryouttherequestasdefinedintheinterrupt.

7. ProvisionofaUserInterfacea. Thisincludesmanyformsofinterfacefromacommandlineinterface,suchasinMS-DOS,to

aGraphicalUserInterfacesuchasinMicrosoftWindows.

OSforEmbeddedSystems

OSsarealsorequiredforallkindsofsystemsfromawashingmachine,withdifferencesineverythingfromthehardwareofthesystemtotherequirementsofthesystem.

ProgrammingLanguageClassificationDevelopment:Thefirstcomputersweremade inBletchleyParkduringtheSecondWorldWar,whentheyattemptedtocracktheEnigmaCode.Theearliestcomputershadaverylimitedmemory(witheachmemorycellbeingmadeofavacuumtube)ofaround16bits,aspecialmemorylocationinwhichallcalculationswerecarriedoutandacontrolunitthatdecodedinstructions.Inordertoprogramacomputer,onehastoentervalidmachinecode(inbinary).

MachineCodeInMachineCode,aninstructionmakesuseofanoperationcode(opcode)inthefirstfewbitsandtheoperandintherestofthememorycell,includingthedatatobeoperatedonortheaddresswherethedatawouldbeheld.

Theabovetableshowsthepossibleopcodesoflotsofdifferentcommands.MachineCodeisaverylow-levelprogramming language, because the code reflects how the computer carries out the command – it isdependentonthespecificarchitectureofthecomputer.

AssemblyCodeFromhere,therewasthedevelopmentofaslightlyhigher(secondgeneration)levelprogramminglanguage,wheretheopcodewasreplacedbyamnemonicwhichshowedwhattheoperatorwasdoing.Additionally,thebinaryfortheoperandwasreplacedbyadenaryvalue.

HighLevelProgrammingLanguageFromhere,therewasthedevelopmentofhighlevelprogramminglanguages,whereasinglelineofcodenolongerrepresentedone instructionof thecomputer (oneclockcycle).Thisallowsthecoder toeasilycodealgorithms,usingtheimperativehigh-levellanguages(FORTRAN=FORmulaTRANsmission),withoutneedingtoworryabouthowthemachinewouldhandlethecode.Theyareknownasimperativelanguages,sinceeverylineisasinglecommandtodosomething.Additionally,thelanguagewasidenticalforeverycomputer,withdifferentarchitectures,withdifferentprocessors,whichwouldrequiredifferentmachineandassemblycodes.Thoughthesystemisofteneasierforprogrammerstowritetouse,itissometimeslessefficientthanusingtheassembly code,programming the complete system.Thismeans for somesystemswhere theprogramneedstoexecuteasfastaspossible,suchasinembeddedsystems,theprogramisbetteroffbeingwritteninAssembly Code. Additionally, Assembly Code takes up much less space on a disk than higher levelprogramminglanguages,alsonotrequiringatranslator.

ImperativeProgramming involveswritingyourprogramasaseriesof instructions thatcanactivelymodifymemory,focusingonhow,inthesensethatyouexpressthelogicofyourprogrambasedonhowthecomputerwouldexecuteit.

Functional programming involves writing your program in terms of functions and other mathematicalstructures,focusingonwhat,attemptingtospecifythelogicofyourprogram,henceallowingfortherulesofthewayinwhichtheprogramrunsinordertosolvetheproblem.

ProgramTranslatorsAssembler:Convertseachassemblyline(sourcecode=codemadebytheuser)pieceofcodeintomachinecode(objectcode=thecodewhichiscreatedpostassemblyorcompilationwhichisexecutableandcanberundirectlybythecomputer).This isspecific tothecomputerthat isbeingused,sincethemachinecodeinstructionsetwoulddiffer(thoughslightly)betweendifferentarchitectures.

Compiler:Compilerconvertshigh-levelcodeintomachinecode,thereforestillrequiringthecompilertobespecifictotheexactarchitectureandplatformofthecomputer.

Interpreter:Interpretingisadifferentoptiontocompilation,wheretheinterpreterwill lookateachlineinterm, checking for syntactical errors, before translating it intomachine code and running it. (In fact, theinterpretercompletesacursoryscanlookingforflowissues,suchasmissingbracketsetcbeforebeginningthetranslationofthefirstline).Thismeansthatifthereisaprobleminthecode,thenthecomputerwillrununtilthatpointbeforeregisteringaproblem.Therefore,itisparticularlyusefulfortestingandfindingproblemsinlongpiecesofcode.

Bytecode: In fact, themajorityof interpreted languagesdonotconvert tomachinecode, insteadgoingtobytecode,whichcanbeexecutedusingabytecodecompiler.

Compiler InterpreterAdvantages Objectcodecanbesavedondisk

and run without needing torecompiletheprogram.Oncecompiled,object code runsfaster than interpretedcode.Forinterpretedcodethingslikeloopsareveryinefficient,sincetheyareconvertedtomachinecodeeverytime they are encountered,

Faster,astheentirecodedoesnothave to be compiled beforerunning the program. This isparticularly important during theprogram development phaseswhentherewouldbeanumberofminor errors, which would eachrequirelengthyrecompilations.

instead of being translated onceas would happen with compiledlanguages.Objectcodeismoresecure–hardtoreverseengineerCan be distributed without acompilerpresent.

It is easier to partially test anddebugprograms.

LogicGatesLogicgatesallowtheusertocompleteconditionals,changinganoutputtedvoltage(orsignal)dependingonthevariousinputsthatareoccurring.Thereareanumberofdifferentlogicgates:

NOTgate𝑂𝑢𝑡𝑝𝑢𝑡 = 𝐼𝑛𝑝𝑢𝑡

ANDgate𝑂𝑢𝑡𝑝𝑢𝑡 = 𝐼𝑛𝑝𝑢𝑡< ∙ 𝐼𝑛𝑝𝑢𝑡>

ORgate𝑂𝑢𝑡𝑝𝑢𝑡 = 𝐼𝑛𝑝𝑢𝑡< + 𝐼𝑛𝑝𝑢𝑡>

XORgate

𝑂𝑢𝑡𝑝𝑢𝑡 = 𝐼𝑛𝑝𝑢𝑡< 𝐼𝑛𝑝𝑢𝑡> = 𝐼𝑛𝑝𝑢𝑡< ∙ 𝐼𝑛𝑝𝑢𝑡> + 𝐼𝑛𝑝𝑢𝑡< ∙ 𝐼𝑛𝑝𝑢𝑡>

NORgate𝑂𝑢𝑡𝑝𝑢𝑡 = 𝐼𝑛𝑝𝑢𝑡< + 𝐼𝑛𝑝𝑢𝑡>

NANDgate𝑂𝑢𝑡𝑝𝑢𝑡 = 𝐼𝑛𝑝𝑢𝑡< ∙ 𝐼𝑛𝑝𝑢𝑡>

BooleanAlgebraDeMorgan’sLaws𝐴 ∙ 𝐵 = 𝐴 + 𝐵

𝐴 + 𝐵 = 𝐴 ∙ 𝐵

OtherLawsX·0=0

X ·1=1

X·X=X

X·X’=0

X+0=X

X+1=1

X+X=X

X+X’=1

X’’=X

X·Y=Y·X

X+Y=Y+X

X(Y·Z)=(X·Y)Z

X+(Y+Z)=(X+Y)+Z

X(Y+Z)=X·Y+X·Z

(X+Y)(W+Z)=X·W+X·Z+Y·W+Y·Z

5:FundamentalsofComputerOrganisationandArchitectureComputershaveInternalcomponents–thosewithinthecomputershellandexternalcomponentssuchasinput/outputandstoragedevices.Theinternalcomponentsinclude:

• Processor• Mainmemory• Addressbus,controlbus,databus• I/Ocontroller

TheProcessorThe processor contains the Control Unit, the Arithmetic Logic Unit (ALU) and Registers. The Control Unitcoordinates and controls all the operations carried out by the computer, completing theFetch/(Decode)/Executecycle.

Fetch:Thenextinstructiontobecompletedisfetchedfromthememory

Decode:ThesignalstocontroltheregistersandtheALUarecompleted–decodingtheinstruction.

Execute:Theinstructioniscompleted.

ALU:TheALUcompletesallthearithmeticfunctions,suchasaddition,subtraction,multiplicationanddivision,whileitalsoperformsthelogicfunctions,suchascomparisonsbetweentwonumbers,andbitwiseoperatorssuchasANDandOR.

Registers:RegistersarememorycellswhichareveryhighspeedbecausetheyarelargelyverysmallandtheyarelocatedveryclosetotheControlUnit.

GeneralPurposeRegisters:Therearegenerallyupto16generalpurposeregisters in theCPU.Allarithmetic,logicalorshiftoperationstakeplaceinregisters,whichareveryfast.Generally,especiallyinoldcomputers,thereisonededicatedregisterfortheaccumulator.

DedicatedRegistersProgramCounter(PC):Thisholdstheaddressofthenextinstructiontobeexecuted.Thismaybethenext instruction in a sequence, or if the instruction is a branchor jump instruction, thenextaddresstojumpto.

CurrentInstructionRegister(CIR):Holdsthecurrentinstructionbeingexecuted.

MemoryAddressRegister (MAR):Thisholdstheaddressofthememory locationfromwhichthedatatobefetchedorwheredataistobewritten.

MemoryBufferRegister(MBR):Usedtotemporarilystorethedatareadfromorwrittentomemory–alsosometimesknownasthememorydataregister.

StatusRegister(SR):Containsbitswhicharesetorcleareddependingontheresultoftheinstruction.Itincludeswhethertherewasanoverflow,whethertheresultwasnegativeorzero.Thereisalsobitwhichisusedtostorewhetherthereisacarry.

ControlUnit:ThecontrolunitcontrolsandcoordinatestheactivitiesoftheCPU,directingtheflowofdatabetweentheCPUandotherdevices.Itacceptsthenextinstruction,decodesitintoseveralsequentialstepssuchasfetchingaddressesanddatafrommemory.

SystemClock:Thesystemclockgeneratesaseriesofsignals,switchingbetween0and1aroundsevenmilliontimesasecond.Mostfetchexecutecyclestakeoneclockcyclebutafewtakeanumberofclockcycles.

BusesThe processor is connected to themainmemory by three different bus (A bus is a set of parallelwiresconnecting twoormore componentsofa computer). Theaddressbus isusedwhen thememory fromaspecificplaceonmemory isrequired.Thisdata isthenreturnedmakinguseofthedatabus,whilecontrolsignals,especiallyfromtheperipheralsaresentalongtheControlBus.Whileboththedatabusandcontrolbusarebidirectionalwithsignalspassingfromthecontrolunittothememoryandvisa-versa,itisimportanttonotethattheaddressbusonlycarriesdatafromthecontrolunittothememory.

ControlBus:Giventhatthedataandaddressbusaresharedbyallcomponentsthesystem,thecontrollinesmust be provided to ensure there is no conflict, transmitting timing and status information betweencomponents.ThevariouscommandssentovertheControlBusincludes:

• MemoryWrite;databusinformationstoredintoaddressedlocation• MemoryRead:datafromaddressedlocationintodatabus• I/Owrite:DatafromdatabustoI/Oport• I/ORead:DatafromI/Oportintodatabus• BusRequest:indicationofadevicerequesttousethedatabus• BusGrant:indicationthattheControlUnithasgrantedaccesstothedatabus

DataBus:Thedatabusprovidespathsformovingdatacontaininginformationfromthememoryaswellasinstructions to the controlunit andbetweenother registers. Thewidthof thedatabususa key factor indeterminingoverallsystemperformance.Mostcomputersare32or64bit,indicatingthatthehaveadatabusofthiswidth.

AddressBus:Theaddressbuscontainstheaddressoftheword(collectionofmemory)thatthecontrolunitshouldaccess.Aswiththedatabus,thewidertheaddressbus,thegreateramountofmemorythecontrolunitcanaddress.Forexample,asystemwitha32-bitaddressbuscanaddress232memory locations(withgeneralwordlengthsisgenerallyaround4GB).DuringI/Ooperations,theaddressbusisalsousedtoaddress

theI/Oports.However,fortheaddressbus,generallythisisunnecessary,andsoitismorecommonfortheaddressbustomakeuseofmultiplexing,wherethefirsthalfoftheaddressissentinonesignalandthentherestofitinanothersignal.

I/OController:TheIOControllerisadevicewhichinterfacesbetweenaninputoroutputdeviceandprocessor.Eachdevicehasa separate controllerwhich connects to the controlbus. IOControllers receive inputandoutputrequestsfromtheprocessorandthencansendsignalstothedevicetheycontrol.Theyalsomanagethedataflowtoandfromthedevice.Thecontrollerismadeupofthreemainparts:

1. AninterfacethatallowsconnectionofthecontrollertothesystemorIObus2. Asetofdata,commandandstatusregisters.3. Aninterface(standardisedformofconnectiondefiningthingssuchassignals,numberconnecting

pins/socketsandvoltagelevels)thatallowsconnectionofthecontrollertothedevice.

VonNeumannMachine:ThevonNeumannmachineisamachinewherethereisonemainmemorystore,wheretheinstructionsandthedataonwhichtheinstructionswerebeingcarriedoutonwerebothstored.Almostallcomputersmadetodayarebuiltonthisprinciple.

Harvard Architecture: The Harvard Architecture is a computer architecture where there are physicallyseparatememories for instructions and data, allowing the data and instructions to be fetched in parallelinsteadofcompetingforthesamebus.Additionally,thetwomemoriescanhavedifferentproperties,allowingembeddedsystemswheretheinstructionsshouldneverchangetomakeuseoffasterandmorestableReadonlyMemory(ROM).Additionally,thesystemwouldallowfordifferentsizeddatabuses(tomainmemory)andinstructionbusestoallowfortimeswhentheinstructionsarecomplexandlong,andhenceshouldhaveamuchlargerbus.

FetchExecuteCycle1. TheaddressofthenextinstructioniscopiedfromthePCtotheMAR2. TheinstructionheldatthataddressiscopiedtotheMBR3. PCisincremented4. MBRiscopiedtoCIR5. InstructionheldinCIRisdecoded6. Instructionisexecuted

Factorseffectingprocessorperformance1. Numberofcores

a. Computerstodaymakecomputersfasterbytagginganumberofidenticalprocessorstogetherinthesameintegratedcircuit(IC).Thismeanstherearedual-core,quad-core,octa-coreetcprocessorswhichwouldallowanumberofinstructionssimultaneously,sinceeachofthemwouldbeabletocompleteafetch-executecycleatthesametime.However,itisimportanttonotethattheperformanceisnotnecessarilyproportionaltothenumberofcores,astheabilityofsoftwaretooptimisethecarryingoutofmultipleactionssimultaneouslyisgenerallynotperfect.

2. AmountofCacheMemorya. ThecachememoryistheverysmallexpensivememorywhichisveryclosetotheCPU,sois

generallyusedtostoreinformationwhichisrequiredveryoften.Thelargerthismemory,themoreinformationthatcanbeaccessedveryfast,thereforemakingthecomputerfaster.

b. Therearethreetypesofcacheclasseddependingonwheretheyare(closertoCPUisfaster)i. L1–verysmall(2-64KB)–veryclosetoCPUii. L2–(256KB-2MB)–fairlyclosetoCPUiii. L3–relativelylarge(hundredsofMB)–quiteclosetoRAM(sofarfromCPU)

3. ClockSpeeda. Mostactionsarecompletedatthetickingoftheclock,thoughsomeactionswilltakelonger

thanasingleclockcycle.b. Therefore,afasterclockspeedwillmeanthatmoreactionscanbecarriedoutpersecond.

4. WordLengtha. Thewords size of a computer is the number of bits the CPU can process simultaneously,

thereforehowmuchtheycanprocessthroughregisterssuchastheALU.Typicalwordlengthsare32or64bits.

5. AddressBusLengtha. Thelargertheaddressbus,thefewersignalswouldberequiredtoaddressasingleindexon

thememory,thereforeallowingtheprocessestohappenfaster.6. DataBusWidth

a. The larger the width of the data bus, the more data can be transmitted simultaneously,thereforereducingthetimerequiredtocompleteaninstruction,thereforespeedingupthecomputer.

TheProcessorInstructionSetEachprocessorhas itsown instructionset, comprisingofall the instructionswhicharesupportedby itshardware.Thisincludesthefollowingtypesofinstructions:

1. DataTransfer–LOAD,STORE2. ArithmeticOperations–ADD,SUBTRACT3. ComparisonOperations-=,<,≤4. LogicalOperations–AND,OR,NOT,XOR5. Branching–conditionalorunconditional6. Logical–shiftbitsrightorleft7. Halt

Formatofamachinecodeinstruction

OperationCode OperandBasicMachineOperation Addressing

Mode0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1

The number of bits allocated to the operation code (opcode) and the operandwill vary according to thearchitectureandwordsizeoftheparticularprocessortype.Theaboveexampleshowsaninstructionheldinone16-bitword.Inthisparticularmachine,alloperationsareassumedtotakeplaceinasingleregistercalledtheaccumulator. Inmore complexarchitectures,each instructionmayoccupyup to32bits andallow formultipleoperands–includingloadfrommemoryaddressxintoregistery.

AddressingModes:Thereareanumberofaddressingmdoeswhichareshowninthetwobinarydigitswhichtalkabout theaddressingmode.Oneof thesemodes is immediateaddressing,where theoperand is theactualnumericalvaluetobeoperatedon.Indirectaddressing,theoperandholdsthememoryaddressofthevaluetobeoperatedon.OtheraddressingmodesincludeRegisterAddressingwheretheregistercontainsthevalue.There isalso indirectaddressing,wheretheoperandwillcontainthememoryaddressofamemoryaddresswherethenumbertooperateonisstored.

AssemblyCode:Assemblycodedirectlymakesuseofthissystem,representingthesystemwith:

OpcodeAddressingModeOperand

Though the system makes use of mnemonics for the opcode as opposed to directly using the binary.Additionally,theaddressingmodesmakeuseofcharacterssuchasbrackets,a‘#’andalackofanythingtoindicatetheaddressingmodebeingused,whiletheoperandwouldberepresentedindenary(orsometimeshex)insteadofbinary.

Input-OutputDevicesBarcodesTherearetwomaintypesofbarcodes,QR(QuickResponse)codes–whichcanstorefarmoreinformationthan1Dbarcodesand1Dbarcodes,suchasthosefoundonproducts,whicharemadeofdifferingthicknessesandpatternsofblackandwhiterectangles.

Barcode Readers: There are a few types of barcode readers available, including pen-type readers, laserscanners,CCDreadersandcamerabasedreaders.

InPen-typereaders,alightsourceandaphotodiodeareplacednexttoeachotherinthetipofapen.Toreadabarcode,thetipofthepenisdraggedacrossallthebarsatanevenspeed.Thephotodiodemeasurestheintensityofthelightreturning(Iguessthereforeitcan’tbeaphotodiode–sincethiswouldsimplymeasureiflightwascomingback…)andtherefore,duetothedifferentreflectivityofwhiteandblack(blackabsorbsmorelightthanwhite)canmeasurethewidthsofthebarsandspacesinthebarcode.Thesimplestsystemsmakeuseofaspecificthicknesswithblackmeaning1,andwhitemeaning0.However,therearealsomorecomplexalphabeticsystem,suchastheUPC(universalproductcode)alphabet,whichhasanentirelydifferentpatternforeachnumber.Pen-typescannersarethemostdurabletypeofscammers,however,theymostcomeincontactwiththebarcode,socannotbeusedformanyapplications.Additionally,itissometimeschallengingtousethem,asonehastomoveataveryconstantspeed.

InLaserScanners,thesystemisthesame,howeveritusesalineoflaserlightwithanarrayoflightsensors.Thisismuchfasterandtheyarereliableandeconomicalforlow-volumeapplications,suchasinsupermarkets.

InCCD(Charge-CoupledDevice)readers,thereisalargearrayoftinylightsensorslinedupinarowattheheadofthereader,relyingonthefactthatthereisanywaylightthatthewhitepartswouldreflect.Therefore,inthesameway,thepatterncouldbefound,andthebarcodenumberbefound.

InCameraBasedReaders,acamera isusedtotakean imageofthebarcode.Fromhere,there isauseofimageprocessingtoolstolocateabarcode,reorientateanddealwithanyissuesofalignmentinallthreeaxes,andthenmeasurethethicknessesofblackandwhitebars.Hence,themethodcouldbeusedwhenthecodeisdamagedorpoorlyprinted.Thisisgenerallyalsomuchcheaperthanothermethods,asonecouldevenusethehardwareonasmartphone.

DigitalCamerasAdigitalcameramakesuseofaCMOS(ComplementaryMetalOxideSemiconductor)sensorcomprisingofmillionsof tiny light sensorsarranged inagrid.When the shutteropens, the lightenters the cameraandprojectsanimageontothethesensoratthebackofthelens(whichfocusesthelight).Eachsensormeasuresthe colur and the brightness of the light which is reaching it, before sensing the information to amicrocontrollerwhichcanrecombinethereadingsofallofthesesensorsintoacompleteimage.

Somecameras(tendtobehigherend)makeuseofaCCDsensor,sincetheyproduceafarhigherqualityimage,however takingup farmorepower, andbeingmoreexpensive, since thereare fewernodesbetween theindividualsensorsandtheanalogue-digitalconverters.

RFIDAnRFIDtagisuseful,as,asopposedtobarcodestheycanbereadfromover300metresaway,aswellasbeingabletotransfermoreinformation,passinginformationbetweenthetransmitterandthereceiverwirelessly.TheRFIchipconsistsofasmallmicrochiptransponderandanantenna.Sincesolittleisrequired,thetagcanbeverysmall,eventhesizeofagrainofrice.Therearetwotypesoftags,activetagsandpassivetags.Activetagsalsocontainabatterytopowerthetagsoitactivelytransmitsasignalforareadertopickup.Thismeansthattheycanalsobepickedupfromfurtheraway.Passivetagsinsteadmakeuseofaradiowaveemittedfromareaderinordertoprovedsufficientelectromagneticpowertothecardusingtheantenna.Oncepowered,thetransceiverinsidetheRFIDtagcansendthedatatothereceiver.Thesearemuchsmaller,andcheaper,andaregenerallyfarmoreused,fromeverythingfromcreditcardstooystercards.

LaserPrinterAlaserprintermakesuseofpoweredinkstoredinatoner.Theprintergeneratesabitmapimageoftheprintedpageandusingalaserunitandamirror,drawsanegative,reverseimageontoanegativelychargeddrum.Thelaser lightcauses theaffectedareasof thedrumto lose theircharge.Thedrumthenrotatespasta tonerhoppertoattractchargedtonerparticlesontotheareaswhichhavenotbeenlasered.Thentheinkisbondedtothepaperusingheatandpressure.

Laserprintersareaffordableandarelargelyusedwhenthevolumeofprintingishigh.Theyarealsogenerallyveryfast,thoughcolourlaserprinters(whichusecyan,magentaandyellowaswellasblack)requirethesameprocesstoberepeated4timesforeachcolourtakemoretime.Additionally,thequalityofalaserprinterisgenerallylowerthanthequalitywhichcanbeachievedusinganinkjetprinter.

StorageDevicesAsecondarystoragedeviceisneededbecausetheothermemoryRAM,whichisthememorythatisdirectlyaccessed by the processor loses its contents when the computer’s power is turned off. In order for thecomputertobeabletostoreanydataforextendedperiodsoftimetherefore,theremustbeanotherplacewherethedatacouldbestoredmorepermanently,andthisisgenerallytheharddisk,thoughtoday,therehasbeenaswitchtowardsSolidStateDrives(SSDs).

HardDisk:Aharddiskusesrigidrotatingplatterscoatedwithmagneticmaterials.Theironparticlesonthediskarepolarisedtobeeithernorthorsouthstate–representing0sor1s.Thediskisseparatedintoconcentriccircles,andeachtrackissubdividedintosectors.

Thediskspinsveryquicklyatspeedsupto10,000RPM,allowingthedriveheadtomoveacrossthedisktoaccessdifferentsectors,usingamagnettoreadandwritedatatothedisk.Finally,theharddisklikelymakesuseofanumberofplatters,eachwithitsowndriveheadinordertoincreasetheamountofdatawhichcouldbereadfromasingleharddisk,withoutvastlyincreasingthediskssize.

AsopposedtoSolidStatedrives,whicharemuchfaster,sincetheyuseanumberofflashships,harddrivesgenerallyhaveverylargecapacities,allowingpeopletostoreallrequiredinformationonthemcomfortably.Additionally,theytendtobeverycheap.

OpticalDisks:OpticalDisks(CDROMs,DVDsandBlu-Raydisks)makeuseofahighpowered lasertoburnsectionsofitssurface,makingitlessreflectiveatthosepoints.Hencealaseratalowerpowerisusedtoreadthediskbymeasuringhowmuchlightisabsorbedandhowmuchreflectedbythatpartofthedisk.Reflectiveandnon-reflectiveareasarereadas1sand0srespectively.Thereisgenerallyonlyonetrackonanopticaldisk,generallyarrangedinaspiral.

CDROMshaveamaxstoragespaceof650MB,whileaBluRaycanstorearound50GB,sinceitusesamuchshorterwavelengthlaser,meaningthethicknessofthetrackisreduced.

Rewritablecompactdisksusealaserandamagnettoheataspotonthediskandthensetitsstatetobecomea0or1beforeitcoolsagain.

ADVD-RWmakesuseoffaphasechangealloythatcanchangebetweenamorphousandcrystallinestatesbychangingthepowerofthelaserbeam.

Opticalstorageisverycheaptoproduceandcanbeeasilyandsafelydistributed.However,itiseasilydamagedbyexcessivesunlightorscratches.

SolidStateDrives (SSDs):SSDsmakeuseofanarrayof chipsarrangedonaboard,makinguseofa largenumberofNANDflashmemorycellsandacontrollerthatmanagesthememory.Thecellworksbydeliveringacurrentalongthebittoleadtoelectronsgoingtothefloatinggate.Hence,thisfloatinggatecanbemeasuredtofindifitisa0or1.

Data is stored in pages (of around 4KB) grouped in blocks. Flashmemory cannot be overwritten insteadrequiringtheolddatatoberemovedbeforethenewdatacanbewrittentothesamelocation.However,theindividualpagescannotbeerased,requiringinsteadthattheentireblockbeerased.Hence,therestofthedataneedstobecopiedtoanotherblockbeforeerasingtheblockandthenmovingtherequireddataback.

SolidStateDrivestendtohavemuchlowercapacitiesthanHardDisksaswellasbeingmuchmoreexpensive,thoughcostsofSSDsarebeginningtoreduceovertime.TheyaremuchfasterthanHDDs(lowerlatency),withtheread/writespeedsbeingalmostdoubleasfast.

6:ConsequencesandUsesofComputingMuchofthischapterappearstobecommonsenseandageneralknowledgeandreadingoftechnology.

Developments in Computer Science and the Digital Technologies have dramatically altered the shape ofcommunicationsandinformationflowsinsocieties,enablingmassivetransformationsinthecapacityto:

• Monitorbehaviour• Amassandanalysepersonalinformation• Distribute,publish,communicateanddisseminatepersonalinformation.

Computerscientistsandsoftwareengineersthereforehavepower,aswellastheresponsibilitiesthatgowithit,thealgorithmsthattheydeviseandthecodethattheydeployshouldhavesomepositiveimpactonthesociety–embeddingmoralandculturalvalues.

Oneproblemthatcametoonecomputerscientist,whichwillbeusedasacasestudy,isEdwardSnowden,whenhefoundthattheNSA(NationalSecurityAgency)wasillegally(andimmorally)usingsoftwaretospyonpeople.Hefacedthemoralissueofbetrayinghiscountriesandriskingexposingnationalsecretsversusservingthemoralgood–tellingthepopulationandturningagainsttheNSA.

EdwardSnowden• RevealedinformationtoGuardianjournalistinApril2013• HandedoverinformayionaboutaprogramcalledPRISM,whichallowedtheNSAtogetinformation

fromtheworld’s largest Internetcompanies, includingFacebook,Google,Yahoo,Microsoft,Apple,YouTube,AOLandSkype.

• Included informationshowingNSAemployeeshowtouse thesurveillancecapabilitiesandhowtomisusethecapabilities.

• FurtherinformationshowedtheactionsoftheNSAo Tapping of internet servers, satellites, underwater fibre-optic cables, local and foreign

telephonesystemsandpersonalcomputerso Tappedindividualsfrompeoplesuspectedofterroristactivitiestoprivatecitizensfromthe

US,toothercitizensandevendiplomatsinUKandEurope(AngelaMerkelandNicolasSarkozywereallegedlyhacked).

o Alsogotmetadatafromallcallsfromallcallsto/fromtheUSA§ Inonemonthin2013–collecteddataonmorethan97billionemailsand124billion

phonecalls.

Cyber-Attacks• ESTONIA

o In2007,Estoniasufferedaseriesofcyber-attackswhichswampedwebsitesoforganisationsincludingtheEstonianParliament,banks,ministries,newspapersandbroadcasters.Thiswasoneofthelargestcasesofstate-sponsoredcyberwarfareeveryseen,sponsoredbyRussiainretaliationfortherelocationoftheBronzeSoldierofTallinn,anelaborateSoviet-eragravemarker,andwargravesinTallinn.

o In2008,anethnicRussianEstoniannationalwaschargedandconvictedofthecrime.• SONYPICTURES

o InJune2014,theNorthKoreangovernmentthreatenedactionagainsttheUSgovernmentifthemovie‘TheInterview’wasreleased.

o InNovember, SonyPictures computerswerehackedby the ‘Guardians of Peace’, a groupbelievedbytheFBIlinkedtotheNorthKoreangovernment.

ChallengesoftheDigitalAgeEconomicimpactoftheinternet

• When Tim-Berners Lee created theWorld-WideWeb, he had intended it all to be free, with nointensiontocreatemoneyforhimselforanyoneelse.

• However,accordingtomanypeople,itsimplycreatedanewsmallgroupofcompanieswhichhaveaccumulatedhugewealthattheexpenseofanumberofothersmallregularcompanies–therefore,leadingtoanumberofpeoplelosingtheirjobs.

• Amazono Startedasanonlinebookstorein1994o DiversifiedintoDVDs,software,videogames,toys,furniture,clothesandthousandsofother

productso In2013,companyturnedover$75bninsales.o Nowaccountsfor65%ofalldigitalpurchasesofbooksales.o Nowfewerto4,000bookshops–1/3lessthan2005

§ Fewerpeopleinjobs§ Wherebookshopemploys47peopleper$10bnAmazonemploys14

• eBayo 41,000tradinggoodsworth$7.2mnin1995o 162mnusersworth$227.9bnin2014

• DestructionofJobso 2013paperbyCarlBenediktFreyandMichaelOsborne

§ 47%oftotalUSemploymentisatrisk§ TheFutureofEmployment:howsusceptiblearejobstocomputerisation§ Examined700individualoccupations§ In the 10 jobs that have a 99% likelihood of being replaced by software and

automationwithinthenext25years,FreyandOsbourneincludetaxpreparers,libraryassistants,clothingfactoryworkers,andphotographicprocessworkers.

• Infact,jobsinphotographicsindustrieshavealreadyallbutvanished• In1989–Kodakemployed145,000people–marketcapof$31bn• In2013,thecompanyfiledforbankruptcy.• INSTAGRAM

o Meanwhile,Instagramboomed–25,000peopledownloadedtheappon6thOctober2010

o Amonthlater,ithadamillionusers.o Byearly2012,ithad14mnusersandbyNovember,100mnusers,

withtheapphosting5bnphotos.o When it was sold for $1bn in 2012 – still had only 13 full-time

employees.o User-GeneratedContent

§ Sites like YouTube have takenmoney (and jobs) away from the traditionalmovieindustries.

• TROLLSo Trolls,Cyber-BullyingandMisogynyhasbecomeafactofeverydaylifeontheinternet.o 2010-2011ArabSpring

§ Originally served a good purpose – allowing people to rise up against tyrannicalregimes

§ However,begantoprovokehatredandservesananonymousplacewherepeoplecanusereligioushatred.

o Feministwritersandjournalistsreceivehundredsofdeaththreatsandrapethreats.o Savagebullyingonvarioussocialnetworkingsiteshaveledtomultiple(manyofthemteen)

suicides.

7:FundamentalsofCommunicationandNetworkingCommunicationsData communication involves sending and receiving data from one computer or device to another. Datacommunicationapplicationsincludee-mail,supermarketelectronicspointofsaleterminals,cashdispensers,cellphonesandvoiceoverIP.

DatacommunicationsalsotakesplacewithintheCPUandbetweentheCPUanditsperipheraldevices,forexample,dataandaddressesalongthedataandaddressbusbetweentheprocessorandmemory,anddataistransferredbetweenmemoryandstorageandotherperipheraldevices.

CommunicationMethodsSerialTransmission• Bitsaresentviaaninterfaceonebitatatimeoverasinglewirefromthesourcetothedestination.• Veryhightransferratesarepossible

o Fibre-Optic(usinglight)–50Mbpsto100Gbps• Muchcheaperthanserialtransmissionduetothereductioninnumberofwiresrequired.• Thereisno‘crosstalk’–wherethereisaskewleadingtoblurringofsimultaneoustransmissioninparallel

transmission. This becomes even more pronounced when the signal frequency or the length ofcommunicationincreases.

• Muchmorereliableovergreaterdistances.• Signal frequency can bemuch higher than with parallel transmission, resulting in a higher net data

transferrateeventhoughlessdataistransferredpercycle.

ParallelDataTransmission• Severalbitsaresentsimultaneouslyoveranumberofparallelwires.• Themethodisusedinsidethecomputer(usingthevariouscomputerbuses)andforveryshortdistances

ofuptoafewmetres.• Parallel transmissionwill transmit datamore quickly than serial transmission – however there is the

possibilityofskew–wherebitssentatthesametimemayreachatdifferenttimes–henceonlyusedforshortdistances.

SynchronousTransmission• Insynchronoustransmission,dataistransferredatregularintervalswhicharetimedbyaclockingsignal,

allowingforaconstantandreliabletransmissionfortime-sensitiveinformation.• Generallyusedbyparalleltransmission,forexampleintheCPU

AsynchronousTransmission• Usingasynchronoustransmission,onecharacterissentatatime,witheachcharacterbeingprecededby

astartbitandanendbit.• Thestartbitalertsthereceivingdeviceandsynchronisestheclockinsidethereceiverreadytoreceive

thecharacter–ensuringthebaudrateatthereceivingendisthesameasthesender’sbaudrate.• Aparitybitisalsoincludedtocheckagainstincorrecttransmission,thusforeverycharacter,10bitsare

required–startbit,paritybitandendbit.• Thestartbitcanbeeithera0ora1,withtheendbitbeingtheotherone.

• Thismethodisgenerallyusedbycomputerswhencommunicatingwithperipherals.

CommunicationBasicsBitRate:Thespeedatwhichdataistransmittedserially,measuredinbitspersecond.

BaudRate:Therateatwhichthesignalchangesinvoltages.

Inbasebandmodeofoperation,thebitrateisequivalenttothebaudrate.However,withhigherbandwidths,morethanonebitcanbecodedintoasignalandthebitratewillbehigherthanthebaudrate–bymakinguseofanumberofdifferentfrequenciesofthewave.

Bandwidth:Thebandwidth is theamountofdata that canbe transmitted ina fixedamountof time. It isusuallyexpressedinbitspersecond(bps)–sincethereisadirectproportionalitybetweenbandwidthandbitrate–thehigherthebitrate,thehigherthebandwidth.

Latency:Latencyisthetimedelaybetweenthemomentthefirstbyteofacommunicationstartsandwhenitisreceivedatitsdestination.Itisafunctionofhowlongittakesinformationtotravelatthespeedoflightfromsourcetodestination.

Protocol:Aprotocol isanagreed-upon format for transmittingdatabetween twodevices.This includesanumberofthingsincluding:

1. PhysicalConnectionsandCabling2. Modeoftransmission(serialorparallel)3. Speed4. Baudandbitrate5. Dataformat6. Parity7. Errordetectionandcorrection

NetworkingLAN(localareanetwork):ALANconsistsofanumberofcomputingdevicesonasinglesiteconnectedtogetherbycables,connectinganumberofPCs,printersandscannersandacentralserver.Userscancommunicatewitheachotheraswellassharingdataandhardwaredevicessuchasprinters.LANscantransmitdataveryfastbutonlyoveraveryshortdistanceandthereisalimittothenumberofcomputersthatcanbeconnectedtoasingleLAN.

NetworkTopologyBusTopology

• InaBustopology,allcomputersareconnectedtoasinglecable,withtheendsofthecableconnectedtoacomputeroraterminator.

• Dataistransmittedinonedirectiononlyatanyonetime–whereallthetraffichasequaltransmissionpriority.

• Adevicewantingtocommunicatewithanotherdevicesendsabroadcastmessageontothewirethatallotherdevicessee,butonlytheintendedrecipientcanacceptandprocessthemessage,withthesystemusingthesystemofCarrierSenseMultipleAccess/CollisionDetect(CSMA/CD).

• Inexpensivetoinstallasitrequireslesscablethanastartopologyanddoesnotrequireanyadditionalhardware.

• Newdevicescanbeeasilyaddedwithoutdisruptingthenetwork.• Wellsuitedtosmallnetworksnotrequiringhighspeeds.• Ifthemaincablefails,thewholenetworkwillgodown.• Limitedcablelengthandnumberofstations• Theperformanceofthesystemwilldegradewithheavytraffic.• There is a relatively slow security, where all the computers on the network can see all data

transmissions.

StarTopology

• Astarnetworkhasacentralnodewhichmaybeaswitch,huborcomputerwhichactsasaroutertotransmitmessages

• Ahubsimplytransmitsallthemessagesreceivedfromonelinetoallotherlines,whereasaswitchorroutercanbemoreclever,savingwherethecomputeriscomingfrom(usingtheMACaddress)andonlysendingthemessagestothespecificcomputerthatitshouldbesentto.

o MACAddress:EverycomputerdevicehasaNetworkInterfaceCard(NIC),whichwouldhaveauniquemediaaccesscontroladdress(MACaddress)whichisassignedandhard-codedintothecardbythemanufacturerandituniquelyidentifiesthedevice.

• Ifonecablefails,onlyonestationisaffected,soitiseasytoisolatefaults• Consistentperformanceevenwhenthenetworkisbeingheavilyused• Performanceisbetterthanbusnetwork• Noproblemswithcollisionsofdata• Messagesaremoresecure• Easytoaddnewstationswithoutdisruptingthenetwork• Differentstationscancommunicatewiththeswitchusingdifferentprotocols.• Morecostly,becausemorecablesarerequired,aswellasacentralhuborserver.• Ifthecentraldevicefails,theentirenetworkwillgodown.

PhysicalvsLogicalTopologyThephysicaltopologyofanetworkistheactualdesignlayout,whichdescribesthewiringscheme.

Thelogicaltopologyisthepathinwhichthedatatravelsanddescribeshowcomponentscommunicateacrossthephysicaltopology

TypesofNetworkingBetweenHostsClientServerNetworking

• In a client-servernetwork, oneormore computers knownasclientsare connected to apowerfulcentralcomputerknownastheserver.Eachclientmayholdsomeofitsownfilesandresourcessuchassoftware,andcanalsoaccessresourcesheldbytheserver.

• Inalargenetwork,theremaybeseveralservers,eachperformingadifferenttask.• Inaclient-servernetwork,theclientmakesarequesttotheserverwhichthenprocessestherequest• Thesecurityisbetter,sinceallfilesarestoredinacentrallocationandaccessrightsaremanagedby

theserver.• Backupsaredonecentrallysothereisnoneedforindividualuserstobackuptheirdata.• Dataandotherresourcescanbeshared.• Itisexpensivetoinstallandmanage• ProfessionalITstaffareneededtomaintaintheserversandrunthenetwork.

Peer-to-PeerNetworks• InaP2Pnetworkthereisnocentralserver.Individualcomputersareconnectedtoeachother,either

locallyoroverawideareanetworksothattheycansharefiles.• Generally,mostused(legally)insmalllocalareanetworksbecause.

o Itischeaptosetupo Itenablesuserstoshareresourcessuchasaprintero Itisnotdifficulttomaintain.

• P2PProblemso Has been widely used for online piracy – impossible to trace the files which are illegally

downloaded.o PiracySitesattracted53billionvisitseachyear.o 432millionuniqueWebusersactivelysearchedforcontentthatinfringescopyright.

WirelessNetworkingWi-Fi

• LocalareawirelesstechnologythatenablesyoutoconnecttoadevicesuchasaPC.• ViaaWirelessNetworkAccessPoint(WAP)• Generally,hasarangeofabout20metresindoors,andmoreoutdoors.• In1999,theWi-FiAlliancewasformedtoestablish internationalstandardsfor interoperabilityand

backwardcompatibility.o Theallianceconsistsofagroupofseveralhundredcompaniesaroundtheworld,andenforces

theuseofstandardsfordeviceconnectivityandnetworkconnections• ComponentsRequired

o ThecomputerrequiresaWirelessNetworkInterfaceController.§ Combinationofcomputerandinterfacecontrolleriscalledastation.

o Allstationsshareasingleradiofrequencycommunicationchannel.o Inordertoconnecttotheinternet,theWAPusuallyconnectstoarouter,butitcanalsobe

anintegralpartoftherouteritself.• Security

o SecurityprotocolsusedtosecurewirelessnetworksincludeWi-FiProtectedAccess(WPA)andWi-FiProtectedAccessII(WPA2)

o WPA2isbuiltintowirelessnetworkinterfacecards,andprovidesstrongencryptionofdatatransmissions,withthegenerationofa128-bitkeyforeachpacketbeingsent.

o EachWirelessNetworkmakesuseofapasswordtopreventunauthorisedpeoplefromjoiningthenetwork.

§ OnecanrecogniseaspecificnetworkusingthecorrectSSID(ServiceSetIdentifier)o Whitelists

§ Some people can use MAC address whitelists to control who is allowed on thenetwork–basedonthedevicesMACaddress.

CSMA/CA(CarrierSenseMultipleAccess/CollisionAvoidance)• ProtocolforcarriertransmissioninWirelessLANnetworks.• Preventscollisionsbeforetheyhappen–acollisionresultsinthedatabeinglost

o CSMA/CD(CollisionDetect)dealswithdetectingwhencollisionsoccur.• Priortotransmission,anodefirstlistensforsignalsonthewirelessnetworkistransmitting.Ifasignal

isdetected,itwaitsforaperiodoftimeforthenodetostoptransmittingandthenlistensagain.• WithRTS/CTS(RequesttoSend/CleartoSend)

o Optionallyusedwhendeterminedthatnoothernodeistransmitting.

o Counteractstheproblemofhiddennodes§ NodeswhichtheWAPcanhearbutnotthenodethatistransmitting.

o ItinvolvessendingasignaldirectlytotheWAPalonebeforehearingasignalfromtheWAPthatthenodecansendthesignal.