2 - ComputerOrganization - FEC, Storage
2 - ComputerOrganization - FEC, Storage
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.