COMPUTER STUDIES NOTES
1. THE COMPUTER SYSTEM 1.1 WHAT IS A COMPUTER? A computer is an electronic machine which accepts INPUT (DATA), process that input and OUTPUTS the relevant information. This is done by means of a program – a group of instructions.
By definition a computer is an electronic machine under the control of a program
1.2 THE BASIS FEATURES OF A COMPUTER • • • •
Processing speed – Computers are faster than us infact they Execute millions of instrustions per second. (Mhs) Storage & rocesing large volumes of data – Computers can proess large Volumes of stored data to give results. Accuracy-Once computers are correctly instructed we expect them to give accurate Consistency – Always the same – on every computer
MAIN FUNCTIONS OF A COMPUTER SYSTEM:
There are 7 basic functions of a computer these are: INPUT – PROCESS – OUTPUT – STORE – RETRIEVE – SEND – RECEIVE
data
Input
Processing
Output
Storage
MR NOEL ATTARD
PAGE: 1
information
COMPUTER STUDIES NOTES
1.3 ADVANTAGES AND COMPUTER SYSTEM:
DISADVANTAGES
OF
A
Accurate Advantages
Fast – less time consuming Prices are always going down – becoming cheaper It works with electricity – without electricity you cannot use a
Disadvantages: computer Dependency – what happens if the computer system fails?
2. DATA VS INFORMATION: A Computer is basically a Processor of Information. Information that has been processed and shaped forms the basis of knowledge it self. It can therefore be seen that a computer is a truly remarkable machine.
Information = Data + Structure That means that after structure has been applied to data it has a meaning, i.e. it has now become information.
DATA 04052000
MR NOEL ATTARD
+
STRUCTURE A DATE
=
INFORMATION 04/05/2000
PAGE: 2
COMPUTER STUDIES NOTES
3. WHAT IS PROCESS CONTROL? In some case the computer does not only do INPUT – PROCESS – OUTPUT, but the OUTPUT is taken again by the computer as a new input. This is called PROCESS CONTROL.
[INPUT (DATA)] ===> [PROCESS] ===> [OUTPUT]
PROCESS CONTROL Example: The ABS System) of a car. -
(Anti
Braking
where the output is taken again as input
If computer system is given the wrong data as input the computer in return will give the wrong information as output. This is called GIGO – Garbage IN Garbage OUT.
A computer is an electronic machine, which works under the control of a stored program, automatically accepting and processing data to produce information.
A program is a complete set of instructions, which instruct the computer to perform a particular task.
So the computer is an information-processing machine. It’s tasks are: handling information; inputting; processing; outputting; storing; retrieving; sending and receiving information.
MR NOEL ATTARD
PAGE: 3
COMPUTER STUDIES NOTES
4. WHAT IS PROCESS CONTROL?
Hardware Hardware is the physical part of the computer system. The processor, input, output, storage drives and peripherals make up the hardware of the computer. ALL you can touch is computer hardware.
Software Computer software, or just software is a general term used to describe the role that computer programs, procedures and documentation play in a computer system. It's the intangible part of the computer system. On the other hand unlike hardware software cannot be touched. Imagine software as being a layer between the hardware and the user. This layer is divided into two main parts the layer nearest to the hardware is called the system software or the operating system, while the layer facing the user is called application software. -
System Software – we need only 1 installed inside the computer and it take care of all the hardware and the user needs. It is also called the Operating System. Example: Windows.
MR NOEL ATTARD
PAGE: 4
COMPUTER STUDIES NOTES
-
Application Software – are all the other programs installed into the computer in order for the computer to do something. Example: Ms Word, Ms Excel, Games ….
Peripheral Is a piece of equipment (hardware) which can be connected to the central processing unit. They are used to provide input, output and backing storage for the computer system.
Input device Is a peripheral unit that can accept data, presented in the appropriate machine readable form, decode it and transmit it as electrical pulses to the central processing unit. Examples of input devices are keyboard, mouse, scanner etc…
Output device Is a peripheral unit that translates signals from the computer into a human-readable form or into a form suitable for re-processing by the computer at a later stage.
Example of output device are monitor, printer, speaker, etc…
MR NOEL ATTARD
PAGE: 5
COMPUTER STUDIES NOTES
Storage device Is a peripheral unit that allows the user to store data in an electronic form for a longer period of time and when the computer is switched off. The data can only be read by the computer and is not in humanreadable form.
Example of storage device are floppy disk hard disk, CD / DVD pendrive
5. TYPES OF COMPUTERS: The two principal characteristics of a computer are: It responds to a specific set of instructions in a welldefined manner. It can execute a prerecorded list of instructions (a program). Modern computers are electronic and digital. The actual machinery - wires, transistors, and circuits -- is called hardware; the instructions and data are called software.
MR NOEL ATTARD
PAGE: 6
COMPUTER STUDIES NOTES
Computers can be divided into two categories: Computer: Designed to solve more than Home Personal
-
General Purpose one task – like Computer.
-
Special Purpose Computers: Designed to solve ONLY a particular task – like Autopilot or washing machine or play station
All computers require: •
Input device : Usually a keyboard and mouse, the input device is the conduit through which data and instructions enter a computer.
•
Output device : A display screen, printer, or other device that lets you see what the computer has accomplished.
•
Central processing unit (CPU): The heart of the computer, this is the component that actually executes instructions.
•
Memory : Enables a computer to store, at least temporarily, data and programs. Storage device : Allows a computer to permanently retain large amounts of data. Common mass storage devices include disk drives and tape drives.
MR NOEL ATTARD
PAGE: 7
COMPUTER STUDIES NOTES
(STORAGE CAN BE OPTIONAL but then there will be no OPTION to save data and when switched OFF all DATA will be LOST)
6. COMPUTERS CAN BE CLASSIFIED AS FOLLOWS: -
-
Personal computer : A small, single-user computer based on a microprocessor. In addition to the microprocessor, a personal computer has a keyboard for entering data, a monitor for displaying information, and a storage device for saving data.
PDA - A personal digital assistant (PDA) is a mobile device, also known as a palmtop computer. Newer PDA’s commonly have color screens and audio capabilities, enabling them to be used as mobile phones (smart phones), web browsers, or portable media players.
-
Workstation : A powerful, single-user computer. A workstation is like a personal computer, but it has a more powerful microprocessor and a higher-quality monitor.
-
Minicomputer : A multi-user computer capable of supporting from 10 to hundreds of users simultaneously.
-
Mainframe : A powerful multi-user computer capable of supporting many hundreds or thousands of users simultaneously.
-
Supercomputer : An extremely fast computer that can perform hundreds of millions of
MR NOEL ATTARD
PAGE: 8
COMPUTER STUDIES NOTES
instructions per second.
7. ANALOGUE AND DIGITAL ANALOGUE - Continuous Data: Sometimes we are unable to count exactly. For example if water is coming out of a tap in a continuous stream we would be unable to count the number of drops per minute. Such data is called continuous/analogue data and must be obtained by measurement. Examples of continuous data: ♦ Some watches have an analogue display, where hands move continuously round a dial. The time is represented by the positions of the hands on the dial. ♦ A dimmer switch - this can (theoretically) assume any position between the on and off states ♦ An electric motor - this can rotate at any number (including fractional) of revolutions per unit time depending on the current supplied. An analogue device is one in which data is represented some quantity which is continuously changing. The of a data item at a given time is represented by the the quantity on a fixed scale. In analogue data any be represented because the quantity can take any range used
by value size of value can value in the
DIGITAL - Discrete Data : Consider a dropping water tap. Since small drops are falling one at a time we can count the number of drops falling per minute. Data obtained by a set of pulses that can be counted is called discrete data. Discrete data can take one of a fixed number of states. Examples of discrete data: ♦ The display of an electronic calculator is digital with the numbers in decimal. Each digit can have any of ten separate states (0, 1, 2, 3, 4, 5, 6, 7, 8, or 9). Therefore the calculator can only display 10 varieties when it comes to characters.
MR NOEL ATTARD
PAGE: 9
COMPUTER STUDIES NOTES
♌ A switch can be either on or off (1 or 0) - this is a digital device – Also called BI STABLE ( 2 conditions) A device that can be set to a number of different separate values or states is called a digital device. In practice the quantity used is often 2 states (binary) and data is represented as a succession of 1s and 0s. Data is therefore held as a code.
GRAPHICAL REPRESENTATION ANALOGUE DATA
OF
DIGITAL
AND
An analogue signal showing continuous variation in the value, hence the graph has an infinite number of possible values.
Analogue
signal
A digital signal has 2 different values: either maximum or minimum. There are no in between values.
Digital signal
DATA REPRESENTATION Data can be represented using either analogue or digital devices. Consider a stop watch which is used to find the time of fall of an object in a Physics experiment. Consider an analogue stopwatch which can show a time
MR NOEL ATTARD
PAGE: 10
COMPUTER STUDIES NOTES
anywhere between 0 and 5 minutes. It would be difficult on such a watch to distinguish 0.05 seconds from 0.06 seconds. On the other hand we may prefer to use a discrete device (eg. A digital stop watch) which can be set to 0s all the way up to 9 seconds. Take a voltmeter (a device that measures voltage) that may be set to0V all the way up to 9V in steps of 1V. We can use such a device to represent the digits 0 to 9 by setting the device to 0V to represent the digit 0, 1V to represent the digit 1... Minor imprecision will not affect the system since a reading of 3.2V will still be interpreted as representing the digit 3. The system is more accurate.
Analog variation of voltage
1.5
Discrete Representation 1
-1
64
55
0.6 0.4 0.2
BI-STABLE DEVICE: Much easier to produce are bi-stable devices electronic devices which can be in one of two states. We usually think of these two states as being the ON and the OFF states, so the device can be considered to be an electronic switch. However, these two states can represent anything which can take on one of two possible values, such as in voltage 0V and 5 V or the binary digits (bits) 0 and I. Computers represent and store data in binary form using sets of bits
MR NOEL ATTARD
PAGE: 11
29
25
Time
21
17
13
9
Time
5
0 1
-1.5
46
37
28
19
-0.5
10
0
Voltage
0.8
0.5 1
Voltage
1
COMPUTER STUDIES NOTES
to represent any value.
8. CONVERTING FROM ANALOGUE TO DIGITAL DATA The output from a microphone is analogue since sound can take various frequencies. Such data has to be digitized before it can be stored or processed by a computer. An analogue-to-digital converter is an interface to convert an analogue signal to a digital one.
Digital signals Processor
Analogue signal Controlled device
A-D converter
CONVERTING FROM DIGITAL TO ANALOGUE DATA
The digital data for a computer display has to be converted into analog signals it if is to be used as input to a television. A digital-to-analogue (D-A) converter is an interface to convert a digital signal to an analogue one. It converts a set of binary signals to one single varying voltage. Digital control signals
Processor
Analogue signal
D-A converter
Controlled device
THE USE OF DIGITAL TO ANALOGUE AND ANALOGUE TO DIGITALCONVERTERS D-A and A-D converters are used for computer communication over telephone lines since most computers work on a digital basis while the telephone line MR NOEL ATTARD
PAGE: 12
COMPUTER STUDIES NOTES
system works on analogue (MODulator / DEModulator) - a device which converts digital signals to analogue and vice-versa. A MODEM is a device which plugs into the computer (or can be external i.e. bought at later stage and hooked up without having to dismantle you PC) and requires a telephone line. This means that while the computer is making use of the modem the telephone line cannot be used for verbal phone calls at the same time. Modems are increasingly becoming popular, cheaper and better. Most computers now house an internal modem - another card installed inside the computer. Modems are regarded as input and output devices at the same time, because they allow communication to and from our computer. Modems differ also in speeds. This is the amount of data transfer that a modem can handle at one time. Typical modem speeds nowadays are 33.6Kbps and 56Kbps (thousand bits per second).
modem
modem
modem
modem
Digital signal
MR NOEL ATTARD
Analog signal
Digital signal
PAGE: 13
COMPUTER STUDIES NOTES
10. THE CENTRAL PROCRESSING UNIT The CPU is short for Central Processing Unit; this is the part of the computer where work gets done. In most computers, there is one processing chip. The CPU is the brains of the computer. Sometimes referred to simply as the processor or central processor, the CPU is where most calculations take place. In terms of computing power, the CPU is the most important element of a computer system. The term processor has generally replaced the term central processing unit (CPU). The processor in a personal computer or that is embedded in small devices is often called a microprocessor. The CPU is that little device located on your motherboard that seems to be the heart of the system. Your CPU has several jobs but only one primary objective, that is take simple tasks and do them FAST! Computers can only store or process information in the form of bits (group of 1 and 0). A computer instruction is made up of two parts:
The Operation : WHAT TO DO?????? The Address : WHERE TO FIND THE DATA IN MEMORY … to do something on. These INSTRUCTION are both stored inside the Memory Unit in terms of 1 and 0. Then the Control Unit and the Arithmetic and Logical Unit, first get the INSTRUCTION from the Memory … go to location and get the DATA, according to the address found in the instruction. A computer works by executing a series of instructions, which are called a program. A program in the form of 1 and 0 is called a machine code program … and it is the only type of language a computer understands. MR NOEL ATTARD
PAGE: 14
COMPUTER STUDIES NOTES
All data inside the computer passes along parallel groups of wires (conductors) called a
bus.
In this way it is possible to transmit several binary digits (bits) at once. The parallel group of wires (or conductors) that carry the memory address information are called the ADDRESS BUS. On the other hand the parallel group of wires (or conductors) that carry data – the contents of the memory location are called the DATA BUS. INPUT
When data is passed to the computer in a form that the computer can
DEVICE
use.
OUTPUT
When the user is provided with the information produced by the
DEVICE
computer system. Consists of two types: •
RANDOM ACCESS MEMORY (RAM) - VOLITILE
•
READ ONLY MEMORY (ROM) – NON VOLITILE
MEMORY
Memory is physically outside the CPU and is placed at different areas
UNIT
on the motherboard. Input data and any results of any calculations are stored within RAM. Bootstrap loader is stored in ROM. The CPU is made up of two main parts:
CPU Central
•
ARITHMETIC LOGIC UNIT (ALU) - performs Maths and Logic
Processing
•
CONTROL UNIT (CU) - manages all movement to and from all
Unit
peripherals to the CPU. Refers to the computers ability to maintain data or information for use at a later time. A computer has two main means of storage: Main
STORAGE
Memory (Primary Memory or Working Memory) and Secondary Storage (or Backing Storage) – like the hard disk.
MR NOEL ATTARD
PAGE: 15
COMPUTER STUDIES NOTES
The
CPU is made up of two main parts:
CONTROL UNIT (CU) - manages all movement to and from all peripherals to the CPU. it is a typical component of the CPU that implements the microprocessor instruction set. It extracts instructions from memory and decodes and executes them, and sends the necessary signals to the ALU to perform the operation needed.
ARITHMETIC LOGIC UNIT (ALU) - performs Maths and Logic Operations. This is the part that executes the computer's commands. A command must be either a Basic Arithmetic Operation: + - * / or one of the Logical Comparisons: > , < , = , <> The apart from these important units there is also MEMORY UNIT Memory is physically outside the CPU and is placed at different areas on the motherboard. Input data and any results of any calculations are stored within RAM. All the data inside the MEMORY must be saved into the BACKING STORE before switching off â&#x20AC;&#x201C; ELSE ALL DATA IS LOST
MR NOEL ATTARD
PAGE: 16
COMPUTER STUDIES NOTES
BACKING STORE Refers to the computers ability to maintain data or information for use at a later time. A computer has two main means of storage: Main Memory (Primary Memory or Working Memory) and Secondary Storage (or Backing Storage) â&#x20AC;&#x201C; like the hard disk.
7. HOW DOES DATA MOVE INSIDE THE COMPUTER? What is a Bus? The bus width is the amount of data the CPU can transmit at a time to main memory and to input and output devices. An 8-bit bus moves 8 bits of data at a time. Bus width can be 8, 16, 32, 64, or 128 so far. Think of it as "How many passengers (bits) can fit on the bus at once to go from one part of the computer to another." There are two buses: an address bus and the data bus. The data bus transfers actual data whereas the address bus transfers information about where the data should go. There is also the Control bus â&#x20AC;&#x201C; which controls data transfer. The size of a bus, known as its width, is important because it determines how much data can be transmitted at one time. For example, a 16-bit bus can transmit 16 bits of data, whereas a 32-bit bus can transmit 32 bits of data.
MR NOEL ATTARD
PAGE: 17
COMPUTER STUDIES NOTES
The address bus: The address bus is a collection of wires connecting the CPU with the main memory that is used to identify particular locations (addresses) in main memory. The width of the address bus (that is, the number of wires) determines how many unique memory locations can be addressed. Modern PCs and Macintoshes have as many as 36 address lines, which enables them theoretically to access 64 GB (gigabytes) of main memory. However, the actually amount of memory that can be accessed is usually much less than this theoretical limit due to chipset and motherboard limitations. So the larger the address bus the more MEMORY location can be accessed The data bus: The data bus is a set of parallel copper strips acting as wires along which data travels between the CPU, central memory and peripherals. In fact all that requires data transfer is connected to the data bus. The width of the data bus depends also on the type of CPU and determines the word length, that is, the maximum number of bits a computer can pass at once along the bus. The larger the data bus, the faster the computer will perform.
The control bus: It is a bus with 1 wire â&#x20AC;&#x201C; True or False, to check is data passed ok.
MR NOEL ATTARD
PAGE: 18
COMPUTER STUDIES NOTES
CPU Control Unit
Arithmetic Logic Unit
Input
data / information control lines
Memory
Output
Backing Storage
CLOCK SPEED: Also called clock rate, the speed at which a microprocessor executes instructions. Every computer contains an internal clock that regulates the rate at which instructions are executed and synchronizes all the various computer components. The CPU requires a fixed number of clock ticks (or clock cycles) to execute each instruction. The faster the clock, the more instructions the CPU can execute per second. A 400 MHz can do 400 million operations a second. A 1.5GHz processor can do 1500 million operations a second. Clock speeds are expressed in megahertz (MHz) or gigahertz ((GHz).
MR NOEL ATTARD
PAGE: 19
COMPUTER STUDIES NOTES
8. BITS & BYTES Modern computers are digital that is; all info is stored as a string of zeros or ones - off or on. All the thinking in the computer is done by manipulating these digits. The concept is simple, but working it all out gets complicated.
REPRESENTING DATA USING 1 BIT: A digital signal can be in 1 of 2 possible states. Such a signal is called a BIT (Binary digit). Thus, a bit can represent ONE of TWO POSSIBLE VALUES. Using just one bit, we can represent any data that can only have 2 possible values, (e.g. 1 and 0, True and False, ON and OFF, Male and Female.)
All the possible states of a bulb can be represented by the digits 1 and 0
1
0
Bulb on: can be represented as 1
Bulb off: can be represented as 0
Definition: Binary digit (or bit) ~ a 1 or a 0 used to represent data. The term is also used for the smallest unit of storage, which just stores a 1
USING 2 OR MORE BITS: Suppose out data are the seasons. Clearly one bit is not enough, because a single bit can represent only 2 things, but there are 4 seasons. So we must use more than one bit.
MR NOEL ATTARD
PAGE: 20
COMPUTER STUDIES NOTES
We can use groups of bits to represent positive whole numbers starting from zero (0). •
With 1 bit we can only represent 2 numbers - 0,1 1 bit – ON /OFF
• •
With 2 bits we can represent 4 numbers - 0,1,2,3 With 3 bits we can represent 8 numbers - 0,1,2,3,4,5,6,7
So 1 byte (8 bits) can be one of 256 possible combinations of 0 and 1. Numbers written with just 0 and 1 are called binary numbers.
Example with 5 Bits Combinations of different numbers is: 25 = 32 different combination Range of numbers with 5 bits is: from -32 to +31
Combination formula = 2N Range formula = 2N -1 Where N is the number of Bits MR NOEL ATTARD
PAGE: 21
COMPUTER STUDIES NOTES
BITS & BYTES TABLE:
1 bit = one on or off position 1 byte = 8 bits 1024 Byte = 1 Kilo Byte 1024 KB = 1 Mega Byte 1024 Mb = 1 Giga byte 1024 Gb = 1 Terra byte
Representing characters in Digital Form: A character is one of a set of symbols which can be represented in a computer such as a number, letter, space or punctuation mark. Two other types of character are â&#x20AC;˘
Graphics characters - shapes can be used to build up pictures and graphs
â&#x20AC;˘
Control characters - characters which send signals to control operating functions rather than data, e.g. instructing a printer to start on a new page.
MR NOEL ATTARD
PAGE: 22
COMPUTER STUDIES NOTES
Character codes are the binary patterns used to represent the character set. Some codes are specific to the manufacturer but there are a number of standard codes which help the exchange of data between systems. So All letters, numbers, and symbols are assigned code values of 1's and 0's. A number of different digital coding schemes are used by digital devices. Three common code sets are: ASCII EBCDIC Unicode
(used in UNIX and DOS/Windows-based computers) (for IBM System 390 main frames) (for Windows NT and recent browsers)
The ASCII code set uses 7 bits per character, allowing 128 different characters. This is enough for the alphabet in upper case and lower case, the symbols on a regular English typewriter, and some combinations reserved for internal use. An extended ASCII code set uses 8 bits per character, which adds another 128 possible characters. This larger code set allows for foreign languages symbols and several graphical symbols. ASCII has been superseded by other coding schemes in modern computing. It is still used for transferring plain text data between different programs or computers that use different coding schemes. ASCII â&#x20AC;&#x201C; AMERICAN STANDARD CODE OF INFORMATION INTERCHANGE Example: ASCII Code for C is 67 or 1000011
MR NOEL ATTARD
PAGE: 23
COMPUTER STUDIES NOTES
UNICODE uses 16 bits per character, so it takes twice the storage space that ASCII coding, for example, would take for the same characters. But Unicode can handle many more characters. The goal of Unicode is to represent every element used in every script for writing every language on the planet. In fact in version 3 of Unicode has 49,194 characters instead of the few hundred for ASCII and EBCDIC. All of the current major languages in the world can be written with Unicode, including their special punctuation and symbols for math and geometry.
PARITY BIT With all these 0's and 1's, it would be easy for the computer to make a mistake! Parity is a clever way to check for errors that might occur during processing. In an even parity system an extra bit (making a total of 9 bits) is assigned to be on or off so as to make the number of on bits even. So in our example above 10101100 there are 4 on bits (the four 1's). So the 9th bit, the parity bit, will be 0 since we already have an even number of on bits. In an odd parity system the number of on bits would have to be odd. For our example number 10101100, there are 4 on bits (the 1's), so the parity bit is set to on, that is 1, to make a total of 5 on bits, an odd number. If the number of on bits is wrong, an error has occurred. You won't know which digit or digits are wrong, but the computer will at least know that a mistake occurred. Memory chips that store your data can be parity chips or non-parity chips. Mixing them together can cause odd failures that are hard to track down.
MR NOEL ATTARD
PAGE: 24
COMPUTER STUDIES NOTES
9. THE NUMBERING SYSTEM Human beings have generally settled on ten as the number to count with. No doubt it has something to do with the number of counting tools available (fingers, which is!). There is nothing magic about ten, however, that makes it the best choice (except for those who count with those handy, dandy fingers). Some cultures have indeed used other numbers to count with. Babylon apparently used sixty, a hexadecimal numbering system, which has some calculating advantages since it divides evenly by two, three, four, five, six, ten, twelve, fifteen, twenty, and thirty. The simplest way of writing numbers is to make one mark for each thing counted. Note that our usual way of marking four vertical strokes and then a crossing stroke forms groups of five. Five fingers on one hand. Any connection, do you think?? Once the number of cattle you own exceeds the number of fingers you have, it becomes clear that you need a short way of writing large numbers. Our modern system uses the position of a number symbol to indicate its real value. So our cattle ranchers don't have to scratch out several feet of little marks to write down the number of cows they have.
DECIMAL - BASE 10 NUMBERING SYSTEM: The decimal numeral system (also called base ten or occasionally denary) has ten as its base. It is the numerical base most widely used by modern civilizations. Decimal system is a way of writing numbers. Any number, from huge quantities to tiny fractions, can be written in the decimal system using only the ten basic symbols 1, 2, 3, 4, 5, 6, 7, 8, 9, and 0. The value of any of these symbols dep ends on the place it occupies in the number. The symbol 2, for example, has totally different values in the
MR NOEL ATTARD
PAGE: 25
COMPUTER STUDIES NOTES
numbers 832 and 238, because the 2 is in different places in each of the numbers.
Base 10 thousand =
10 x 10 x 10=
103
Because the value of a symbol depends on where it is placed within a number, the decimal system is known as a place-value system.
102
The word decimal comes from decem, the Latin word for ten. The decimal system 1 received its name because it is a base-ten ten = 10= 10 system. The value of each place is ten one = 1= 100 times greater than the va lue of the place just to its right. Thus, the symbols on the left of a number have larger values than symbols farther to the right. For example, the symbol 2 in 238 is worth much more than the symbol 2 in 832, because the 2 in 238 is farther to the left than is the 2 in 832. Each digit is multiplied by a power of 10 to get the complete number. We can use this same kind of notation with any base. We just need to know what the base is and what the symbols are for the numbers smaller than the base. a hundred =
10 x 10=
BINARY - BASE 2 NUMBERING SYSTEM: We can use this same kind of notation with any base. We just need to know what the base is and what the symbols are for the numbers smaller than the base. Computers don't have ten fingers to count with. All they have is on and off. Everything inside a computer must be represented with some combination of on and off. We humans use the digits 1 for on and 0 for off. We call this base 2 since there are only 2 symbols used. Everywhere, except for computer-related operations, the main system of mathematical notation today is the decimal system, which is a base10 system. As in other number systems, the position of a symbol in a base-10 number denotes the value of that symbol in terms of exponential values of the base. That is, in the decimal system, the
MR NOEL ATTARD
PAGE: 26
COMPUTER STUDIES NOTES
quantity represented by any of the ten symbols used - 0,
100101101 in Base 2 8
= in base 10
1x2 =
1 x 256
256
0 x 27 =
0 x 128
0
0 x 64
0
6
0x2 =
1, 2, 3, 4, 5, 6, 7, 8, and 9 depends on its position in the number.
Unlike the decimal system, only two digits - 0, 1 - suffice to 0 x 24 = 0 x 16 0 represent a number in the binary 1 x 23 = 1x8 8 system. The binary system plays 1 x 22 = 1x4 4 a crucial role in computer science 1 and technology. The first 20 0x2 = 0x2 0 0 numbers in the binary notation 1x2 = 1x1 1 are 1, 10, 11, 100, 101, 110, Total = 301 111, 1000, 1001, 1010, 1011, in base 10 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, the origin of which may be better understood if they are re-written in the following way: 5
1x2 =
1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
1 x 32
00001 00010 00011 00100 00101 00110 00111 01000 01001 01010
32
11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
01011 01100 01101 01110 01111 10000 10001 10010 10011 10100
A sequence of on off on off on off on is written for the benefit of humans as 100101101. This is only a little bit better but it takes less energy to write down. Such base 2 numbers are called binary numbers. Now the number 100101101 in base 2 uses the same symbols as 100,101,101 in base ten. But the base 10 number is equal to one hundred million one hundred and one thousand one hundred and one. This is a much larger number than the base 2 number. The 1s and 0s must be multiplied by powers of 2 to see how many cows this number represents. MR NOEL ATTARD
PAGE: 27
COMPUTER STUDIES NOTES
HEXADECIMAL - BASE 16 NUMBERING SYSTEM: Because people have a really hard time keeping straight numbers like those above, computer numbers are often written in yet another base - base 16. Such numbers are called hexadecimal. Hexadecimal numbers look really odd because they have more symbols than we are used to. Letters are used for the numbers from ten through fifteen:
Numbers: 0, 1 ,2, 3, 4, 5, 6, 7, 8, 9 Letters:
A = 10; B = 11; C = 12; D = 13; E = 14; F = 15.
To interpret such numbers as base 10 numbers, (for those of us who just can't quit counting on our fingers!) you need to know the powers of 16. 163 162 161 160
= = = =
4096 256 16 1
So the number F29 in base 16 is equal to: (F x 162)+ (2 x 161) + (9 x 160) = 15 x 256 = 3840 2 x 16 = 32 9x1 = 9 3881 in base 10
This is certainly not all that easy to do. Few people can multiply 15 by powers of 16 easily. But the really advantage for base 16 is in how
MR NOEL ATTARD
PAGE: 28
COMPUTER STUDIES NOTES
easy it is to change from base 2 to base 16 and back. Every hexadecimal digit is broken down into a 4 digit binary number. These digits are just written down in the same order as the hexadecimal number and you've got the equivalent binary (base 2) number. For our number F29: F is equal to 15 which is 8 + 4 + 2 + 1. (These are the powers of 2). That means that F = (1 x 23) + (1 x 22) + (1 x 21) + (1 x 20). So F16 = 11112 Since 216 is (1 x 21), then 216 = 00102 Since 916 is (1 x 23) + (1 x 20), then 916 = 10012 Putting this together makes F2916 = 1111001010012.
MR NOEL ATTARD
PAGE: 29
COMPUTER STUDIES NOTES
10. LOGIC GATES AND TRUTH TABLES A logic gate is an elementary building block of a digital circuit . Most logic gates have two inputs and one output. At any given moment, every terminal is in one of the two binary conditions low (0) or high (1), represented by different voltage levels. The logic state of a terminal can, and generally does, change often, as the circuit processes data. In most logic gates, the low state is approximately zero volts (0 V), while the high state is approximately five volts positive (+5 V). There are THREE basic logic gates: AND, OR, NOT, The combination of these THREE basic logic gates can produce: XOR ,NAND, NOR, and XNOR
The AND Gate is so named because, if 0 is called "false" and 1 is called "true," the gate acts in the same way as the logical "and" operator. The following illustration and table show the circuit symbol and logic combinations for an AND gate. (In the symbol, the input terminals are at left and the output terminal is at right.) The output is "true" when both inputs are "true." Otherwise, the output is "false."
The OR Gate gets its name from the fact that it behaves after the fashion of the logical inclusive "or." The output is "true" if either or both of the inputs are "true." If both inputs are "false," then the output is "false."
MR NOEL ATTARD
Input 1 Input 2 Output
0
0
0
0
1
0
1
0
0
1
1
1
Input 1 Input 2 Output
0
0
0
0
1
1
1
0
1
1
1
1
PAGE: 30
COMPUTER STUDIES NOTES
A logical inverter , sometimes called a NOT gate to differentiate it from other types of electronic inverter devices, has only one input. It reverses the logic state.
Input
Output
1
0
0
1
BOOLEAN EXPRESSION OF A LOGICAL CIRCUIT •
+
Means an OR Gate
– (A + B) = A OR B
•
.
Means an AND Gate
- (A . B) = A AND B
•
.
Means the NOT Gate -
MR NOEL ATTARD
A= NOT A
PAGE: 31
COMPUTER STUDIES NOTES
THE IS A SAMPLE OF A LOGIC CIRCUIT AND BOOLEAN EXPRESSION
Data and control instructions move inside a computer by means of pulses of electricity. Certain components of computer combine these pulses as if they were following a set of rules. The components are called Logic elements. Computer logic is the combination of inputs and outputs produced by logic elements. Like most computer components, logic elements are bistable ( ON / OFF switches - 1 or 0 ) devices. Logic Hardware: The processing of data is done by lots of complex electrical circuits in the CPU of the computer. The hardware devices which do this are transistors or integrated circuits. Integrated Circuits These are also known as chips and are small circuits consisting of a number of transistors. Large-scale integrated (LSI) circuits and very large-scale integrated (VLSI) circuit represent thousands of transistors on a chip. Advances in chip-making technology have allowed this miniaturization.
MR NOEL ATTARD
PAGE: 32
COMPUTER STUDIES NOTES
Gates inside the computer : The commonest use of logic elements is to act as switches, although they have no moving parts. They open to pass on a pulse of electricity or close to shut it off. This is why they are known as gates. As we said before there are three types of gates, i.e., AND, OR, NOT, which can be described diagrammatically by truth tables or by expressions (often called Boolean expressions, after their creator George Boole ).
MR NOEL ATTARD
PAGE: 33
COMPUTER STUDIES NOTES
11 THE MEMORY Storage of data and programs is one of the most important features of an information processing system. This is done: Temporarily while a program is running. This is stored in main store. Long-term to preserve programs and data while not in use. This is called backing store. Note: Memory is another term used for storage. Computer memory is one of the most expensive components that make up a computer. This memory known as central memory or primary storage is divided into two: â&#x20AC;˘ â&#x20AC;˘
Read Only Memory. Random Access Memory.
Read Only Memory (ROM) - a memory device in the form of a collection of integrated circuits (chips), frequently used in computers.
ROM chips are loaded
with data and programs during manufacture and can only be read by computer. However, the contents of the chips are not lost when the power is switched off (non-volatile). If ROM was volatile it would lose its data and it would not be possible to write it back. ROM is used to form a computer's permanent
store
of
vital
information, or of programs that must be readily available but protected from accidental or deliberate change by the user.
Frequently used programs
essential to the normal running of the computer are stored in ROM.
These
usually include a small program, the bootstrap loader, which runs when the computer is switched on to get it started.
MR NOEL ATTARD
PAGE: 34
COMPUTER STUDIES NOTES
Random Access Memory (RAM) - a memory device in the form of a collection of integrated circuits (chips), frequently used in computers. RAM chips can be both read from and written to by the computer, but their contents are lost when the power is switched off. Such memory is called volatile memory. For example RAM is used to store: o
The program which is running and the data it is using,
o Data being transferred to and from peripherals, o The contents of the screen.
MAIN DISTINCTIONS BETWEEN ROM AND RAM ROM Can only be read by computer
RAM Can be both read from and written to by the computer
The contents of the chips are not lost when the power is
Contents are lost when the power is switched off (volatile)
switched off (non-volatile)
Other applications of ROM and RAM outside the CPU In a printer some RAM is needed to store the next set of data to be printed. Some ROM is needed to store programs to direct the printer how to print the data and to keep record of the different printing fonts. In a modern washing machine, the processor needs ROM to permanently store the control program and RAM to store temporary data created by the program.
MR NOEL ATTARD
PAGE: 35
COMPUTER STUDIES NOTES
12. THE BACKING SORTAGE Uses of Main Memory and Backing Store
The main store is needed: To store the program currently being executed To hold data produced as the program is run To hold other data such as the contents of the screen. The backing store is needed: For long-term storage of data and programs For data and programs where there is not enough room in the main store. Storage Media And Storage Drives
A storage medium is the material on which the data is stored e.g. magnetic tape, floppy disc, CD-ROM.
A
storage
is
medium
exchangeable if it can be removed from the drive and replaced by another one of the same type.
A storage drive is the piece of equipment, which rotates the storage medium and accesses the data on it.
MR NOEL ATTARD
PAGE: 36
COMPUTER STUDIES NOTES
Characteristics of Backing store Data is usually accessed using read/write heads. These transfer the data while the medium rotates in the drive Access to backing store is slower that to main store They are non-volatile. The data is stored on the medium until it is deleted.
Types of Backing Store Media
MAGNETIC MEDIA Magnetic Tape - narrow plastic ribbon coated with an easily magnetisable material on which data can be recorded. It is used in sound recording, audiovisual systems (videotape), and computing. Magnetic tape was first used to record computer data and programs in 1951. It was very popular as a storage medium for external memory in the 1950s and 1960s. Since then magnetic discs have largely replaced it as a working medium, although tape is still used to make backup
copies
of
important
data.
Information is recorded on the tape in binary form, with two different strengths of signal representing 1 and 0. It is common for 20000 bits of information to be recorded on each centimeter of tape. Magnetic tape has serial access - an item can only be accessed by
MR NOEL ATTARD
PAGE: 37
COMPUTER STUDIES NOTES
working through all the items before it. The device that reads the tape is the Tape Drive or Tape Unit.
ADVANTAGES
DISADVANTAGES
Speed - very fast
A record on magnetic tape cannot be updated in place. Records to be updated have to be read, updated and then written to a second tape Tape must be stored in a suitable environment where humidity, temperature and dust are tightly controlled; otherwise read errors occur. Tape has a limited shelf life (about 2 years) for reliable results and is therefore not suitable for long-term storage of history files.
Capacity - high volume of 10 million characters Cost - it is cheap and convenient.
Magnetic Disc - A typical magnetic disk has two surfaces or sides. Each surface holds data in circular tracks and each track is divided into equal sections called sectors. The track number and sector number are used as an address to find where data is on the disc. Data can be both written to and read from the disc.
Magnetic
disks are direct access i.e. any data item can be accessed without reading other data first.
ADVANTAGES
DISADVANTAGES
Currently the most popular
More expensive than tape drives and tapes
storage method in business Very high capacity storage at low cost
Can be susceptible to dust, static electricity, head crashes etc.
Disc packs are convenient to handle and store.
MR NOEL ATTARD
PAGE: 38
COMPUTER STUDIES NOTES
Hard Disk: The hard disk is usually fixed in the drive. Each is built into a sealed unit to prevent contamination by dust and moisture. Access to data is far faster than access to floppy discs. Hard disks store far more data than
floppy
discs.
They are more reliable then floppy discs - there is better protection against dirt. Hard discs are used to store the operating system, application software and users' files.
Floppy Disc: access to data is much slower than for hard disc. The discs are exchangeable and easy to transport. A stiff plastic cover protects the disc. This has a whole for the read/write heads which is protected by a sprung metal cover. The data on the disc can be protected by sliding a small writeprotect tab which prevents the contents of the disc from being changed.
Floppy discs are light and portable.
They are direct access and data can be written to magnetic discs.
OPTICAL MEDIA An optical disk is a storage medium in which laser technology is used to record and read large volumes of digital data. Compact Disk Read Only Memory (CD-ROM): a computer storage device developed from the technology of the audiotape compact disk. It consists of a plastic-coated metal disc normally about 12 cm in diameter. Data is written to the disk using a powerful laser beam to burn patterns in the surface. Data is read back using a relatively low-power laser to detect the patterns in the surface. The discs are exchangeable and easy to transport.
MR NOEL ATTARD
PAGE: 39
COMPUTER STUDIES NOTES
Access to data is faster than access to floppy disks but slower than hard discs. CD-ROMs typically hold up to 700 megabytes of data, and are used in distributing large amounts of text and graphics, such as encyclopedias, catalogues, and technical manuals. Usually data is written on to the disc before it is sold. After that data can be read from the disc but not written to it. It can store 700 Mb of data. Digital Versatile Disc (DVD): DVD, also known as Digital Versatile Disc or Digital Video Disc, is an optical disc storage media format, and was invented in 1995. Its main uses are video and data storage. DVDs are of the same dimensions as compact discs (CDs), but store more than six times as much data. It can store about 30 Gbyte of data. Blu-ray Disc (BD): It is sometimes called "Blu-ray," is an optical disc storage medium designed to supersede the standard DVD format. Its main uses are for storing highdefinition video, PlayStation 3 video games, and other data, with up to 25 GB per single layered, and 50 GB per dual layered disc. The disc has the same physical dimensions as standard DVDs and CDs.
ELECTRICAL STORAGE MEDIA An electrical media storage device is a chip where data can be stored. Nowadays they are used in various usage due to there capacity and size. In fact they are very portable, and can hold large amount of data. They are used in video games, digital camera. Examples of electrical storage media are: • Pen drives • SD Cards • Memory Sticks
MR NOEL ATTARD
PAGE: 40
COMPUTER STUDIES NOTES
13. SERIAL ACCESS VS RANDOM ACCESS: Imagine we have a thousand records stored on a secondary storage device and we wish to access the 543 records. In serial access we would have to access the preceding 542 records before homing in on to our required record. On the other hand in random access we are given the possibility to go directly to the particular record we require. SERIAL ACCESS / SEQUENTAIL ACCESS – (MAGNETIC TAPE): Data is stored on tape in binary coded decimal format. A tape is made up of horizontally running tracks and vertical frames. When a file is stored to tape, the program is divided into: A file header Number of blocks A trailer In addition as a means of security parity checking is used. This is a means to check tape data integrity. Horizontal parity utilizes a tape track for checking whilst vertical parity uses a frame for parity checking. Both can coexist for optimum integrity and error correction. There are two types of parity systems odd and even parity. In even parity the tape drive ensures that both horizontally and vertically there is an even number of 1’s similarly for odd parity. DIRECT ACCESS – (ALL DISKS): Formatting a floppy disk or hard disk means preparing the medium to receive data. Mostly when a new hard disk is bought the surface area is free and not organized. In order to start writing data onto a disk we must format it to prepare the area into chunks where the data is stored. Formatting prepares the disk into round concentric circle called tracks. Tracks are then subdivided into smaller pieces to form sectors. Hard disks are not readily portable becoming cheaper, rewritable, typical storages nowadays at around 1 Tbyte. Magnetic medium is shining silvery metal and hard., since hard disks are getting larger and important factor to look at when buying a new hard disk is its access time.
MR NOEL ATTARD
PAGE: 41
COMPUTER STUDIES NOTES
THE DISK FILING SYSTEM: DISK MAP: A memory map describes the way storage is organised in a computer. The memory map for disk storage is called a disk map. A disk map describes how the information held on disk is organised, and is kept on disk. It may be held as a bit map i.e. a pattern of bits describing the organisation of data. For example, the arrangement of data on a disk might be represented to the operating system as a bit map in which each bit represents one sector on a disk: a ‘1’ for sectors in use, a ‘0’ for unused sectors. A graphical screen prepared in a painting/drawing package may be held as a bit map with each bit relating to the setting of an individual pixel on the screen. FAT: To retrieve files stored on magnetic disks, an operating system maintains a list of the sectors assigned to each file. This list is stored in a table called a File Allocation Table (FAT). The FAT is a file on each disk i.e. it is also kept on the backing store. ACCESS TIME: Access time is the time between the computer’s request for data from secondary storage and the completion of the data transfer. It is basically the time taken for a hard disk to seek data and is measured in milliseconds (1/1000th of a second). If you have a hard disk with an access time of 10ms, a file of 10Mb will take less time to be found than another hard disk with an access time of 12ms. Typical access time (time to seek data) is between 9ms and 12ms. The lower the access time, the more costly a device is. Access time for most disk drives is, in fact under 25 milliseconds.
MR NOEL ATTARD
PAGE: 42