Sei sulla pagina 1di 42

Lecture 2

By
Dr. L. Ranathunga

UoM
“The Box”
CRT Display CD-ROM Drive

Floppy
Disk
Drive

Keyboard

Mouse

Input Process Output


UoM
Computer Operations
 Computer is an electronic device capable of doing
arithmetic calculations faster
 It serves different purposes to different people
 Computer is a machine capable of solving problems and
manipulating data
 Accepts data, processes the data by doing some mathematical and
logical operations and gives us the desired output.
 Some time it is a monitoring and controlling device
 Can see a computer as a device that transforms data
 Accept data
 Store data
 Process data as desired
 Retrieve the stored data
 Print the result in desired format
UoM
bus
Disk
Printer
controller
Mouse Ports
Keyboard
Graphics
Modem card Monitor

CPU Speakers
Sound
card

RAM
Network
card
Computer

UoM
Basic Computer Organization
 Every computer contains five essential elements or
units:
 Arithmetic and Logic Unit (ALU)
 Memory
 Control Unit
 Input Unit
 Output Unit

UoM
Basic Computer Organization
• Memory
Central Processor Unit
• Main memory
ALU (Including cache)
• Auxiliary storage
Input Out put • Control Unit
Control Unit
• Directs the
operations of all
units

Memory

UoM
Outline Components
 Input: This is the process of entering data and programs in to
the computer system. Computer takes as inputs raw data and
performs some processing giving out processed data.
Therefore, the input unit takes data from us to the computer
in an organized manner for processing
 Storage (Memory): The process of saving data and
instructions permanently is known as storage (Memory). Data
has to be fed into the system before the actual processing
starts. It provides space for storing data and instructions.
 All data and instructions are stored here before and after
processing.
 Intermediate results of processing are also stored here.

UoM
Outline Components
 Processing: The task of performing operations like arithmetic and
logical operations is called processing. The Central Processing Unit
(CPU) takes data and instructions from the storage unit and makes
all sorts of calculations based on the instructions given and the type
of data provided. It is then sent back to the storage unit.
 Output: This is the process of producing results from the data for
getting useful information. Similarly the output produced by the
computer after processing must also be kept somewhere inside the
computer before being given to you in human readable form. Again
the output is also stored inside the computer for further processing.
 Control: The manner how instructions are executed and the above
operations are performed. Controlling of all operations like input,
processing and output are performed by control unit. It takes care of
step by step processing of all operations in side the computer.

UoM
Computing Systems
Computers have two kinds of sub systems:
 Hardware, consisting of its physical devices (CPU,
memory, bus, storage devices, ...)
 Software, consisting of the programs it has (Operating
system, applications, utilities, ...)

Central Processing Unit (CPU):


 the “brain” of the machine
 location of circuitry that performs arithmetic and logical ML
statements
 measurement: speed (roughly) in megahertz (millions of
clock-ticks per second) or Gigahertz
 examples: Intel Pentium, AMD K6, Motorola PowerPC, Sun
SPARC,
UoM
Hardware: RAM
Random Access Memory (RAM)
 “main” memory, which is fast, but volatile...
 analogous to a person’s short-term memory.
 many tiny “on-off” switches: for convenience
 “on” is represented by 1, “off” by 0.
 each switch is called a binary digit, or bit.
 8 bits is called a byte.
 210 bytes =1024 bytes is called a kilobyte (1K)
 220 bytes is called a megabyte (1M).

UoM
Hardware (Disk)
Secondary Memory (Disk):
 Stable storage using magnetic or optical media.
 Analogous to a person’s long-term memory.
 Larger capacities
 Slower to access than RAM.
 Examples:
 floppy disk (measured in kilobytes)
 hard disk (measured in gigabytes (230 bytes))
 CD-ROM (measured in megabytes), ...

UoM
Hardware: the Bus
The Bus:
 Connects CPU to other hardware devices.
 Analogous to a person’s spinal cord.
 Speed measured in megahertz (like the CPU), but
typically much slower than the CPU...
 The bottleneck in most of today’s PCs.

UoM
Interconnected Components of
Computer
 The CPU (ALU, Control Unit, Registers)
 The Memory Subsystem (Stored Data)
 The I/O subsystem (I/O devices)

Address Bus

Data Bus Memory


CPU
Control Bus Subsystem

