Beruflich Dokumente
Kultur Dokumente
Data representation
Data
1-Numeric data – numbers (integer, real)
2-Non-numeric data - symbols, letters
1-Number System
*Non positional number system like Roman number system
*Positional number system
- Each digit position has a value called a weight associated with it like Decimal,
Octal, Hexadecimal, Binary systems
- Example AR = an-1 an-2 ... a1 a0 .a-1…a-m
Point (.) separates the integer portion and the fractional portion
Representation of numbers
1
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
1-To convert integer decimal number to base (R) number we take the number
modulate (R) to calculate the first digit then divided the number by (R) and repeat
the above steps until the number become zero
Example:-
Convert (124) to binary, Octal, and Hexadecimal numbers
2
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
2- To convert fraction decimal number to base (R) number we take the number
multiplying (R) to calculate the first integer digit and repeat the above step until
the number become zero
Example:-
Convert (0.125) to binary, Octal, and Hexadecimal numbers
number N * 2 digits
0.125 0.25 0
0.25 0.5 0
0.5 1 1
3
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
0
0.125)10 = 0.001)2
number N * 8 digits
0.125 1 1
0
0.125)10 = 0.1)8
number N * 16 digits
0.125 2 2
0
0.125)10 = 0.2)16
In Octal conversion we divided the binary number to groups with three digits as
below
1111100 = 1 111 100 = 1 7 4
In Hexadecimal conversion we divided the binary number to groups with four
digits as below
1111100 = 111 1100 = 7 C
Unsigned numbers
Binary Addition
_ Start with the least significant bit (rightmost bit)
_ Add each pair of bits
_ Include the carry in the addition, if present
4
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Octal Addition
34567
64377
121166
Hexadecimal Addition
36 28 28 6A
42 45 58 4B
78 6D 80 B5
Signed numbers
5
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Binary Subtraction
6
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Hexadecimal Subtraction
Characters representation
The American standard code for information interchange (ASCII) maps a set of
128 characters into the set of integers from 0 to 127 , requiring 7 bits for each
numeric code where 95 of the characters are printable and are mapped into the
codes 32 to 126 the reminder are special control codes(WRU, RU, tab, line feed,
…….) the decimal digits (0) to (9) are assigned sequential codes, the upper case
characters (A) through (Z) are also assigned sequential codes as are the lower-
case characters (a) through (z) as shown in figure below
7
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Parity Bit
0(p) 1 0 0 0 0 0 1
Odd Parity: The 8th bit is set such that the total number of 1s in the 8-bit code
word is odd.
1(p) 1 0 0 0 0 1 1
8
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Floating Point
Binary numbers can also have decimal points, and to show you how,we will once
again begin with decimal numbers. For decimal numbers with decimal points, the
standard way to represent the digits to the right of the decimal point is to continue
the powers of ten in descending order starting with -1 where 10-1=1/10th = 0.1.
That means that the number 6.5342 has 5 increments of 10 -1 (tenths), 3
increments of 10-2 (hundredths), 4 increments of 10-3 (thousandths), and 2
increments of 10-4 (ten-thousandths). The table below shows this graphically.
Exponent 3 2 1 0 -1 -2 -3 -4
Position value 1000 100 10 1 0.1 0.01 0.001 0.0001
Sample values 0 0 0 6 5 3 4 2
Exponent 2 1 0 -1 -2 -3 -4 -5
Position value 4 2 1 0.5 0.25 0.125 0.0625 0.03125
Sample values 0 1 0 0 1 1 0 1
Therefore, our example has the decimal value
0*4 + 1*2 + 0*1+0*0.5 + 1*0.25 + 1*0.125 + 0*0.0625 + 1*0.03125 = 2.40625.
9
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
This means that the method of conversion is the same for real numbers as it is for
integer values; we've simply added positions representing negative powers of
two.
Computers, however, use a form of binary more like scientific notation to
represent floating-point or real numbers. For example, with scientific notation we
can represent the large value 342,370,000 as 3.4237 x 108. This representation
consists of a decimal component or mantissa of 3.4237 with an exponent of 8.
Both the mantissa and the exponent are signed values allowing for negative
numbers and for negative exponents respectively.
Binary works the same way using 1's and 0's for the digits of the mantissa and
exponent and using 2 as the multiplier that moves the decimal point left or right.
For example, the binary number 100101101.010110 would be represented as:
1.00101101010110 * 28
The decimal point is moved left for negative exponents of two and right
for positive exponents of two.
The IEEE Standard 754 is used to represent real numbers on the majority of
contemporary computer systems. It utilizes a 32-bit pattern to represent single-
precision numbers and a 64-bit pattern to represent double-precision numbers.
Each of these bit patterns is divided into three parts, each part representing a
different component of the real number being stored. Figure below shows this
partitioning for both single and double-precision numbers.
11
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Both formats work the same differing only by the number of bits used to
represent each component of the real number. In general, the components of the
single-precision format are substituted into Equation 1 where the sign of the value
is determined by the sign bit (0 –positive value, 1 – negative value). Note that E is
in unsigned binary representation.
Example
11
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Convert the 32-bit single-precision IEEE Standard 754 number shown below into
its binary equivalent.
11010110101101101011000000000000
Solution
The number is positive, so the sign bit will be 0. The fraction (value after the
decimal point and not including the leading 1) is 10110100101 with 12 zeros
added to the end to make it 23 bits. Lastly, the exponent must satisfy the
equation:
E – 127 = –7
E = –7 + 127 = 120
Converting 12010 to binary gives us the 8-bit unsigned binary value 011110002.
Substituting all of these components into the IEEE 754format gives us:
Information System
It processes the inputs and produces outputs that are sent to the user or other
system. Feedback mechanism that controls the operation may be included. Like
any other system, an information system operates within an environment.
13
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Data:
Examples of data would include grade point averages, bank balances, or the
number of hours employees worked in a pay period.
Information:
Knowledge:
14
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
3- Output operation: the information which has been processed from the data is
produced in form usable by people. Examples of output are printed text, sound,
and charts and graphs displayed on computer screen.
Computer
Is programmable, multiuse that accepts data- raw facts and figures and
processes, or manipulates, it into information that can use, such as summaries or
totals. Its purpose is to speed up problem solving and increase productivity.
15
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Digital computer
16
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Computer system
ii- the memory of a computer for saving instructions and data. It is called a
random access memory (RAM) because the CPU can access any location in
memory at random and retrieve the binary information within a fixed interval of
time.
17
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
(RAM)
(CPU)
2- Software: the software of the computer consists of the instructions and data
that the computer manipulates to perform various data processing tasks. A
sequence of instructions is called a program.
18
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
• System software helps run the computer hardware and computer system. It
includes operating systems, device drivers, diagnostic tools, servers, windowing
systems, utilities and more. The purpose of systems software is to insulate the
applications programmer as much as possible from the details of the particular
computer complex being used, especially memory and other hardware features,
and such accessory devices as communications, printers, readers, displays,
keyboards, etc.
• Application software allows end users to accomplish one or more specific (non-
computer related) tasks. Typical applications include industrial automation,
business software, educational software, medical software, databases, and
computer games. Businesses are probably the biggest users of application
software, but almost every field of human activity now uses some form of
application software. It is used to automate all sorts of functions.
• The "system unit" is the name given to the main PC box which houses the
various elements which go together to make up the PC. For instance within the
system unit is the computer system's motherboard, which contains all the main
components, such as the CPU. The system unit also houses items such as the hard
disk, the floppy disk and CD-ROM drives etc.
19
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
• The system (mother) board is contained within your system unit and all the vital
computer systems plug directly into the system board. The CPU is normally
housed on your system board along with all the other electronic components.
Other items such as the hard disk are attached to the system board, either directly
or via cables. These boards are getting smaller and smaller as the components
become more integrated.
3-The CPU
21
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
4-Memory (RAM)
The RAM (Random Access Memory) within your computer is where the
operating system is loaded to when you switch on your computer and also where
your applications are copied to when you start an application, such as a word
processor or database program. When you create data, (e.g. letters and pictures),
these are initially created and held in RAM and then copied to disk when you
save the data. As a rule of thumb, the more RAM you have installed in your
computer the better.
5-ROM-BIOS
The ROM-BIOS (Read Only Memory - Basic Input Output System) chip is a
special chip held on your computer's system (mother) board. It contains software
which is required to make your computer work with your operating system, for
instance it is responsible for copying your operating system into RAM when you
switch on your computer.
6-Serial Port
The serial port is a socket located at the back of your computer which
enables you to connect items to the computer, such as a modem. They are
commonly labeled as COM1 or COM2.
21
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
7- Parallel Port
• The parallel port is a socket located at the back of your computer which enables
you to connect items to the computer, such as a printer. It is commonly labelled
as LPT1 or LPT2.
• The Universal Serial Bus is a relatively new item within the PC. You will see
one or more USB sockets at the back of the system unit, allowing you to plug in
devices designed for the USB. These devices include printers, scanners and
digital cameras.
Programming languages
Programming languages provide the basic building blocks for all systems
and application software. Programming languages allow people to tell computers
what to do and are the means by which software systems are developed, we will
describe the five generations-levels-of programming languages:
22
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
1) Machine language
These user oriented languages make it much easier for people to program.
But they are impossible for the computer to execute without first translating
the program into machine language.
2) Assembly language
23
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
locations in primary storage by using mnemonics, which people can more easily
use.
3) Procedural language
• Procedural language are much closer to natural language (the way we talk) and
therefore, are easier to write, read.
4) Nonprocedural languages
• They can be used by non technical users to carry out specific functional tasks.
5) Natural languages
24
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
• Most of these languages are still experimental because the programs that are
translate natural language into machine – readable form are extremely complex
and require a large amount of computer resources.
Secondary Storage
1-it is nonvolatile
2-it takes much more time to retrieve data from secondary storage than it does
from RAM
4-it can take place on a variety of media each with its own technology, as is
cussed below:
a) Magnetic tape
b) Magnetic disc
d) Optical disc
Disks
25
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
4. Each disk surface is divided into a number of concentric tracks (typically 200).
5. Disks are placed on pack and each pack may have 6 or 11 disks and is used as a
single unit.
6. The latest models of disk packs can store many hundreds of megabytes of data
(i.e. hundreds of millions of characters).
1- Seek Time: A seeks time is the movement of the read\write head to the desired
track. The seek time is the average time for this operation to be performed.
Typically, hard disk drives have an average seek time of several milliseconds,
depending on the particular drive.
2- Latency Time: The latency period is the time takes for the desired sector to
spin under the head once the head is positioned over the desired track. Latency
time depend on the constant rotational speed of the disk.
• The sums of average seek time and the average latency time is the access time
for the disk drive.
26
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Floppy
5-storing capacity of 3 1/2 inch disks is 1.44 megabytes i.e. one million four
hundred thousand characters.
CD-Rom
2- Data is written into the disk by burning a permanent pattern into the surface of
the disk by means of high precision laser beam.
27
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
3-data is read by using the laser at lower intensity and detecting the pattern
reflected from its beam by the surface of the disk there are many types of optical
disks:
It has become popular for recorded music as well as information (such as books)
a variant is the digital video disk (DVD), used for movies.
Computer Architecture
• Most computers have similar architectures that combine software and hardware.
1-Hardware
• The term hardware refers to the physical components of your computer such as
the system unit, mouse, keyboard, monitor, processors, memory and peripheral
devices etc...
2-Software
• The software is the collection of instructions which makes the computer work.
For instance, when you type in words via the keyboard, the software is
responsible for displaying the correct letters, in the correct place on the screen.
Software is held either on your computer’s hard disk, CD-ROM, DVD or on a
28
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
diskette (floppy disk) and is loaded (i.e. copied) from the disk into the computers
RAM (Random Access Memory), as and when required.
Software includes the operating system which controls the computer hardware
and application software, such as word processing, spreadsheets, etc…
1-Hardware
A-CPU (Processor)
B- Buses
C-Memory
D-Input Unit
E-Output Unit
A-Processor Architecture
The central processing unit (CPU) perform the actual computation inside
any computer, the CPU is a microprocessor for example, Pentium ΙΙΙ) made up of
29
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
3-Registers: which store very small amount of data and instructions for short
period of time.
4- Buses
Control Unit
-Direct and coordinates all units of the computer to execute program steps.
4- the control unit has a special feature known as the interrupt (it will tell the CPU
to put aside one operation and to instead begin work on another operation).
31
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
The control unit carries out the instructions in four basic operations known as the
machine cycle which consists of
1- Fetches an instruction.
2- Decodes the instruction.
3- Executes the instruction.
4- Stores the results.
ALU
Is the part of the central processing that performing the actual computing. The
ALU Perform the processing of data including arithmetic operations such as
addition, subtraction, multiplication, division and logic operation including
sorting and comparison (like A<B), this operation is useful because the ALU
could have instructions saying "perform this operation if these two numbers are
equal, but perform another operation if the first number is greater than the
second".
Registers
31
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
4- Accumulator it is register that holds the data to be used in arithmetic and logic
operations.
5-(B, C, D, E, F, H, and L) registers: these registers contain the data for executing
the operations.
Registers in different parts of the CPU are used for different functions. In the
control unit , the registers are used to store the current instruction and the
operands while the registers found in the ALU called accumulators, are used to
store the results of the arithmetic or logical operations.
1- The instructions for the CPU originate in software. They are usually stored in
floppy disks, hard disks, or CD-ROMs.
3- The control unit fetches the instructions and brings them to the CPU.
4- The instructions are stored in special registers in the CPU, and the program
counter increments, allowing the instructions to be sequentially performed.
5- When the CPU is ready, the instructions coming next in the sequence are sent
to the instruction decoder, it is determined what exactly the instructions say and
what the computer must do.
6- The address bus and data bus now come into use. The address bus will send the
address of the data that the CPU needs to the memory, and then the data bus will
retrieve the data found at that address.
7- The instructions are carried out in the ALU, where the computations are made.
32
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
8- After the results of operations are calculated, they are temporarily stored in
registers in the CPU for quick and easy access.
Buses or bus lines are electrical data roadways through which bits are
transmitted within the CPU and between the CPU and other components of the
motherboard. A bus resembles a multilane highway: the more lanes it has, the
faster bits transferred. The old fashion (8-bits word) bus of early microprocessors
had only eight pathways. Data is transmitted four times faster in a computer with
a 32 bit bus ,which has 32 pathways, than in a computer with an 8-bit bus.
For example Macintosh G4 microcomputers contain buses that are 128 bits.
The various components of the CPU are connected together with lines called
internal lines (internal bus). The lines connected the CPU to the reminder of the
computer components are called external lines (external buses). A computer main
memory is interfaced to the CPU through three groups of lines or buses: data bus,
address bus, control bus.
C-Memory
Memories are one of the most important parts of a computer system. The
term memory refers to any device that can be used for storage. There are three
basic ways to store memory. One way is to store the memory within the actual
circuitry of the computer (main memory), which allows for it to be quickly
accessed by the CPU. These memory devices are generally used for temporary
storage of data and programs that are currently used by the CPU. The second type
of memory storage is to store the memory in external storage devices (secondary
memory). They include hard drives(disks), floppy disks, and CD-ROM. Programs
and information that you are not currently using can be permanently stored on
33
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
these devices. The third type of memory is cache memory which serves as
intermediate temporary storage unit logically positioned between the processor
registers and main memory The term "memory" usually pertains to the devices
stored within the circuitry of the computer. They are temporary, meaning that
when the computer is turned off, they will be deleted. These devices are
connected directly to the CPU and are pretty fast.
Secondary memory
(magnetic tapes,
I/O processor Main memory
magnetic disk,…..)
In addition, most current computer operating systems allow for the use of virtual
memory, that is some free hard disk space is used to extend the capacity of RAM.
34
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Primary storage
RAM chips
The RAM (Random Access Memory) within your computer is where the
operating system is loaded to when you switch on your computer and also where
your applications are copied to when you start an application, they temporarily
hold (1) software instructions and (2)data after and before processed by the CPU.
Because its contents are temporary, RAM is said to be volatile (the contents are
lost when the power is turned off). There are three types of RAM used in personal
computers:
3-Static RAM (SRAM) it is the faster and will retain its contents without having
to be refreshed by the CPU.
If you are short on memory capacity, you can usually add more chips by plugging
them into expansion slots on the motherboard.
35
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
ROM chips
The ROM-BIOS (Read Only Memory - Basic Input Output System) chip is a
special chip held on your computer's system (mother) board. It used to store fixed
start up instructions: unlike RAM the ROM cannot be written on or erased by the
computer user without special equipment.ROM chips are loaded at the factory
with programs containing special instructions for basic computer operations, such
as those that start the computer or put characters on the screen. These chips are
nonvolatile (their contents are not lost when power is turned off). A special kind
of ROM (programmable read only memory (PROM)) allows user to load
programs and data but this can done only once.
Note: in computer technology, read means to transfer data from input source to
the computer memory or CPU, while the write means to transfer data from CPU
or memory to output devices. Thus with ROM chip the CPU can retrieve
programs from the ROM chip but cannot modify or add to those programs.
36
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Store flexible start up instructions and powered by a battery and thus do not
lose their contents when the power is turned off. CMOS chips contain flexible
start up instructions like time, date, and calendar. Unlike ROM chip the CMOS
chip can be reprogrammed to change time as example.
Flash memory
This chip store flexible programs and nonvolatile form of memory but it can
be erased and reprogrammed more than once. It capacity ranged from (1 to 4000
megabytes). It used to store programs not only in personal computer but also in
cell phone, printers, and digital camera.
Cache memory
Input devices
Input devices allow you to input information to the computer and include
things such as the keyboard and mouse.
Output devices
Output devices allow you to output information from the computer and
include the printer and the monitor.
37
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Peripheral devices
A peripheral device is any device which you can attach to your computer.
Thus, you could attach a scanner or modem to the back of your system unit.
D-Input devices
Keyboard
Is the most common input device the keyboard is designed like a typewriter
but with additional function keys. It is what you use to type in letter numbers and
other characters.
Touch screen
Is a technology that divides the computer screen into different areas. Users
simply touch the desired area (often buttons or squares) to trigger an action.
Mouse
38
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Scanners
A scanner allows you to scan printed material and convert it into a file
format which may be used within the PC. You can scan pictures and then
manipulate these inside the PC using a graphics application of your choice. In
addition, you can scan printed text and convert this not just to a picture of the text
but also to, actual text which can be manipulated and edited as text within your
word-processor. There are a number of specialist programs, generically called
OCR (Optical Character Recognition) programs which are specifically designed
for converting printed text into editable text within your applications.
Digital camera
you can take pictures and digital cameras convert these pictures to digital form so
they can be used on the computer.
Output devices
Display
Are the video screens used with most computers that display input as well
as output like television sets, monitors come in a variety of sizes and
color/resolution quality .and like television sets, the common desktop monitor
uses cathode ray tube (CRT) technology to shoot beams of electrons to the screen.
The points on the screen known as pixels, the more pixels on the screen, the
better resolution.
39
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
1-portable computers use a flat screen that uses liquid crystal display (LCD)
technology not (CRT)
2-LCDs use less power than CRT monitors but cost six to eight times what an
equivalent CRT
Printer
1-impact printers:
Work like typewriters, using some kind of striking action, raised metal
character strikes an inked ribbon that makes a printed impression of the character
on the paper, these devices cannot produce high-resolution graphics, and they are
relatively slow, noisy, and subject to mechanical failure, although inexpensive,
they are becoming less popular.
Come in two styles laser printers. Are higher speed, high _quality devices
that uses laser beams to write information on photosensitive drums, laser printers
produce very high quality resolution text and graphics.
Inject printers: work differently, by shooting fine streams of colored ink onto
the paper. These are less expensive than laser printers, but offer less resolution
quality.
Translator
translation process, the compiler reports to its user the presence of errors in the
source program.
Assemblers
Interpreters
41
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Compilers
source language) in high level language and translates into an equivalent program
in machine language (the target language).
Linkers
A utility program that combines one or more files containing object code
from separately compiled program modules into a single file containing loadable
or executable code. the function of a linker is to take as input a collection of
object modules and produce a load module, consisting of an integrated set of
program and data modules, to be passed to the loader. In each object module,
there may be address references to locations in other modules. Each such
reference can only be expressed symbolically in an unlinked object module. The
linker creates a single load module that is the contiguous joining of all of the
object modules. Each intramodule reference must be changed from a symbolic
address to a reference to a location within the overall load module.
42
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
that perform these functions are called by various names, including linker, linking
loader, and linkage editor. The complete translation of a source program requires
two steps, as shown in Figure below:
The first step is performed by the compiler or assembler and the second one
is performed by the linker.
LINKAGE EDITOR:
The nature of this address linkage will depend on the type of load module to
be created and when the linkage occurs. If, as is usually the case, a relocatable
load module is desired, then linkage is usually done in the following fashion.
Each compiled or assembled object module is created with references relative to
43
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
the beginning of the object module. All of these modules are put together into a
single relocatable load module with all references relative to the origin of the load
module. This module can be used as input for relocatable loading or dynamic run-
time loading. A linker that produces a relocatable load module is often referred to
as a linkage editor.
DYNAMIC LINKER
For load-time dynamic linking, the following steps occur. The load module
(application module) to be loaded is read into memory. Any reference to an
external module (target module) causes the loader to find the target module, load
it, and alter the reference to a relative address in memory from the beginning of
the application module. There are several advantages to this approach over what
might be called static linking:
• Having target code in a dynamic link file paves the way for automatic code
sharing. The operating system can recognize that more than one application is
using the same target code because it loaded and linked that code. It can use that
44
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
information to load a single copy of the target code and link it to both
applications, rather than having to load one copy for each application.
Loaders
• Absolute loading
• Relocatable loading
45
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
task for the loader to place the module in the desired location. If the module is to
be loaded beginning at location x, then the loader must simply add x to each
memory reference as it loads the module into memory. To assist in this task, the
load module must include information that tells the loader where the address
references are and how they are to be interpreted (usually relative to the program
origin, but also possibly relative to some other point in the program, such as the
current location). Second, if any modifications are made to the program that
involve insertions or deletions in the body of the module, then all of the addresses
will have to be altered. Accordingly, it is preferable to allow memory references
within programs to be expressed symbolically and then resolve those symbolic
references at the time of compilation or assembly. Every reference to an
instruction or item of data is initially represented by a symbol. In preparing the
module for input to an absolute loader, the assembler or compiler will convert all
of these references to specific addresses.
46
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
placed in one region of main memory. However, when many programs share
main memory, it may not be desirable to decide ahead of time into which region
of memory a particular module should be loaded. It is better to make that decision
at load time. Thus we need a load module that can be located anywhere in main
memory.
47
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
The operating system provides services that include process management, virtual
memory, file management, security, fault tolerance, and the user interface.
Process management
Means managing the program or programs (also called jobs) running on the
processor at a given time, in the simplest case (a desktop operating system), the
operating system loads a program into main memory and execute it. Some
operating system offer more other forms of process management such as
multitasking, multithreading, and multiprocessing.
Multitasking:
48
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
Multithreading:
Time-sharing:
Multiprocessing
Occurs when a computer system with two or more processors can run more
than one program, or thread, at a given time by assigning them to different
processors, multiprocessing uses simultaneous processing with multiple CPUs.
Virtual memory
Simulates more main memory than actually exists in the computer system.
it allows a program to behave as if it had access to the full storage capacity of a
computer, rather than just access to the amount of primary storage installed in the
computer. Virtual memory divides an application program or module into fixed –
length portions called pages. The system executes some pages of instructions
while pulling others from secondary storage. In effect, primary storage is
extended into a secondary storage device, allowing users to write programs as if
primary storage were larger than it actually is. This enlarged capability boosts the
49
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
speed of the computer and allows it to efficiently run programs with very large
numbers of instructions.
provides other forms of security as well, for example, it must typically provide
protected memory and maintain access control on files in the file system, the
operating system also must keep track of users and their authority level, as well as
audit changes to security permissions.
Fault tolerance
1-monitoring performance
2-correcting errors
51
م علي عبد العزيزالقزاز.م تقنيات الحاسوب
9-formatting diskettes
13-locating files
14-detecting viruses
15-compressing data
51