The IPO SYSTEM
Input receives instructions from user
Process (CPU) generated those instructions into information
Output basically is the final result of the information displayed on a screen
Computer component
Hardware , software , data and information , communications
Types of computers ( Micro , midrange , Mainframe , Supercomputer)
Computer history
1940-1950 Generation 1 used vacuum tubes
Expensive , huge and consume a-lot if heat and electricity
1950-1960 Generation 2 used transistors
Smaller cheaper less consumption of heat and electricity
1960-1970 Generation 3 used Integrated circuits
Smaller than transistors but work like thousands of them combined as usual faster cheaper lower heat
generation
Generation 4 used VLSC
The most reliable and accurate same advantage faster cheaper and generates less heat
Future Generation 5 used MACHINE LEARNING , AI
Ultra large scale integrated circuits
Provides parallel processing the aim of using this technology such as ML OR AI is so that the computer
can be able to execute simple human tasks
Protocol and standard
which is a set of rules and instructions for devices to communicate over the network standard are set of
agrees upon rules for communication to provide universal compatibility of data formats
THE ARCHITECTURE OF A COMPUTER
HOW ALL COMPONENTS WORK INTERLATED WITH EACHOTHER AND THEIR
ENVIRONMENT
Decomposition
which is breaking down the process into smaller pieces
Abstractions
Which includes hiding information and focusing on the information you only need one at a time
2 tier , 3 tier and hybrid
Which focuses on how many layer of communication is there between devices until the data is delivered
2tiers mean 2 layer of communication for example in simple words it’s how many jumps the data need to
make to reach the client
Distributed systems
A group of computers connected together over the internet and have been sent some data that needs to be
combined together to generate a result
I/O
I/O REQUIREMENTS
1- Needs to have a way to address peripheral devices
2- way to communicate with the cpu and
3- efficient way to transfer large amounts of data sine I/O devices can only take small amounts of data
4- also a higher bus requirements so it can transfer high data from one device to another
5- a way to handle and control different devices that have different control requirements
I/O MODULE
I/O modules are interface ports that are connected between the cpu and the I/O device it allows one signal
to flow so that the cpu can understand it since multiple I/O devices can have different signals
Includes a buffer that save the data until the cpu finishes processing another instruction
ADVANCED I/O TECHNIQUES
PROGRAMMED I/O
in simple terms it’s any input or output generated from a program such as login in instagram for example
INTERRUPTS
A signal which is sent to the CPU to inform it about an event it includes terminologies such as
INTERRUPT LINE
Carries the signal
INTERRUPT REQUESTS
The signal is just a request the cpu will respond but it’s not forced
INTERRUPT HANDLER
It tells cpu how to handle an interruption
Context
The last state it left the fetch - decode - execution - store cycle in so it can return back to it after dealing
with interruption
HOW TO SERVE AN INTERRUPTION
once the device send an interruption signal the cpu stops the processing cycle and heads save everything
in the process control block to deal with the higher priority interruption then branch to interrupt handling
program
DIRECT MEMORY ACCESS
allows transfer of large amounts of data without bypassing the cpu
I/O interface and memory must be connected for large data transfer
The I/O Module needs to be able to read and write to the memory
Conflict need to be avoided between the cpu and the I/O module while reading or writing
An interruption is needed for completion
For example to simplify all this the cpu will ask a disk driver to get some data from memory then cpu will
go do its work processing the disk drive will proceed to get the data from the memory and sends an
interrupt to the cpu after its done informing it
I/O MODULE FUNCTIONS
Provide buffer where data from memory is stored until it gets transferred to the device
Can communicate with the cpu
Recognize messages from device and address to it and accept commands from cpu
Copies data from its buffer to device also from cpu to buffer
CPU AND MEMORY
THE MACHINE CYCLE
( FETCH , DECODE , EXECUTE , STORE ) THIS IS IN (CPU AND MEMORY VERY IMPORTANT)
HOW TO ENHANCE CPU AND MEMORY
FOR CPU
PIPELINE METHOD
Assembly line method
SEPARATE FETCH AND EXECUTION
Separate fetch and execute which is fetch and decode under the fetch timeline and the execution and store
under another line
MULTIPLE EXECUTION PARALLEL PROCESSING
making multiple execution processes in one cpu chip all in one system the Excecution 1 and 2 are not
separate
FOR MEMORY
ACCESS MEMORY WIDER PATH
Providing a wider path for more bits to retrieve
INTERLEAVING OF MEMEORY
which include dividing up the memory into subsections that can do multiple functions at a time)
Memory cache
stores the most frequently used instruction in the cache so when it’s asked for by cpu the cache provides it
without searching in the RAM ) also uses locality of reference to identify the next instruction needed by
knowledge if user press copy for example next instruction will be paste so the cache is smart enough to
predit those cases also
Buses are important too they are used to transfer data from one location to another in the same computer
they can carry signal, addressing, control signal, power,
LOGIC GATES IN GENERAL (video link will be provided)
FOR DATA REPRESENTATION
Everything in a Computer is represented as an electric signal computer can only understands binary
language which includes 0,1 this represents is then decoded into an electrical signal to view a data format
Computer can store data using light , electricity , magnet
To use the magnet to store polarity of magnets are used when 2 magnets attract they can store binary
information as 0,1
Binary conversion ( will provide YouTube videos)
Function of binary system
Electrical signal is easier to carry and maintain by binary system
It only uses 0,1 which gives more accurate and variable results
Can be used for error detection and correction along with encoding and decoding
FORMATS OF DATA VIDEO , TEXT , IMAGE
SOUND INCLUDING THE SAMPLING TECHNIQUE
ANALOG SIGNAL
Analog signal is a representation of a continuous signal the message is the signal sent
DIGITAL SIGNAL
Digital signal is a representation of a discrete signal which is divided in multiple pieces the signal has to
be encoded so the receiver can understand it
OPERATING SYSTEM
operating system controls all the computer hardware and software it runs at the background to make sure
everything is running and working fine together
It works with CPU the actor in general operating system is a set of files that includes instructions the CPU
reads those files and controls the hardware to process information
3 main things work inside the OS
Resident memory (kernel)
It’s a program which i saved in the memory and includes all the software needed by the computer to run
on day by day task it’s supposed for commands and management of memory processing task and
secondary storage
Non- resident memory
Includes the program that are not in frequent used in general the tools that are used to enhance the
computer functionality
Bootstrap
Checks if all the hardware components are in place also includes the INITIAL PROGRAM LOAD which
is a set of instructions showing the bootstrap how to load the kernel resident memory
WE NEED TO UNDERSTAND IT FROM USERS POV
The main important part of this topic is the services a user interface can provide which includes
1- command interface
2- languages commands
3- API applications program interface
HOW DO USER INTERACT WITH COMPUTERS
Using user interface which is also provided by the os and also the user can communicate with the
application software using the API interface which is the list of instructions provided by the operating
system for a specific application
MULTITASKING AND MULTIPROCESSING
Multitasking is basically being able to perform multiple tasks at a time
Multiprocessing is only possible with more than one processor available it helps to process more than one
instruction at a time which is more efficient
OS FUNCTIONS
Accept commands usually from cpu (actor)
Manages the hardware such as network interface and external parts
Manages the software loads , execution program
TYPES OF OS
1- single user ( no multitasking )
2- single user multitasking
3- mainframe system
4- network services
5- mobile operating systems
6- real time system
7- embedded system
8- distributed system
OS INTERACTIVITY
Interactive OS
which usually responds to the user
Batch OS
performs task in a batch such as select all and delete
Interrupts or service requests
An interrupt request is just an indication to the CPU that a specific interrupt wants to happen. But perhaps
interrupts are temporarily disabled, or another higher-priority interrupt is already going on
OS MEMORY MANAGEMENT
Allocation and deallocation of the memory to do so every process is assigned an address and the memory
is partitioned using 2 techniques
FIXED PARTITIONING
The memory size is fixed so it cannot be adjusted which means if it’s a 3MB for example it cannot
expand from 3 or get lower than 3 the size stays the same
VARIABLE PARTITIONING
The partition is based on the process size if we have a 15MB memory and we want to fit a 5 MB the
partition is done and leaves 10 MB and then once an another process need to get allocated it can in basic
terms the memory size gets decided while putting the process inside so it may vary but the size is not
fixed
PAGING
Paging in general partition the process itself into pages instead of the full process being 10MB for
example it’s divided into 5 pages of 2MB which then is sent to different addresses in the memory incase if
the process was too big
DEMAND PAGING
Which is instead of loading the whole process pages into the memory we just pick the ones that are
needed or in demand to save space and provide space for other processes to be loaded into memory
VIRTUAL MEMORY
Differentiate between the physical memory which includes the HDD for example and the RAM and the
virtual memory that the CPU sees for example if i have a 6GB RAM in my laptop and i want to run a
10GB app it wouldn’t be possible so i borrow some storage from the HDD 4GB those for the CPU are
considered virtual the CPU doesn’t see that it’s borrowed from HDD he sees it as one whole 10GB
program in the memory RAM
PAGE FAULT
Page fault is when the CPU request some data from the RAM but the data is not inside the RAM so a
page fault will occur this stops the whole CPU processing information cycle
PAGE FAULT IS SOLVED USING PAGE REPLACEMENT
PAGE REPLACEMENT
it simply includes swapping out and swap in let’s say the cpu request information that is not in the RAM
and our RAM is full so we just have swap out any information inside the Ram that is not in use and
replace it with the page or information we want this is basically the idea
PAGE FAULT is an example of swapping in information from HDD INTO RAM
PAGE REPLACEMENT TECHNIQUES
FIRST IN FIRST OUT
This in simple term means if the memory frame is fill and no other memory block to add memory we
remove the first one that entered for example if the cpu request process 2 , 3 , 5 and after that the memory
is full so we have to remove one if the processes so the the one will be removed is 2 and replaced with a
new process request by cpu for example 3 so order becomes 3 , 3 , 5
OPTIMAL
It includes more prediction of the future it involves the idea of when is the next page gonna be used and it
checks the process from the string representation for example if cpu request process 2,3,5 and the
memory is full so a page fault occurs it will try to calculate when each process of those are gonna be next
used keep the one in demand and remove the process that is farther away
Least recently used
It includes checking the least process used in the string and removes it
THRASHING
The idea behind Thrashing is simply that the CPU is dealing with more page fault then actually
processing information remember every-time a fault page occurs the CPU has to stop processing in order
too deal with it then he can continue processing
FRAGMENTATION = waste
Sometimes when filling up the memory with some process waste may occur which is a space that is not
used it has 2 types
INTERNAL
The waste takes place inside the memory address for example if a 5MB fits into a 10MB memory we
have a waste of 5MB inside the memory address
EXTERNAL
opposite to internal happens outside which is a bunch of small waste outside the memory address because
of allocation and deallocation of the memory
ALLOCATION TECHNIQUE (video will be provided)
FIRST FIT
NEXT FIT
BEST FIT
WORST FIT
PROCESS CONTROL MANAGEMENT
PROCESS STATE DIGRAM
New
Ready
Running
Interrupted/timeout
I/O
Blocked
Exit
NEW means process who are waiting tor the OS to approve that they have all the resources needed for
them to function without interruption
READY is after the state of approval they wait in the queue so the can enter the cpu to run
RUN means program is working but still some programs such as teams might ask for login information so
the process have to be interrupted until it finishes the I/O and meanwhile the cpu takes another process to
work on once the process finishes the I/O it’s then sent back to the ready and it waits to enter then running
state
BLOCKED
is state is when I/O is needed
EXIT
Includes termination of the program after job is done
PROCESS CONTROL BLOCK
includes every information needed about the process it keeps track of the process and have specific
information about specific processes it also acts as a repository of information that may vary from one
process to another unique identification process of each process in simple terms
THREADS
The idea of threads is simple a MINI LIGHTWEIGHT PROCESS in general it’s segmenting the process
into their most simplified version to make it run more quickly and efficiently for example if you have a
CPU with 3 channels you can divide the process into 3 and pass it to the 3 lines note that the process does
not necessarily need to be passed all together at the same time it may vary
CPU SCHEDULING
It’s a time table for CPU on how it manages it processes and how long it takes how to do it and when to
do it
TYPES OF ALGORITHMS
PREEMPTIVE SCHEDULING
Changes such as interrupt can occur during the process calculation
TYPES OF PREEMPTIVE SCHEDULING
ROUND ROBIN
Most efficient and used way to work with time sharing which is multitasking
It’s ready queue is treated as a circular queue
Each process will stay only dormant a specific time slice in the CPU then it has to be terminated and to
wait for her turn in order
Which state that the round robin works in first in first out
MULTILEVEL QUEUE
In simple terms is having multiple scheduling algorithms working together at one scheduling dispatcher
it’s worked best for high priority process but since process cannot jump between the ready queue the
lower level priority process may have starvation since it’s not executed like the top ones
FEEDBACK MULTILEVEL QUEUE
Similar to multilevel queue it includes multiple run queue of different algorithms working together but
now the lower level process can jump from one ready queue to another which decreases the chance of
ignoring them and hence provides lower starvation
NON-PREEMPTIVE SCHEDULING
Changes cannot occur during the process once it starts executing you get what you get
NON-PREEMPTIVE SCHEDULING TYPES
FIRST IN FIRST OUT
this means that the first one in the ready queue gets served first and then the others in order
SHORTEST JOB FIRST
This includes the the process with the shortest completion time which is called burst time goes first
PRIORITY
Each process is labeled with a priority number that includes how urgent it’s and processes enter the ready
queue based on that
AIMS OF SCHEDULING
FAIRNESS
All devices should have a fare share of the CPU
EFFICIENCY
Trying to make the most out of the cpu utilizing it to it’s best
RESPONSE TIME
trying to have a convenient response time as fast as possible and to minimize response time make it
always short
CALCULATION IN CPU SCHEDULE (video link will be provided)
IF YOU REACH HERE REMEMBER I WILL GET AN A+ YOU SHOULD TOO BUT I AM THE
HONORED ONE SO IT'S EASY FOR ME