I/O Device
Subsystem
UoM
Each of these Components are
connected through Buses.
 BUS - Physically a set of wires. The components of the
Computer are connected to these buses.
 Address Bus
 Data Bus
 Control Bus

UoM
Address Bus
 Used to specify the address of the memory location to
access.
 Each I/O devices has a unique address. (monitor,
mouse, cd-rom)
 CPU reads data or instructions from other locations by
specifying the address of its location.
 CPU always outputs to the address bus and never reads
from it.

UoM
Data Bus and Control Bus
 Data :-
 Actual data is transferred via the data bus.
 When the cpu sends an address to memory, the
memory will send data via the data bus in return to the
cpu.
 Control :-
 Collection of individual control signals.
 Whether the cpu will read or write data.
 CPU is accessing memory or an I/O device
 Memory or I/O is ready to transfer data

UoM
I/O Bus or Local Bus
 In today’s computers the the I/O controller will have an
extra bus called the I/O bus.
 The I/O bus will be used to access all other I/O devices
connected to the system.
 Example: PCI bus

UoM
Hardware: Cache
While accessing RAM is faster than accessing secondary
memory, it is still quite slow, relative to the rate at
which the CPU runs.
To circumvent this problem, most systems add a fast
cache memory to the CPU, to store recently used
instructions and data.
(Assumption: Since such instructions/data were needed
recently, they will be needed again in the near future.)

UoM
Hardware: Summary
Putting the pieces together:

Main Secondary
cache CPU
Memory Memory

Bus

Programs are stored (long-term) in secondary


memory, and loaded into main memory to run, from
which the CPU retrieves and executes their
statements.
UoM
Software: OS
The operating system (OS) is loaded from secondary
memory into main memory when the computer is
turned on, and remains in memory until the
computer is turned off.

CPU RAM Disk


Cache
OS

Bus

UoM
Software: OS
The OS acts as the “manager” of the system, making
sure that each hardware device interacts smoothly
with the others.
It also provides the interface by which the user interacts
with the computer, and awaits user input if no
application is running.
Examples: MacOS, Windows UNIX, Linux, Solaris, ...

UoM
Software: Applications
Applications are non-OS programs that perform some
useful task, including word processors,
spreadsheets, databases, web browsers, C++
compilers, ...
Example C++ compilers/environments:
– CodeWarrior (MacOS, Windows, Solaris)
– GNU C++ (UNIX, Linux)
– Turbo/Borland C++ (Windows)
– Visual C++ (Windows)

UoM
Putting it all together
Programs and applications that are not running are
stored on disk.

CPU RAM Disk


Cache
OS App

Bus

UoM
Putting it all together
When you launch a program, the OS controls the CPU
and loads the program from disk to RAM.

CPU RAM Disk


Cache

App
OS OS App

Bus

UoM
Putting it all together
The OS then relinquishes the CPU to the program,
which begins to run.

CPU RAM Disk


Cache

App
App OS App

Bus

UoM
Structure & Function
 The hierarchical nature is necessary for design and
description of complex system.
 The designer needs to deal with one level of
abstraction at a time. At each level the designer is
concerned with structure and function.
 Structure is the way in which components relate to
each other
 Function is the operation of individual components
as part of the structure

UoM
Functions
 Computer functions are:
 Data processing
 Data storage
 Data movement
 Control

UoM
Functional view
 Functional view of a computer

Data
Storage
Facility

Data
Control
Movement
Mechanism
Apparatus

Data
Processing
Facility

UoM
Operations
 Data movement
 e.g. keyboard to screen

Data
Storage
Facility

Data
Control
Movement
Mechanism
Apparatus

Data
Processing
Facility

UoM
Operations
 Storage
 e.g. Internet download to disk

Data
Storage
Facility

Data
Control
Movement
Mechanism
Apparatus

Data
Processing
Facility

UoM
Operation
 Processing from/to storage
 e.g. updating bank statement

Data
Storage
Facility

Data
Control
Movement
Mechanism
Apparatus

Data
Processing
Facility

UoM
Operation
 Processing from storage to I/O
 e.g. printing a bank statement

Data
Storage
Facility

Data
Control
Movement
Mechanism
Apparatus

Data
Processing
Facility

UoM
Structure - Top Level
Peripherals Computer

Central Main
Processing Memory
Unit

