Unit I Basic Structure of Computers
Unit I Basic Structure of Computers
Unit I Basic Structure of Computers
Functional units
Bus structures
Hardware
Software interface
Addressing modes
RISC
CISC
BASIC STRUCTURE OF COMPUTERS:
Computer Organization:
It refers to the operational units and their interconnections that realize the
architectural specifications.
It describes the function of and design of the various units of digital computer that
store and process information.
Computer hardware:
Computer Architecture:
Functional Units
RAM:
Memory in which any location can be reached in short and fixed amount of time
after specifying its address is called RAM.
Time required to access 1 word is called Memory Access Time.
Cache Memory:
The small,fast,RAM units are called Cache. They are tightly coupled with
processor to achieve high performance.
Main Memory:
The largest and the slowest unit is called the main memory.
1.3. ALU:
Most computer operations are executed in ALU.
Consider a example,
Suppose 2 numbers located in memory are to be added. They are brought
into the processor and the actual addition is carried out by the ALU. The sum may then
be stored in the memory or retained in the processor for immediate use.
Access time to registers is faster than access time to the fastest cache unit in
memory.
1.4. Output Unit:
Its function is to send the processed results to the outside world. eg.Printer
Printers are capable of printing 10000 lines per minute but its speed is
comparatively slower than the processor.
Instructions are fetched from memory and the operand at LOC A is fetched. It is then
added to the contents of R0, the resulting sum is stored in Register R0.
Eg:2
Load LOC A, R1
Eg:3
Add R1 ,R0
Add the contents of Register R1 & R0 and places the sum into R0.
Fig:Connection between Processor and Main Memory
Instruction Register (IR):
It contains the memory address of the next instruction to be fetched for execution.
It contains the data to written into or read out of the address location.
MAR and MDR facilitates the communication with memory.
Operation Steps:
The program resides in memory. The execution starts when PC is point to the first
instruction of the program.
MAR read the control signal.
The Memory loads the address word into MDR.The contents are transferred to
Instruction register. The instruction is ready to be decoded & executed.
BUS STRUCTURES:
A group of lines that serves as the connection path to several devices is called a
Bus. A Bus may be lines or wires or one bit per line.
The lines carry data or address or control signal.
The Buffer Register when connected with the bus, carries the information during
transfer. The Buffer Register prevents the high speed processor from being locked to
a slow I/O device during a sequence of data transfer.
PERFORMANCE:
Elapsed Timethe total time required to execute the program is called the elapsed time.
It depends on all the units in computer system.
Processor TimeThe period in which the processor is active is called the processor time.
It depends on hardware involved in the execution of the instruction.
Processor clock:
T = (N*S)/R
N,S<R
The Complex instruction combined with pipelining would achieve the best
performance.
It is much easier to implement the efficient pipelining in processor with simple
instruction set.
Simple
Simple Instruction
Instruction set
Set
RISC
RISC CISCCISC
High level
Machine
Language Compiler
Program instruction
Translated into
INSTRUCTION AND INSTRUCTION SEQUENCING
A computer must have instruction capable of performing the following operations. They
are,
Memory Location
Processor register
Registers in I/O sub-system.
Add R1,R2,R3 Add the contents of register R1 & R2 and places their sum
into register R3.
Basic Instruction Types:
Instruction Syntax Eg Description
Type
Three Address Operation Add A,B,C Add values of variable
Source1,Source2,Destination A ,B & place the result
into c.
Two Address Operation Source,Destination Add A,B Add the values of A,B
& place the result into
B.
One Address Operation Operand Add B Content of
accumulator add with
content of B.
Instruction Fetch
Instruction Execution
Instruction Fetch:
The instruction is fetched from the memory location whose address is in PC.This is
placed in IR.
Instruction Execution:
Instruction in IR is examined to determine whose operation is to be performed.
Program execution Steps:
Branching:
The Address of the memory locations containing the n numbers are symbolically
given as NUM1,NUM2…..NUMn.
Separate Add instruction is used to add each number to the contents of register
R0.
After all the numbers have been added,the result is placed in memory location
SUM.
Fig:Straight Line Sequencing Program for adding ‘n’ numbers
Decrement R1
It reduces the contents of R1 by 1 each time through the loop.
Conditional Codes:
ADDRESSING MODES
Immediate mode
Register mode
Absolute mode
Indirect mode
Index mode
Base with index
Base with index and offset
Relative mode
Auto-increment mode
Auto-decrement mode
Variables:
Register Mode
Absolute Mode
Register Mode:
Constants:
Address and data constants can be represented in assembly language using Immediate
Mode.
Immediate Mode.
It places the value 200 in the register R0.The immediate mode used to specify the value
of source operand.
Move #200,R0
Instruction does not give the operand or its address explicitly.Instead it provides
information from which the new address of the operand can be determined.This address
is called effective Address(EA) of the operand.
Indirect Mode:
Add (R1),R0
B
…
Operand
Operand
Address of an operand(B) is stored into R1 register.If we want this operand,we can get it
through register R1(indirection).
The register or new location that contains the address of an operand is called the pointer.
Index Mode:
X(Ri)
EA=X + [Ri]
The index register R1 contains the address of a new location and the value of X defines
an offset(also called a displacement).
To find operand,
Here the constant X refers to the new address and the contents of index register
define the offset to the operand.
The sum of two values is given explicitly in the instruction and the other is stored
in register.
Relative Addressing:
It is same as index mode. The difference is, instead of general purpose register, here we
can use program counter(PC).
Relative Mode:
The Effective Address is determined by the Index mode using the PC in place of
the general purpose register (gpr).
This mode can be used to access the data operand. But its most common use is to
specify the target address in branch instruction.Eg. Branch>0 Loop
It causes the program execution to goto the branch target location. It is identified
by the name loop if the branch condition is satisfied.
Additional Modes:
Auto-increment mode:
CISC
Pronounced sisk, and stands for Complex Instruction Set Computer. Most PC's use CPU
based on this architecture. For instance Intel and AMD CPU's are based on CISC
architectures.
Typically CISC chips have a large amount of different and complex instructions. The
philosophy behind it is that hardware is always faster than software, therefore one should
make a powerful instruction set, which provides programmers with assembly instructions
to do a lot with short programs.
In common CISC chips are relatively slow (compared to RISC chips) per instruction, but
use little (less than RISC) instructions.
RISC
Pronounced risk, and stands for Reduced Instruction Set Computer. RISC chips evolved
around the mid-1980 as a reaction at CISC chips. The philosophy behind it is that almost
no one uses complex assembly language instructions as used by CISC, and people mostly
use compilers which never use complex instructions. Apple for instance uses RISC chips.
Therefore fewer, simpler and faster instructions would be better, than the large, complex
and slower CISC instructions. However, more instructions are needed to accomplish a
task.
An other advantage of RISC is that - in theory - because of the more simple instructions,
RISC chips require fewer transistors, which makes them easier to design and cheaper to
produce.
Finally, it's easier to write powerful optimized compilers, since fewer instructions exist.
RISC vs CISC
There is still considerable controversy among experts about which architecture is better.
Some say that RISC is cheaper and faster and therefore the architecture of the future.
Others note that by making the hardware simpler, RISC puts a greater burden on the
software. Software needs to become more complex. Software developers need to write
more lines for the same tasks.
Therefore they argue that RISC is not the architecture of the future, since conventional
CISC chips are becoming faster and cheaper anyway.
RISC has now existed more than 10 years and hasn't been able to kick CISC out of the
market. If we forget about the embedded market and mainly look at the market for PC's,
workstations and servers I guess a least 75% of the processors are based on the CISC
architecture. Most of them the x86 standard (Intel, AMD, etc.), but even in the mainframe
territory CISC is dominant via the IBM/390 chip. Looks like CISC is here to stay …
Is RISC than really not better? The answer isn't quite that simple. RISC and CISC
architectures are becoming more and more alike. Many of today's RISC chips support
just as many instructions as yesterday's CISC chips. The PowerPC 601, for example,
supports more instructions than the Pentium. Yet the 601 is considered a RISC chip,
while the Pentium is definitely CISC. Further more today's CISC chips use many
techniques formerly associated with RISC chips.