Title: Computer Organisation Praxis F2'1UF1F2'1UH1
1Computer Organisation Praxis (F2.1UF1/F2.1UH1)
Lisha Ma
2Introduction
- Computer organization examines the computer as a
collection of interacting functional units - Functional units may be built out of the circuits
- Higher level of abstraction assists in
understanding by reducing complexity
3What is a Computer?
- Based on what we learnt last time, a computer can
be defined as - A device that executes and follows a set of
instructions to carry out some computing
activity. - To do this, we need to have the ability to input
our problem to solve and all the information
needed to solve it, actually do the problem
solving part, and output the results in the end.
4What is a Computer?
- With this definition, there are a lot of
different things that can be computers
5More
There are many different computers Multi-million
dollar supercomputers Million dollar
mainframes Minicomputers Workstations Laptops
Less than 100 hand held personal digital
assistants
Although the price tags on these and the speed,
capacity, and software differ significantly, MOST
are basically designed the same.
6Computer Hardware Elements
Input Devices
Secondary Storage
Buses
Communication Other Devices
Output Devices
Memory
7Von Neumann Architecture
- John von Neumann a Hungarian Mathematician,
- 1903- 1957.
- The term Von Neumann architecture refers to a
computer design model that uses a single storage
structure to hold both programs and data. - This storage structure is main memory it
contains programs written in machine language
instructions and the data for the programs. - This is as opposed to earlier fixed program
computers whose programs were wired directly into
the hardware. - Some computers are still designed this way though
(for example, simple desk calculators).
8Von Neumann Component
- Von Neumann architecture has four functional
units - Central Processing Unit (CPU)
- Memory (IAS or RAM)
- Input/Output
- Auxiliary Storage (Secondary Storage).
- Sequential execution of instructions
- Stored program concept
9The Von Neumann Architecture of a Computer
10CPU
- Typically contains
- Control Unit - exerts overall control
- Arithmetic and Logic Unit - does the sums
- Registers
- Clock
11Control Unit
- A Control Unit is the unit that handles the
central work of the computer. - There are two registers in the control unit
- The instruction register (IR) contains the
instruction that is being executed - The program counter (PC) contains the address of
the next instruction to be executed - Repeats the following three tasks
- Fetches an instruction from memory
- Decodes the instruction
- Executes the instruction
12How Does the Control Unit Work?
Once the instruction is fetched, the PC is
incremented.
The PC holds the address of the next instruction
to be executed. Whatever is stored at that
address is assumed to be an instruction.
13Arithmetic/Logic Unit (ALU)
- Performs basic arithmetic operations such as
adding - Performs logical operations such as AND, OR, and
NOT - Most modern ALUs have a small amount of registers
where the work takes place. - For example, adding A and B, we might find A
stored in one register, B in another, and their
sum stored in, say, A, after the adder computes
the sum.
14The ALU Uses a Multiplexer
R
Register R
Other registers
AL1
ALU
AL2
condition code register
circuits
GT EQ LT
multiplexer
output
selector lines
15ADD X
f
D
ED
E
X
ADD X
E
D
ED
ALU1 ALU2
D
ED
16Registers
- In a computer, a register is one of a small set
of holding places that are part of a central
processing unit (CPU). - Links to other subsystems
- Instruction decoder circuit
- A register may hold a software instruction, a
storage address or other data, such as single
characters or a bit sequence for a symbol, pixel
anything.
17Example Register
- Memory Address Register (MAR)
- Memory Data Register (MDR)
- Program Counter (PC)
- Stores the memory address of the next instruction
to be executed - Instruction Register (IR)
- Stores the code for the current instruction
- Status register
- General purpose registers
18The Fetch-Execute Cycle
19The Fetch-Execute Cycle
- The CPU executes a program that is stored as a
sequence of machine language instructions in main
memory. - It does this by repeatedly reading, or fetching,
an instruction from memory and then carrying out,
or executing, that instruction.
20The Fetch-Execute Cycle
- The components of a processor
- DR - Data Register
- M - Memory
- MAR Memory Address Register
- MBR Memory Buffer Register
- AC - Accumulator
- PC - Program Counter
- IR - Instruction Register
- ALU - Arithmetic Logic Unit (including
arithmetic logic circuits) - PCU - Program Control Unit
21The Fetch-Execute Cycle
- Fetch operation
- The address of the desired memory cell is moved
into the MAR - Fetch/store controller signals a fetch,
accessing the memory cell - The value at the MARs location flows into the MDR
22The Fetch-Execute Cycle
- Store operation
- The address of the cell where the value should go
is placed in the MAR - The new value is placed in the MDR
- Fetch/store controller signals a store, copying
the MDRs value into the desired cell (CIR)
23Load Fetch/Execute Cycle
24Store Fetch/Execute Cycle
25ADD Fetch/Execute Cycle
26Memory
CPU
Memory
Control info
Write data
Read data
- CPU Interacts with the memory in 3 ways
- fetches instructions
- loads the value of a variable
- stores the new value of a variable
- Memory is capable of only 2 operations
- reads a load or a fetch
- writes operation of a storing the value of a
variable
27DDR DIMM Memory Slot
28Memory
- Memory is a collection of cells, each with a
unique physical address - The size of a cell is normally a power of 2,
typically a byte today.
29Memory
- A cell is the smallest addressable unit of memory
i.e. one cell can be read from memory or one
cell can be written into memory, but nothing
smaller.
30Memory
- Memory types in a hardware system
- Registers
- Cache
- RAM (Random Access Memory, main memory)
- ROM (Read Only Memory)
- Also Flash Memory
- Hard disk ('C Drive')
- CD - CD ROM or DVD
31Cache Memory
- Cache memory is Random Access Memory (RAM) that a
computer CPU can access more quickly than it can
access 'main memory' RAM. - As the microprocessor processes data, it looks
first in the cache memory and if it finds data
there, where it was placed from a previous
reading of data, the CPU saves time in not having
to transfer data from RAM.
32Cache Memory
- Cache memory is sometimes described in levels of
closeness and accessibility to the CPU. A Level 1
(L1) cache is on the same chip as the CPU and
can, typically, store 32 kilobytes. - Level 2 (L2 cache) is usually a Static RAM (SRAM)
chip, near to the CPU but separate from it. The
CPU can access the L2 if the L1 happens to be
empty, still saving the transfer from RAM.
33RAM
- RAM Random Access Memory serves as a
short-term memory for the computer. (The hard
disk is usually described as the long-term memory
for the computer.) - While the computer is in use, the application
program instructions and data pass continuously
through the processor. - They are stored, most immediately and for a short
time, in RAM. - RAM also stores many operating system
instructions during this same time. - The main RAM is usually a Dynamic RAM (DRAM)
chip. - DRAM is 'dynamic', unlike Static RAM that is used
in the cache. DRAM needs to have its storage
cells refreshed with electrical charge every few
milliseconds.
34RAM
- Static RAM does not need refreshing because it
uses continually moving current , switched in one
of two directions. DRAM cells hold a charge in
place. Static RAM can be accessed more quickly
than DRAM.
A photo of RAM
35ROM (Read Only Memory)
- ROM is 'built-in' computer memory containing data
and instructions that normally can only be read,
not written to. - ROM code holds start-up instructions - i.e. ROM
contains the programming that allows your
computer to be "booted up" or regenerated each
time you turn it on.
36ROM (Read Only Memory)
- ROM chips contain instructions which are specific
for that particular motherboard. Those programs
and data will remain in the PC throughout its
life usually they are not altered. - Unlike RAM, the data in ROM is not lost when the
computer power is turned off. - The ROM is sustained by a small long-life battery
in the computer.
37How does the memory unit work?
Trace the following operation
s
Store data D in memory location 0.
D
0
0
D
D
0
D
D
38How does the memory unit work?
Trace the following operation
f
1) Fetch data D from memory location 1. 2) Obtain
an instruction I from memory location 7.
D
1
How does the computer distinguish between 1)
and 2) above?
D
I
We need to look at the Decoder Circuit.
39Using the Decoder Circuit To Select Memory
Locations
0
4 x 24 decoder
0
1
0
0
40The decoder circuit doesn't scale well--- i.e. as
the number of bits in the MAR increases, the
number of output lines for the decoder goes up
exponentially.
Most computers today have an MAR of 32 bits.
Thus, if the memory was laid out as we showed it,
we would need a 32 x 232 decoder!
Note 232 is 22 230 4 G
So most memory is not 1 dimensional, but
2-dimensional (or even 3-dimensional if banked
memory is used).
412-D Memory
Note that a 4 x 16 decoder was used for the 1-D
memory.
2 x 4 decoder
columns
2 x 4 decoder
rows
42Input/Output Units
- An input unit is a device through which data and
programs from the outside world are entered into
the computer - Keyboard, the mouse, and scanning devices
- An output unit is a device through which results
stored in the computer memory are made available
to the outside world - Printers and video display terminals
43The I/O Devices
Pictorially, these look the simplest, but in
reality, they form the most diverse part of a
computer. Includes
keyboards, monitors, joysticks, mice, tablets,
lightpens, spaceballs, ....
44I/O Units
Memory
Processor
I/O buffer
Control-logic
Each device is different, but most are interrupt
driven. This means when the I/O device wants
attention, it sends a signal (the interrupt) to
the CPU.
I/0 device
45IN X
s
D
X
D
IN X
D
46OUT X
f
D
X
D
OUT X
D
47Secondary Storage
- Because most of main memory is volatile and
limited, it is essential that there be other
types of storage devices where programs and data
can be stored when they are no longer being
processed - Secondary storage devices can be installed within
the computer box at the factory or added later as
needed
48Magnetic Tape
- The first truly mass auxiliary storage device was
the magnetic tape drive
49Magnetic Disks
- A read/write head travels across a spinning
magnetic disk, retrieving or recording data
The organization of a magnetic disk
50Compact Disks
- A CD drive uses a laser to read information
stored optically on a plastic disk - CD-ROM is Read-Only Memory
- DVD stands for Digital Versatile Disk
51Flow of Information
- The parts are connected to one another by a
collection of wires called a bus
Data flow through a von Neumann architecture
52Buses
- Cables/Wires that connect the various components
of the computer together. - Used for control messages and data flows.
- Important in determining the overall speed of the
machines - 200Mhz CPU clock speed is pointless if the bus
can only operate at 50MHz, and vice versa.
53Buses
- The three buses connecting the processor to other
components, called system buses, are - control bus
- address bus
- data bus
- Each bus is made of lines, with each line capable
of carrying a 0 or 1 value bit at a time
54Control Bus
- The control bus carries bi-directional signals
that control the operation of the system
components. - status signals enable sharing of the address and
data buses - bus request a component needs control of
bus - bus grant a component is granted
control of bus - command signals specify operations to perform
- memory write data on data bus written to
location given by address bus - memory read data in location given by address
bus read into data bus - timing signals synchronize components.
- Clock provides regular pulses (giving speed of
processor)
55Address bus
- The address bus carries address signals in one
direction only from the processor to a
component. - The address bus carries the address of the
location of an instruction, or data, to be
written to or to be read to memory or to an I/O
controller. - The width of the address bus determines the
maximum memory size, - for example if an address bus had a width of 3
lines, the number of locations that can be
addressed would be 8 locations. - (at least 20 lines would be more realistic)
56Data bus
- The data bus is bi-directional and carries
program instructions or data. - The number of lines determines the amount of data
that can be transferred at a time (in a single
fetch)
Word size
- The word size of a computer is the number of bits
the processor can process simultaneously. - This may be the same or a multiple of the data
bus size
57Central Processor Unit
System Buses
Processor
Control Bus
Address Bus
Main Memory
Data Bus
Keyboard Input Controller
Keyboard
VDU Output Controller
VDU
(Disk) I/O Controller
Secondary Storage
58Peripheral Devices
- Attached to motherboard via ports
- Examples
- keyboard
- mouse
- modem
- external drive
- printer
- scanner
- ...
59Motherboard
- The nervous system of the computer.
- Houses the main buses, CPU, primary memory and
expansion slots for interface cards. - Interface cards help communication between the
peripherals and the motherboard. - Connected to the secondary storage and
peripherals.
60Thank You!