0% found this document useful (0 votes)
10 views

2 - ComputerOrganization - FEC, Storage

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

2 - ComputerOrganization - FEC, Storage

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Computer Organization

Architecture
• CPU:
• the Central Processing Unit, is the brain of the computer.
• This highly compact and powerful chip controls all the peripheries and processes inside
the computer and does the calculations on the data the system handles.
• ALU:
• the Arithmetic Logic Unit, is a circuit that is part of the CPU and does all the arithmetic
and logical calculations.
• CU:
• the Control Unit, is the control circuit of the CPU.
• It handles the loading of instructions into the CPU and the decoding of these
instructions.
• Also, it directs the data flow and the operation of the ALU.
• Obtains the data/instructions from the memory; Interprets/decodes them into
commands/signals; Controls transfer of data and instructions among other units of a
CPU (for example, command to ALU for execution); Manages/coordinates all the units
of the computer;
• Registers:
• they are small, very fast circuits that store intermediate values from calculations or
instructions inside the CPU.
Architecture
• Bus - A collection of wires through which data is transmitted from one
part of a computer to another.
– Data bus- Moves data in and out of memory by the control unit
– Address bus- Used for accessing the memory address using control unit.
– Control bus - carries commands from the CPU and returns status signals from
the devices. For example if the data is being read or written to the device the
appropriate line (read or write) will be active
• Data bus width determines the amount of data which can be
transferred between memory and CPU - Byte/ Word/ 32 bit/ 64 bit etc.
• Every memory location has a unique address
• Von Neumann architecture
– Stored Program Concept
– use memory to store the information, which includes both program and data
– No difference in the storage of data and instruction
Architecture
• 3 basic characteristics of microprocessor
– Instruction set – set of instructions that a
microprocessor can execute (CISC and RISC
processors)
– Bandwidth – no of bits processed in single
instruction (16, 32 or 64 bit)
– Clock speed – MHz GHz How many instructions
per second a processor can execute
Architecture
• Basic registers in the Control Unit
– Program counter- Holds the address for the next instruction in the
sequence which is automatically incremented unless there is a
branch.
– Instruction register- Holds the assembly code of the instruction about
to be executed. Eg ADD, MULT etc.
– Memory Address Register- Holds the memory address of the data or
the instruction. Input comes from the program counter and output
goes to the address bus.
– Memory data register- Holds the data read from or written to the
memory. Connected to the data bus and ALU.
• Registers in ALU
– Accumulator holds the intermediate values of the operation
Architecture
• Interrupt register
– An interrupt is a signal for the CPU to stop what it is
doing and instead carry out the interrupt task, once
the task is complete, the CPU goes back to what it was
doing.
– Hardware interrupts and software interrupts
– Hardware interrupts deal with peripheral devices for
reporting an error or to start a process
– For example, pressing a key on the keyboard or moving
the mouse triggers hardware interrupts that cause the
processor to read the keystroke or mouse position.
– Software interrupts could be due to exceptions (divide-
Architecture
• Interrupt register
– An interrupt triggers an interrupt service routine to
be executed.
– For example – Routine which reads the key, or the
mouse's position, and copy the associated
information into the computer's memory
– Interrupt register contains the offset from the base
address to execute ISR (interrupt service routine)
– When an interrupt occurs all the parameters of the
current running program is pushed to stack and
later retrieved on return from ISR.

Architecture
• Use of Interrupts

• Handling
Architecture
• The operation of a CPU is determined by the instruction it executes, referred
to as machine instructions.
• The collection of different instructions is referred as the instruction set of the
CPU.
• The elements of an instruction are as follows:
• Operation Code:
– Specifies the operation to be performed (e.g., add, move etc.).
– The operation is specified by a binary code, know as the operation code or opcode.
• Source operand:
– The operation may involve one or more source operands; that is, operands that are
inputs for the operation.
• Result operand:
– The operation may produce a result.
• Next instruction reference:
– This tells the CPU where to fetch the next instruction after the execution of this
instruction is complete.
• Examples – Data Processing, Data storage, Data movement, Control
• A multi-core processor is a single chip that contains more than one
microprocessor core.
• Each core can simultaneously execute processor instructions in
parallel.
• This effectively multiplies the processor's potential performance by
the number of cores, if the software is designed to take advantage
of more than one processor core.
• Some components, such as bus interface and cache, may be shared
between cores.
• Because the cores are physically close to each other, they can
communicate with each other much faster than separate (off-chip)
processors in a multiprocessor system, which improves overall
system performance.
Factors that affect the processing of a computer
• Register size – also called word size determines the amount of data with which the
computers can work at one time. Lesser the size, slower will be the speed.
• Memory size – The amount of RAM or main memory can also affect the speed because
the CPU can keep more active program and data in RAM, which is faster than storage on
disk.
• Clock speed – The computer’s clock sets the pace for the CPU, faster the clock, more
instructions the CPU can process per second.
• System bus capacity – System bus consists of two parts, the data bus and the address
bus. The width of data bus determines how many bits can be transmitted at a time and
the width of the address bus gives the amount of address space that can be accessed at
any instance of time.
• Cache memory – Cache is a type of high speed memory that contains the most frequent
/ recent data and instructions that have been loaded by the CPU.
• Instruction set – The set of basic commands the processor can understand and execute
is called the instruction set.
• Heat and heat dissipation – When the processor runs it generates heat and becomes
too hot. This can make the processor freeze or even burn up, so adequate cooling
32 bit, 64 bit processors
• 32-bit processor - The register size within the processor is 32 bits.
So they can work with memory addresses that are 32 bits wide and
hold 32 bits of data/instruction.
• Note: A computer with a 32-bit processor cannot have a 64-bit
version of an operating system installed. It can only have a 32-bit
version of an operating system installed.
• 64-bit processor - The register size within the processor is 64 bits.
So they can work with memory addresses that are 64 bits wide and
hold 64 bits of data/instruction..
• Note: A computer with a 64-bit processor can have a 64-bit or 32-
bit version of an operating system installed. However, with a 32-bit
operating system, the 64-bit processor would not run at its full
capability.

Primary Memory
Primary memory is memory that is directly accessed by the CPU
• There are two types of primary memory
• RAM
• Stands for random access memory
• Consists of one or more memory modules
• Temporarily stores data while a computer is running
• It is volatile memory
• All data and instructions loaded onto the RAM before it gets processed in the CPU
• After processing in CPU, data is copied back to RAM (for display or storage)
• ROM
• Cannot be modified easily
• Permanently stores the data
• Non volatile
• Used to store the BIOS of the computer, the small control program that directs turning on
the computer.
• Types of ROM
– Programmable read only memory (PROM)
– Erasable programmable read only memory (EPROM)
– Electrically erasable programmable read only memory (EEPROM)
• PROM (programmable read only memory)
– ROM that can be programmed to record information using
a facility known as PROM programmer
– Once the chip has been programmed, the recorded
information cannot change, PROM becomes ROM
• EPROM (erasable programmable read only memory)
– Type of ROM that can be erased and reprogrammed
– Erasure by exposing the chip to UV Rays
• EEPROM (Electrically Erasable PROM)
– ROM that can be programmed and erased by
electrical signals
Types of RAM
• Dynamic RAM (DRAM)
– Consists of a transistor and capacitor that’s capable of storing electric
charge (1 bit)
– Depending on the switching action of transistor, the capacitor contains
no charge or charge
– bits arranged in a chip
– The row and column addresses are required to locate a cell.
– Since the charge on the capacitor tends to leak off, a refreshing circuit
is needed
• Refresh memory almost 1000 times per second
• Refresh operation consumes processor time
– DRAM cell consumes very less power and is able to sustain high
frequency of switching operations
• Static RAM
– Also volatile
– No regenerator circuits to retain stored data
– Internal flip flops (only transistors) to store binary
information
– Stored information remain valid as long as power is
supplied
– Takes up more space compared to DRAM
– Used in specialized applications (Cache)
– Easier to use and has shorter read-write cycles
Cache Memory
• A type of small, high-speed memory inside the CPU used to hold
frequently used data/instructions, so that the CPU needs to access the
much slower RAM less frequently.
• When the microprocessor processes data / instruction, it looks first in
the cache memory and if it is found there from a previous reading, then
it does not have to read from RAM which saves time
• Cache memory is closer to CPU/faster to access than main
memory/incorporated on the chip; By holding recently/frequently used
data and instructions in cache; Execution of program/fetching
instructions and data is faster;
• In personal computers, there are two types of caching that are
commonly used:
• Memory Caching
– Memory caching is considered more effective because in most programs the
same data or instructions are accessed over and over. By keeping as much of
this information as possible in Cache, the computer avoids accessing the slower
Cache Memory
• (L1) Level 1 Cache(2KB - 64KB) - Instructions are first searched in this cache. L1
cache very small in comparison to others, thus making it faster than the rest.

• (L2) Level 2 Cache(256KB - 512KB) - If the instructions are not present in the L1
cache then it looks in the L2 cache, which is a slightly larger pool of cache, thus
accompanied by some latency.

• (L3) Level 3 Cache (1MB -8MB) - With each cache miss, it proceeds to the next
level cache. This is the largest among the all the cache, even though it is slower, its
still faster than the RAM.

• The L3 cache is often shared between the cores. That’s in contrast to the L1 and L2
caches, both of which tend to be private and dedicated to the needs of each
particular core.

• When data is found in cache, it is called cache hit


• Cache miss leads to RAM access
• Effectiveness of a cache is judged by its hit rate
• Disk Caching
– Disk caching works under the same principle as memory
caching, but disk cache uses RAM.
– In a disk cache, the most recently accessed data from the
disk as well as adjacent sectors is stored in a memory buffer.
When a program needs to access data from the disk, it first
checks the disk cache to see if the data is present.
– The performance of applications can be dramatically
improved through the use of disk caching because accessing
a byte of data in RAM can be thousands of times faster than
accessing a byte on a hard disk.
• RAM stores data and instructions currently in
use
• ROM stores permanent instructions
• Cache stores frequently used instructions
Virtual Memory
• Virtual memory is a feature of an operating system (OS) that allows a
computer to compensate for shortages of RAM by temporarily
transferring pages of data from RAM to disk storage.
• OS will need to move other pages to hard disk so it has room to bring
back the pages it needs right away from temporary disk storage.
• This process is known as paging or swapping
• The temporary storage space on the hard disk is called a pagefile or a
swap file.
• Swapping happens so quickly that the end user doesn't know it's
happening.
• Several algorithms are used to choose which page should be swapped
out, including Least Recently Used (LRU), Least Frequently Used (LFU)
or Most Recently Used (MRU).
Machine instruction cycle
• Alternate Names
– Fetch-and-execute cycle
– Fetch-decode-execute cycle
– FDX
• Involves the:
– CPU
– ALU
– CU
– Memory Address register
– Memory Data register
– RAM
– PC
– CIR
Machine instruction cycle
• Fetch operands (read memory data)
– Copy PC address to MAR
– Increment PC
– Place address of the location to be read onto the address bus via MAR
– Activate the memory read control signal on the control bus
– Wait for the memory to retrieve the data from the addressed memory location
– Read the data from the data bus into MDR
– Copy MDR contents to CIR
– If the instruction contains another address as operand, Fetch cycle is repeated.
• Execute - Instruction is executed by the ALU, after decoding.
• Store result (write back memory data)
– Place the address of the location to be written on the address bus via the MAR
– Place the data to be written on the data bus via MDR
– Activate the memory write control signal on the control bus
– Wait for the memory to store the data at the addressed location
Need for persistent storage
• Persistent storage is needed to store data and
programs after the computer is turned off.
• Otherwise, all the programs and data would be need
reinstalled every time the computer is restarted.
• Also, RAM is limited in a computer while large
amounts of secondary storage are relatively cheap,
so storing unused data and programs in secondary
storage is useful to make space for running ones.
• Persistent storage is necessary in order to be able to
keep all of our files and data for later use.
• Sequential and direct access devices
Need for persistent storage
• Examples of persistent storage:
– Magnetic Tapes – Sequential Device, Tapes are normally used
for backing up.
– Hard Disk Drive (HDD)- the hard disk drive is the computer's
main storage media device that permanently stores all data
on the computer.
– Flash Memory- a type of nonvolatile memory that can be
erased and reprogrammed in units of memory (blocks).
– It is a variation of electrically erasable programmable read-
only memory (EEPROM) which, unlike flash memory, is
erased and rewritten at the byte level, which is slower than
flash memory updating.
(EEPROM is given here for comparison purpose only)
– CDs / DVDs / USB Sticks
• Sequential Device – Magnetic Tape
• A plastic film tape is coated with an iron oxide coating.
• Basically, this tape is passed by and in contact with a recording head, that
consists of a metal core with wire windings on it essentially an
electromagnet.
• This electromagnet has applied to it a changing voltage, that is generated by
the voice/ video/ data that one desires to record.
• The tape keeps moving, so the oxide has magnetism imparted to its oxide
coating, the strength of which is dependent upon the level of voltage applied
to the head at the time any particular point of the tape passes it.
• To recover this information in the magnetised tape, it is run over another
head (or the same one), and the magnetism on the tape produces a voltage
in the winding proportional to the magnetism at that particular point in the
tape.
• This electrical voltage is amplified and the sound/ video/ data is reproduced
to be the same as the information put on the tape in the first place.
Persistent Storage
• Direct access devices
– Hard disk has several surfaces on a spindle
– Each surface has multiple tracks and each track has
multiple sectors which can be accessed directly.
– Cylinder is the combination of all R/W heads which
enables the same track and sector accessed at each
surface.
– The combination of surface, track and sector is called a
block.
– The amount of blocks which can be transferred to
memory from hard disk is called a bucket.
– Bucket size depends on the HW and OS.
• Pen/Thumb Drives/Flash Memories
– USB Memory, Key Memory
– Flash with USB interface
– Flash is a solid state memory, no moving parts as in magnetic
memory and lasers
– Various sizes
– Low cost
– There are two main types of flash memory, which are named after
the NAND and NOR logic gates.
– NAND type flash memory may be written and read in blocks (or
pages).
– NOR type flash allows a single machine word (byte) to be written—​
to an erased location—​or read independently.
• Blue Ray Disk
– Optical disk
– Spiral recording
– pits (binary value of 0 or off, due to lack of reflection when
read) and lands (binary value of 1 or on, due to a reflection
when read)
– Useful for recording, rewriting and playing back HD Video
– 5 times the storage capacity of DVD
– 25 GB on single layer, 50 GB on dual layer
– Uses blue-violet instead of red laser (CD and DVD uses red
laser)
– This has shorter wavelength and makes it possible to focus the
laser spot with great precision
– This allows data to be packed more tightly and stored in less
space
Solid State Drive
• An SSD does much the same job functionally (e.g.,
saving your data while the system is off, booting your
system, etc.) as an HDD, but instead of a magnetic
coating on top of platters, the data is stored on
interconnected flash memory chips that retain the
data even when there's no power present.
• Flash memory in SSDs is faster and more reliable than
the flash memory in USB thumb drives.
• Fragmentation – not a problem
• Form factor – SSD occupies less space
Zip Drive
• A high-capacity floppy disk drive developed by
Iomega Corporation.
• Zip disks are slightly larger than conventional
floppy disks, and about twice as thick.
• They can hold 100 or 250 or 750 MB of data.
• Because they're relatively inexpensive and
durable, they have become a popular media for
backing up hard disks and for transporting large
files.
Random Access vs Sequential Access

• Random access device or Direct access device is a


memory device in which it is possible to find any
particular record as quickly, on average, as any other
record. The computer's internal RAM, flash storage
devices and disk storage devices (magnetic disks, optical
disks) are examples of random-access devices.
• Sequential access device is a data-storage device in which
it is necessary to read through all preceding records
before the computer finds the record it is looking for. Tape
storage devices are examples of sequential access devices.

You might also like