Module3 Computer-Communication Notes.-17040927954090 PDF
Module3 Computer-Communication Notes.-17040927954090 PDF
Module 3
Basic Structure of computers
3. CONTROL UNIT
It controls the data transfer operations between memory and the processor. It controls the
data transfer operations between I/O and processor. It generates control signals for Memory
and I/O devices.
4. PC (PROGRAM COUNTER)
It is a special purpose register used to hold the address of the next instruction to be
executed. The contents of PC are incremented by 1 or 2 or 4 after either instruction or data
fetched from memory The contents of pc are incremented by 1 for 8 bit CPU, 2 for 16 bit
CPU and for 4 for 32 bit CPU
5. REGISTER ARRAY
The structure of register file is as shown in the above figure. It consists of set of registers.
A register is defined as group of flip flops. Each flip flop is designed to store 1 bit of data. It
is a storage element.
6. IR (INSTRUCTION REGISTER
It holds the instruction to be executed. It output is available to the control units.
7. ALU (ARITHMETIC and LOGIC UNIT)
It performs arithmetic and logical operations on given data.
BUS STRUCTURE
Bus: It is defined as set of parallel wires used for data communication. Each wire carries 1 bit
of data. There are 3 of buses, namely
1. Address bus
2. Data bus and
3. Control bus.
1. Address bus :
It is unidirectional.
The CPU sends the address of an I/O device or Memory device by means of this bus.
2. Data bus
It is a bidirectional bus.
The CPU sends data from Memory to CPU and vice versa as well as from I/O to CPU
and vice versa by means of this bus.
3. Control bus:
This bus carries control signals for Memory and I/O devices.
PERFORMANCE
The performance of a Computer System is based on hardware design of the processor
and the instruction set of the processors. To obtain high performance of computer
system it is necessary to reduce the execution time of the processor.
Execution time: It is defined as total time required executing one complete program.
The performance of the processor is inversely proportional to execution time of the
processor.
More performance = Less Execution time.
Less Performance = More Execution time.
.CACHE MEMORY: It is defined as a fast access memory located in between CPU and
Memory. It is part of the processor as shown in the fig
The processor needs more time to read the data and instructions from main memory
because main memory is away from the processor as shown in the figure. Hence it slowdown
the performance of the system.
The processor needs less time to read the data and instructions from Cache Memory
because it is part of the processor. Hence it improves the performance of the system.
PROCESSOR CLOCK:
The processor circuits are controlled by timing signals called as Clock.It defines constant
time intervals and are called as Clock Cycles. To execute one instruction there are 3 basic
steps namely
1. Fetch
2. Decode
3. Execute.
The processor uses one clock cycle to perform one operation as shown in the figure
Clock Cycle → T1 T2 T3
Instruction → Fetch Decode Execute
The performance of the processor depends on the length of the clock cycle. To obtain
high performance reduce the length of the clock cycle. Let ‘ P ’ be the number of clock
cycles generated by the Processor and ‘ R ‘ be the Clock rate .
Ex 1: R= 500MHZ, P=?
1/500 =0.002*10-6 =2ns
Ex 2 : R=1250 MHZ , P = ?
1/1250 = 0.0008 * 10-6 = 0.8 ns
Let ‘N ‘ be the number of instructions contained in the program. To execute one instruction
there are 3 steps namely 1. Fetch 2. Decode 3. Execute
Let ‘ S ‘ be the average number of steps required to one instruction.
Let ‘ R’ be number of clock cycles per second generated by the processor to execute
one program. Hence Processor Execution Time is given by
T=N*S/R
This equation is called as Basic Performance Equation.
For the programmer the value of T is important. To obtain high performance it is necessary to
reduce the values of N and S and to increase the value of R
CLOCK RATE
Improving the integrating –circuit (IC) technology makes logic circuits faster, which
reduces the time needed to complete a basic step. this allows the clock period ‘p’ to be
reduced and the clock rate ’R’ to be increased.
Reducing the amount of processing done in one basic step also makes it possible to
reduce the clock period.
PERFORMANCE MEASUREMENT
The computer community adopted the idea of measuring computer performance
using benchmark programs.
The performance measure is the time it takes a computer to execute given benchmark
An organization called system performance evaluation corporation(SPEC) selects and
publishes programs for different application domains.
It also provides many test results for commercially available computers.
This was developed in the year 1995 and modified in the year 2000, respectively
called as SPEC95 and SPEC2000.
Programs are selected from various fields like games, database, numerical
calculations.
The program is compiled for the computer under test, and running time on that
computer is measured.
The same program is compiled and run on one computer selected as a reference.
For SPEC95, the reference is the SUN SPARC station, for SPEC2000, the reference
computer is an ULTRA SPARC workstation.
Spec rating :
Spec rating is computed as follows
spec rating = running time on the reference computer
running time on the computer under test
Spec rating of 50 means that the computer under test is 50 times as fast as the
reference computer for that particular benchmark.
The test is repeated for all programs in the spec suit, and the geometric mean of the
results is computed.
let speci be the rating for program i in the suite.
The overall spec rating for the computer is given by
Spec Rating= ( ∏n SPECi )1/n
i=1
1. Memory is a storage device. It is used to store character operands, data operands and
instructions.
2. It consists of number of semiconductor cells and each cell holds 1 bit of
information.A group of 8 bits is called as byte and a group of 16-64 bits is called as
word.
World length = 16 for 16 bit CPU and World length = 8 for 8 bit CPU. It is defined as
number of bits in the byte or word.
Memory is organized in terms of bytes or words.
The organization of memory for 32 bit processor is as shown in the fig.
Memory words
The contents of memory location can be accessed for read and write operation either by
specifying address of the memory location or by name of the memory location.
Address space : It is defined as number of bytes accessible to CPU and it depends on the
number of address lines.
BYTE ADDRESSABILITY
The computer performs ALU operations on 3 quantities namely bit, byte and word. It is
impractical to assign addresses for 1 bit of information. Hence for practical reasons it is
necessary to assign the addresses for successive bytes.
In this technique lower byte of data is assigned to lower address of the memory and
higher byte of data is assigned to higher address of the memory.
The structure of memory to represent 32 bit number for little endian assignment is as shown
in the fig.
WORD ALLIGNMENT
16 bit
Word size 32 bit
64 bit
It is process of assignment of addresses of two successive words and this address is the
number of bytes in the word is called as Word alignment.
The character occupies 1 byte of memory and hence byte address for memory.
The numbers occupies 2 bytes of memory and hence word address for numbers.
MEMORY OPERATION
There are two types of memory operations namely 1. Memory read and 2. Memory
write
ADD R0 , R1, R2
Opcode source1, Source2, Destination
This instruction adds the contents of R0 with the contents of R1 and result is stored in R2.
The mathematical representation of this statement is given by
R2 ←[R0] + [R1].
Such a notations are called as “Assembly Language Notations”
Consider the arithmetic expression C = A + B, Where A,B,Z are the Memory locations.
Steps for evaluation
1. Access the first memory operand whose symbolic name is given by A.
2. Access the second memory operand whose symbolic name is given by B.
3. Perform the addition operation between two memory operands.
4. Store the result into the 3rd memory location C.
5. The mathematical representation is C ←[A] + [B].
opcode operand
Ex1: LOAD A This instruction copies the contents of memory location whose symbolic
name is given by ‘A’ into the Accumulator as shown in the figure.
ADD B This instruction adds the contents of Accumulator with the contents of
Memory
location ‘B’ and result is stored in Accumulator.
STORE B This instruction copies the contents of Accumulator into memory
location whose symbolic name is given by ‘B’ .
The 3 instruction program is stored in the successive memory locations of the processor is as
shown in the fig.
The system bus consists of uni-directional address bus,bi-directional data bus and control bus.
“It is the process of accessing the 1st instruction from memory whose address is stored in
program counter into Instruction Register (IR) by means of bi-directional data bus and at the
same time after instruction access the contents of PC are incremented by 4 in order to access
the next instruction. Such a process is called as “Straight Line Sequencing”.
INSTRUCTION EXECUTION
There are 4 steps for instruction execution
1 Fetch the instruction from memory into the Instruction Register (IR) whose
address is stored in PC.
IR ← [ [PC] ]
2 Increment the contents of PC by 4.
PC ← [PC] + 4.
3 Decode the instruction.
4 Perform the operation according to the opcode of an instruction
5 Load the result into the destination.
BRANCHING
Instead of using a long list of add instructions, it is possible to place a single Add
instruction in a program loop as shown in figure.
The loop is a straight- line sequence of instructions executed as many times as
needed.
Chaitra.B ,Asst .Prof, Dept of ISE,AcIT Page 12
Lecture Notes Digital Design and Computer Organization
C V Z N
1 N (NEGATIVE) Flag:
It is designed to differentiate between positive and negative result.
It is set 1 if the result is negative, and set to 0 if result is positive.
2 Z (ZERO) Flag:
It is set to 1 when the result of an ALU operation is found to zero, otherwise it
is cleared.
3 V (OVER FLOW) Flag:
In case of 2s Complement number system n-bit number is capable of
representing a range of numbers and is given by -2n-1 to +2n-1. . The Over-Flow
flag is set to 1 if the result is found to be out of this range.
4 C (CARRY) Flag :
This flag is set to 1 if there is a carry from addition or borrow from
subtraction, otherwise it is cleared..
ADDRESSING MODES
The different ways in which the location of an operand is pecified in an instruction are
referred to as addressing modes
1.REGISTER ADDRESSING
In this mode operands are stored in the registers of CPU. The name of the register is directly
specified in the instruction.
Ex: MOVE R1,R2 Where R1 and R2 are the Source and Destination registers respectively.
This instruction transfers 32 bits of data from R1 register into R2 register. This instruction
does not refer memory for operands. The operands are directly available in the registers.
2. ABSOLUTE ADDRESSING
It is also called as Absolute Addressing Mode. In this addressing mode operands are stored in
the memory locations. The name of the memory location is directly specified in the
instruction.
Ex: MOVE X, R1 : Where X is the memory location and R1 is the Register.
This instruction transfers 32 bits of data from memory location X into the General Purpose
Register R1.
3.IMMEDIATE ADDRESSING
In this Addressing Mode operands are directly specified in the instruction. The source field is
used to represent the operands. The operands are represented by # (hash) sign.
Ex: MOVE #23, R0
EA of an operand = X + (Ri )
RELATIVE ADDRESSING
In this Addressing Mode EA of an operand is computed by the Index Addressing Mode. This
Addressing Mode uses PC (Program Counter)to store the EA of the next instruction instead
of GPR.The symbolic representation of this mode is X (PC).Where X is the offset value and
PC is the Program Counter to store the address of the next instruction to be executed.
It can be represented as
EA of an operand = X + (PC).
This Addressing Mode is useful to calculate the EA of the target memory location.
ADDITIONAL MODES
In this Addressing Mode , EA of an operand is stored in the one of the GPRs of the CPU. This
Addressing Mode decrements the contents of memory register by 4 memory locations and
then transfers the data to destination.