Computer
Systems
Interconnection

Input
Output
Communication
lines

UoM
Structure - The CPU

CPU

Computer Arithmetic
Registers and
I/O Login Unit
System CPU
Bus
Internal CPU
Memory Interconnection

Control
Unit

UoM
CPU organization
 CPU controls the Computer
 The CPU will fetch, decode and execute instructions.
 The CPU has three internal sections: register section,
ALU and Control Unit

UoM
Register Section
 Includes collection of registers and a bus.
 Processor’s instruction set architecture are found in
this section.
 Non accessible registers by the programmer. These are
to be used for registers to latch the address being
accessed and a temp storage register.

Arithmetic/Logic Unit (ALU)


 Performs most Arithmetic and logical operations.
 Retrieves and stores its information with the register
section of the CPU
UoM
Memory Subsystem
 2 Types of Memory:
 ROM : Read Only Memory
 Program that is loaded into memory and cannot be changed also
retains its data even without power.
 The ICs inside the PC that form the ROM. The storage of program
and data in the ROM is permanent. The ROM stores some standard
processing programs supplied by the manufacturers to operate the
personal computer. The ROM can only be read by the CPU but it
cannot be changed. The basic input/output program is stored in the
ROM that examines and initializes various equipment attached to the
PC when the switch is made ON. ROM is non-volatile memory.
 RAM : Random Access Memory
 Also called read/write memory. This type of memory can have a
program loaded and then reloaded. It also loses its data with no
power
UoM
Different ROM Chips
 Masked ROM :
 ROM that is programmed with data when fabricated. Data
will not change once installed.
 Hardwired.
 Programmable ROM (PROM) :
 Capable of being programmed by the user with a ROM
programmer.
 Not hardwired.
 Not possible to modify or erase programs stored in ROM,
but it is possible for you to store your program in PROM
chip. Once the programmes are written it cannot be
changed and remain intact even if power is switched off.
Therefore programs or instructions written in PROM or
ROM cannot be erased or changed
UoM
Different ROM Chips
 Erasable PROM (EPROM) :
 Much like the PROM this EPROM can be programmed and then erased by
light.
 Which over come the problem of PROM & ROM. EPROM chip can be
programmed time and again by erasing the information stored earlier in it.
Information stored in EPROM exposing the chip for some time ultraviolet light
and it erases chip is reprogrammed using a special programming facility. When
the EPROM is in use information can only be read.
 EEPROM :
 Another form of EPROM but is reprogammable electrically.
 EEPROM is user-modifiable read-only memory (ROM) that can be erased and
reprogrammed (written to) repeatedly through the application of higher than
normal electrical voltage generated externally or internally in the case of
modern EEPROMs. EPROM usually must be removed from the device for
erasing and programming, whereas EEPROMs can be programmed and erased
in circuit.
 Flash memory is a non-volatile computer storage chip that can be
electrically erased and reprogrammed. UoM
Different RAM Chips
 Dynamic RAM (DRAM) :
 Leaky capacitors. Caps are charged and slowly leak until
they are refreshed to there original data locations. Ex.
Computer RAM
 Periodical refresh
 Static RAM (SRAM) :
 Much like a register. The contents stay valid and does not
have to be refreshed. SRAM is faster than DRAM but cost
more Ex. Cache
 About 6 MOSFET transistors per bit

UoM
Different RAM Chips
 Synchronous dynamic random access memory (SDRAM)
 A Dynamic random access memory (DRAM) that is synchronized with the
system bus. Classic DRAM has an asynchronous interface, which means that it
responds as quickly as possible to changes in control inputs.
 It waits for a clock signal before responding to control inputs and is therefore
synchronized with the computer's system bus.
 This allows the chip to have a more complex pattern of operation than an
asynchronous DRAM, enabling higher speeds.
 Double data rate synchronous dynamic random access memory
(DDR SDRAM)
 Compared to single data rate (SDR) SDRAM, the DDR SDRAM interface makes
higher transfer rates possible by more strict control of the timing of the
electrical data and clock signals.
 Transferring data on both the rising and falling edges of the clock signal
 The name "double data rate" refers to the fact that a DDR SDRAM with a certain
clock frequency achieves nearly twice the bandwidth of a single data rate
running at the same clock frequency, due to this double pumping
UoM
 Questions?

UoM

Potrebbero piacerti anche