Computer Studies Notes
Computer Studies Notes
pk
The International School Seychelles
Theory Notes
Contents
1 Applications Of Computers, Their Social & Economic Implications................................ 1
1.1 The Range And Scope Of Computer Applications ............................................................................. 1 1.2 The Social And Economic Implications Of The Use Of Computers....................................................... 3
2 3
www.studyguide.pk
Syllabus 0420
www.studyguide.pk
Syllabus 0420
Speech recognition
Miscellaneous Areas
Some other applications of computers are: Computer-aided learning (CAL) CD-ROMs, etc. where you can learn at your own pace, like having your own personal tutor Computer animation for films and TV. Special effects, etc.
www.studyguide.pk
Syllabus 0420
EFT
www.studyguide.pk
Syllabus 0420
Changes In Employment
The use of computers in the workplace has an impact on the way people work Retraining of staff Individual training software packages upgraded, staff need to be trained. This is often a regular thing. However training can be personalised to staff's needs through the use of CAL systems, CD-ROMs, etc.
Batch-Processing
www.studyguide.pk
Syllabus 0420
Computer viruses
Sensible precautions should be taken. Up-to-date virus protection Limited use of disks, etc from outside your network Firewall software / hardware prevents viruses using your Internet connection
www.studyguide.pk
Syllabus 0420
2 System Analysis
2.1 Systems Analysis
Systems Analysis describes the process followed when replacing or upgrading a system with a computer-based one. The steps followed are: Fact-finding Feasibility study Analysis System design Implementation Testing Documentation Evaluation
Based on the contents of the study and report, the company will decide if they are going to proceed with the project.
Analysing The Flow Of Information And Data In Existing Solutions and Evaluation Of Existing Solutions
If the project is to continue, then a much more detailed look at the business and its systems is required. Data will be collected and analysed thoroughly to aid in the design of a replacement system. In particular this stage will provide: Charts and diagrams of the present system, and the proposed new system (structure diagrams, data-flow diagrams, etc.) Detailed objectives for the new system 6
www.studyguide.pk
Details of exactly which parts of the old system will be replaced Constraints of the new system (things it will not be able to do) An updated cost / benefit analysis A new plan for further action (including timing, responsibilities, etc.)
Syllabus 0420
A solution will need to be selected, based on the objectives that were set: Which solution fulfils all of the objectives?
Implementation
This can be done in one of three ways: Direct implementation Phased implementation the new system simply replaces the old one. Only suitable for small systems parts of the old system are slowly replaced by the new one, taking time to make sure each bit works before the next is begun the new system runs alongside the old one to check it works as well. When all problems have been solved, the old one stops.
Parallel running
Testing
We must ensure that any new system functions as expected, both in normal use, and when potential problems arise. We test the system with: Normal data Data with errors Large amounts of data Rare / uncommon events Extreme data to see if correct, expected results are achieved to check that our validation and error-checking routines to ensure that the system can cope with high loading like yearly reports, just to see that they work as expected to make sure that validation works, and calculations cope with the large / small values
Documentation
There are two main type of document that are required: User documentation explaining how to use the new system (a user guide) Technical documentation to allow people to alter / upgrade the system in the future
Evaluation
Finally, the new system has to be assessed. Did it meet its objectives? Ask the new users! The International School Seychelles 7
www.studyguide.pk
Syllabus 0420
e.g. Software for teaching children about shapes could be broken down into the following modules: One that deals with drawing shapes (further broken down into shape modules) One that deals with asking questions about shapes, and uses the drawing modules One that saves and loads the student's progress to / from disk
Each module has a clear purpose and it's dependency on other modules is clear. If the modules are well defined, then the overall problem becomes easier to solve.
Designing Algorithms
When writing algorithms to solve software problem, you must always bear in mind that your solution must satisfy the requirements of the system. If the software is required to calculate the average scores of 1000 students, then that is what your algorithms must do.
The inputs and outputs will be defined by the algorithm's location within the overall system, and it's connections to other modules. e.g. If an algorithm is required to draw a square on the screen, then we need to define how it will be used. We want to use it several times for different sized squares, in different places on the screen, so we'll need to give it some sizes and a location: Inputs: Outputs: side length l, and position of top-left corner (x, y) a square! Sides l, located at (x, y)
This algorithm can now be easily used to draw any square, anywhere, as long as we supply it with the correct data. The actual algorithm produced is almost irrelevant as long at it produces the desired results, from the inputs supplied (there are issues of speed, good programming practice, etc. to be considered though)
www.studyguide.pk
Syllabus 0420
Algorithm Tools
Top-down design a software problem is solved by breaking it down into smaller and smaller modules, until each of these is easy to solve, and write software for. The final solution is formed by joining the modules together. Usually represented using a structure diagram. (see Section 3.2 below) (see Section 3.2 below) these are an effective way of breaking up a software task. The user has menu options, each of which is handled by a separate bit of the software (like the top-down structure) Many common software problems have been solved already, and you can buy in libraries of software modules that can be 'glued' together to form an application
Libraries of subroutines
Extreme data
www.studyguide.pk
Syllabus 0420
3.2 Programming
The Concept Of A Program
A computer program is a collection of commands that the computer is to follow. The main requirements of a programming language are: To allow manipulation of data of various types and structures The control of inputs and outputs To provide for selection and repetition (see below) To allow links between subprograms Following one command by another by another, etc. Instruction 1 Instruction 2 Instruction 3 etc the computer executes each instruction in order
Sequence i.e.
Selection i.e.
The computer is given a question as then performs different tasks based on the answer Has something happened? Yes Instruction 1 Instruction 2 etc No Instruction 1 Instruction 2 etc the instructions that are executed depend answer to the question
Repetition
Following the same group of commands over and over again (loop) The loop may go on forever (infinite loop) or may stop due to a certain condition (conditional loop)
an infinite loop
a conditional loop
Low-Level Languages
Low level languages are close to the actual language that computers use (machine code) Hard to program in Most common is assembly language An assembler converts assembly language into machine code 10
www.studyguide.pk
Syllabus 0420
High-Level Languages
These are languages that are closer to human language than computer. There are many different types, some dedicated to specific applications (e.g. Fortran is used for mathematics, Cobol is used for business databases) Much easier to use than low level languages Very easy to create the programming structures such as loops Lots of easy-to-use tools to help debug programs Require either an interpreter or a compiler to convert language into machine code
Assemblers
Convert low-level languages into machine code. This is called assembly.
Interpreters
Convert high-level languages into machine code Convert one instruction at a time, executing it immediately To run programs that use an interpreter, requires the user to have an interpreter themselves The final program runs more slowly than a compiled program
Compilers
Convert high-level languages into machine code Convert the whole program in one go The program cannot be run until it is fully compiled Once a program is compiled, the user does not need a compiler to run it (the program is 'stand-alone' The resulting programs run very quickly compared to interpreted programs
Structure Diagrams
These diagrams help us design software, by letting us break the task down. The programming problem is broken down into a number of sub-tasks These sub-tasks can also be broken down into smaller tasks And so on
The smaller tasks are then simple to solve, and when they are all joined together, we should end up with a solution to the overall problem. Main Problem
Sub-Task A
Sub-Task B
Sub-Task C
A1
A2
A3
B1
B2
C1
C2
C3
11
www.studyguide.pk
Syllabus 0420
Variables
Within any computer program, data needs to be stored whilst it is being processed. We store it in special locations in memory called variables (their contents can change, so they are 'variable'!) Variables have names pick names based on what you want to store (e.g. 'score') They can store different types of data: numbers, text ('strings'), etc. You can use variables within calculations (e.g. 'total = score1 + score 2') The content of a variable can be set (e.g. 'Set score to 0', or 'score = 0')
Flowcharts
These diagrams show the flow of our program (the order that instructions are executed) The start and end of the program is shown as a 'sausage' Any tasks that are just simply executed are shown in rectangles Inputs and outputs are shown in parallelograms Places where a decision is made (selection) are shown using diamonds Places where files are saved to or read from disk are shown using cylinders When files are master files or transaction files, they are shown as reels of tape Places where print-outs are generated are shown as a piece of paper Arrows join the symbols together Start Instruction In/Out Input Score Add Score to Total Start
Question
File
File
Was Score = 0?
Pseudocode
This is a way of describing an algorithm (or program) using words. It is an alternative to a flowchart, and is often easier to write, and more understandable, since it is close to English. Words are close to English Uses some standard words for program structures such as loops (see below) Indentation is used to highlight the structure of the code Inputs and outputs are shown using the words Input ( data ) and Output ( data ) Mathematical operations can be written in words (e.g. 'Add 6 to score')
12
www.studyguide.pk
Syllabus 0420
Pseudocode Structures
There are several standard pseudocode structures that are commonly used: Input ( variable ) Output ( variable / "text" ) Repeat ... Until Gets data from the user and stores it in the variable Prints the contents of the variable, or the text on the screen for the user to see Repeats the instructions between the 'Repeat' and 'Until' lines until a condition is met e.g. Repeat Output ( "Please enter a score:" ) Input ( score ) Until score equals 0 Allows for selection or decision-making. A condition is tested and if it is true then one set of commands is executed, else if it is false another set is executed. e.g. If Score is greater than 60% Then Output "You have passed. Well done!" Else Ouput "You have failed. Sorry!" Endif
Case of ... Otherwise ... Endcase If you want to have different things happening depending on the value of a variable. e.g. Case of score is greater than 70 Output ( "You have an A" ) score is greater than 60 Ouptut ( "You have a B" ) score is greater than 50 Output ( "You have a C" ) Otherwise Output ( "You have failed" ) Endcase While ... Do ... Endwhile This is another form of loop (like RepeatUntil) except that this one keep going whilst a condition is true, and the condition is checked before the loop starts e.g. Set count to 10 While count is greater than 0 Do Output ( count ) Take 1 away from count Endwhile Output ( "Blast off!!!" ) 13
www.studyguide.pk
Syllabus 0420
User Documentation
Any piece of software requires some kind of user documentation. Instructions on how to set-up and install the software Instructions on using the software (User Guide) Troubleshooting tips (for when things don't work as expected)
Technical Documentation
This is required by those responsible for improving and maintaining a software solution in working order, or for developing the solution to meet new needs. A guide showing the structure of the software (using structure diagrams for example) What inputs are expected What outputs are generated What algorithms are used to process data, etc. (using pseudocode or flowcharts) Any actual code should contain comments. These are notes explaining what a particular set of instructions is supposed to do.
14
www.studyguide.pk
Syllabus 0420
Multimedia Authoring
The production of CD-ROM / websites that include text, images, video, sound, etc. Common applications are education, CAL, reference (encyclopaedia, etc.)
15
www.studyguide.pk
Syllabus 0420
Data-logging
A computer uses sensors to detect events, etc. Examples could be measuring traffic flow, science experiments, etc. Data is more accurate than that taken by a person, and can be analysed instantly (graphs, etc.)
CAD
Products are designed on the screen rather than on paper Much faster, and far more flexible than drafting designs by hand The products sizes (dimensions) can be altered easily (no rubbing out!) The product can be viewed from different angles with lighting effects, etc. Some CAD systems allow products to be tested using modelling techniques, so that weaknesses can be found before anything is actually physically manufactured
Programming
Software can be produced using programming languages Many modern programming languages are now so easy to use that applications can be produced in minutes
Schools / charities
www.studyguide.pk
Syllabus 0420
Macros
within many applications, the computer will automatically check and correct your spelling and grammar Many complex tasks are made extremely easy for novices through the use of wizards. The user is asked a series of questions and their answers result in an appropriate complex set of actions (e.g. producing a poster) When a number of operations need to be repeated over and over again, they can be 'recorded' and stored in a macro. This macro can be 'replayed' any number of times
Some business's needs cannot be satisfied by generic software, and custom-written applications are necessary. These are: Very expensive since they are usually one-offs Perfectly suited to the business's needs Easy to learn since they can be exactly matched to the skills of the workforce Sometime quite unstable (buggy) since they have only limited testing
17
www.studyguide.pk
Syllabus 0420
4.2 Data
The Relationship Between Information And Data
Information is data that has been processed. e.g. 234567 is simply data (a number) but it could mean many things a membership number, a mathematical result, etc. Once it is given this meaning, it becomes information.
Sensors
Data Validation
To ensure that the data being processed is accurate it must be checked to see that it makes sense. It is asking too much of a computer to check if it's true - somebody may just be lying! Certain validation checks can be carried out: Range-check Type-check Format-check Presence-check Checksum Check-digit e.g. a driver's age should be between 17 and 99 e.g. a name should only contain alphabetic characters e.g. a data should be entered as dd/mm/yyyy e.g. certain data must be entered (e-mail address) e.g. the numeric values in a file should always add up to a known amount e.g. the last digit of an account number is calculated from the previous digits, and then recalculated on input to see if it matches 18
www.studyguide.pk
Syllabus 0420
Data Verification
Once we know our data is valid (i.e. it is logical, and in the right format, etc.) then we also need to check if it is correct (it maybe a valid date-of-birth, but is it your date-of-birth?!) Proof-reading Double-entry the person entering the data simply reads through what they have entered to check it is correct the data is entered twice, either by the same, or another operator. The computer compares the data, and any that doesnt match is questioned.
Sequential indexed
Random access
www.studyguide.pk
Syllabus 0420
Deletion
when data records in a file are altered because the data has changed, the file is said to be updated if new data is to be added in the correct place in a sequential file, the file is first searched to find the right location and the data added. The remaining data must be moved to make room when an item of data needs to be removed, the sequential file is searched until the item is found, it is removed and the remaining data is moved to fill in the gap left behind
Analogue data can be made digital if it is sampled. This involves measuring the level at a particular moment in time Since computers are digital devices, whilst many other devices are analogue, we need to be able to convert analogue data into digital for input into a computer, and back again. Analogue to Digital Converter (ADC) The analogue signal is sampled at regular time intervals to give a sequence of digital values. An example: Temperature sensor supplies an analogue voltage dependent upon the temperature. This voltage passes through an ADC to become binary (digital) values
Digital to Analogue Converter (DAC) The computer's digital data (binary numbers) is converted into an analogue signal. An example: Sounds for a computer game are generated as digital data. These are passed to a DAC which produces an analogue signal which can drive a loudspeaker (all sound cards in PCs are essentially DAC devices)
20
www.studyguide.pk
Syllabus 0420
Data Types
Data can take many types including: Numbers these can be integers (whole numbers) or real numbers (with fractional parts). Numbers can be formatted to be displayed as currency, dates, etc. are the symbols on the keyboard, including letters, numbers, punctuation, etc. Characters can be joined together to make a load of characters joined together (e.g. "Steve", "HHGF45sju" ) are a collection of a particular data type. So an array of integers would be a whole set of numbers stored together. Arrays have a name, and the individual parts are numbered (e.g. Scores(3) is the third item in the 'Score' array)
21
www.studyguide.pk
Syllabus 0420
Peripheral devices
Backing storage
Microcomputer
The original digital computers from the 1940s were huge beasts that took up whole rooms, or even buildings. Since then, computers have got a lot smaller, a lot more powerful and a lot more user-friendly. Mainframes Minicomputers Microcomputer Laptop Palmtop PDA the original, large computers were called mainframes the next generation of computers, and the first ones that were sold in large number to businesses the small computer that you will be used to using, one that is self-contained and sits on your desk a portable microcomputer a portable computer that is small enough to be hand-held (Personal Digital Assistant) tiny computer that usually has no keyboard, using a touch screen instead
22
www.studyguide.pk
Syllabus 0420
Engine Management
Processor Power
A processor deals with instructions one at a time. The quicker it can read and process instructions, the quicker tasks will be completed. Because of this, people are always keen to get quicker and quicker processors. We measure processor speed in Hertz (Hz), and this measures how many instructions a processor can handle per second. Most processors will handle millions or even billions of instructions per second, so you will see their speed quoted in megahertz (MHz, millions) or gigahertz (GHz, billions)
23
www.studyguide.pk
Syllabus 0420
The computer can access RAM extremely quickly. Commonly computers have about 256MB of RAM ROM this memory is non-volatile (keeps it's contents when the power goes off) so it is used to hold data that is permanently required. The main use is to hold the small boot-up program that a computer runs when first switched on. a form of magnetic storage that can hold huge amounts of data (up to 500GB, or 500,000,000,000 bytes of data!) Data can be accessed very rapidly (not as fast as RAM though) so it is good for most storage. Users need larger and larger hard drives since they are starting to save digital images, music and even video, all of which take up a lot of space. For example: Floppy disk Digital photo, A4 size 4 minute MP3 music track 10 minutes of a movie, full screen (VCD) 500kB (0.5MB) 4MB 80MB
Hard disk
a form of magnetic storage that is removable, so it can be used to transfer data between computers. Very old, crude technology so not very reliable. Can hold 1.44MB of data (1,440,000 bytes) similar to a floppy, but holds much more data (20MB or more)
Zip disk
Magnetic tape a form of magnetic storage that is a little like a small video cassette. It can hold huge amounts of data (24GB), but the data can only be accessed sequentially (one bit after another) so tape is usually only used for backing up data. CD-ROM optical storage (read by a laser) that is commonly used to hold data such as software, reference data, etc. Normally holds abut 700MB of data. CD-ROMs are read-only, so data cannot be saved onto them.
CD-R and RW CDs that can be written to, so data can be saved onto them. CD-Rs can be used saved to once, CD-RWs can be saved to many times. DVD-ROM Memory card similar to a CD-ROM, but can hold up to 17GB of data (25 x bigger) a type of ROM that can be written to electronically. These little devices are found in digital cameras, MP3 players, etc. and allow data to be easily moved about. They are replacing floppy disks. Still quite expensive. Come in capacities from 16MB up to 2GB 24
www.studyguide.pk
Syllabus 0420
25
www.studyguide.pk
Syllabus 0420
Examples of common OSs are Windows 98, Windows XP, Mac OS, Unix, Linux, etc.
Menu interfaces
26
www.studyguide.pk
Syllabus 0420
Files often need to be moved, copied or deleted. This can be accomplished through a GUI (e.g. in Windows you can delete a file by dragging it to the waste bin) or by typing commands (e.g. In Unix you type "rm filename", in MS-DOS you type "del filename"). Sometime you need to see the contents of a file, or to print it out. In a GUI you might drag the file to a suitable application (e.g. In windows you would use Notepad to view text files) or you may type a command (e.g. In Unix you would type "cat filename" to view it)
Use Of Buffers
A buffer is a small arrear of memory that is used to temporarily hold data that is either being sent to a peripheral (e.g. a printer) or coming from a peripheral (e.g. a keyboard) The buffer allows the computer (which is very fast) and the peripheral (which is often very slow) to operate independently without having to wait for each other. For example, when printing, the OS places the print data in a buffer and the printer begins to print it. The OS does not have to wait about for the printer to finish. It can get on with more useful tasks.
Polling
Another way of peripherals interacting with the CPU is for the CPU to regularly 'ask' the peripheral if anything has happened that it needs to deal with. It goes around each of its peripherals in turn. This is called 'polling'. Polling is much more inefficient than an interrupt system, as often nothing will have happened, so the CPU wastes time asking.
Handshaking
When establishing a communication link, two computers will 'greet' each other, and 'introduce' themselves. Once both computers are happy, and ready, communication can continue. This initial process is know as 'handshaking'
Check Sums
Adding together all of the elements (e.g. the bytes) of a block of data produces a single element known as the check sum. This can be stored with the data block and provides a check when the block is transferred. The receiver re-calculates the data's checksum and compares it with the one sent. If they differ, a communication error probably occurred. The International School Seychelles 27
www.studyguide.pk
Syllabus 0420
Merge
New MF
Multi-Tasking Systems
If a user can run several tasks at once (concurrently) on the same computer, it is aid to be multi-tasking. An example is when you have a word-processor, a spreadsheet and a CD player all running at once. The computer is multi-tasking.
Real-Time Systems
A real-time transaction system is an online system in which individual, discrete transactions are processed as they occur. An airline booking system and an online stock control system are typical examples. A real-time control system is a system in which physical quantities are continuously monitored and processed sufficiently rapidly to be capable of influencing the sources of data. A chemical plant, or an autopilot system in an aircraft are examples. The International School Seychelles 28
www.studyguide.pk
Syllabus 0420
Control Systems
In a control system, one or more computers is used to control the operation of some non-computer equipment, usually involving some monitoring and logging of physical quantities, providing some analysis of performance and allowing some user interaction. Feedback is an essential element in most control systems. Timing considerations are often critical and the term real-time control system is sometimes used to indicate this. Control systems are used in applications such as oil refining, chemical processing and integrated traffic-control systems.
Automated Systems
Automated systems are broadly similar to control systems but are dedicated to a particular task, and lack the ability to collect and analyse data and the flexibility to allow for and act on user interaction beyond a very simple level. Examples are the systems found in equipment such as washing machines and cameras.
Multimedia Systems
Candidates should be able to specify minimum hardware and software requirements for multimedia applications, and describe typical features and uses of multimedia systems.
Network Systems
A network system is one in which several computers are joined together by communication links, and can then share resources such as file storage, printers and information resources. Local resources Remote resources Star Networks The computers are arranged around a central hub. This hub may be a computer or a dedicated piece of hardware. Star networks are very fast as data between computers can always take the most direct route. They are also quite secure (safe from people seeing your data) as data is only read by the computers sending / receiving. Linear (Bus) Networks The computers connect to a long, common cable. All data is sent onto this cable, and each computer listens out for messages for itself. Bus networks are cheap to install, and if a computer breaks, the rest of the network can still operate. Ring Networks Computers are connected to a circular cable. Data can go either way, so this network can cope better with cable breakages than other network types. 29 hardware and software that reside on your computer those items that you access via the network (e.g. a printer)