You are on page 1of 44

UNIT 1

BASIC STRUCTURE OF COMPUTERS


DEEPA.T.P.
SEM : 3
YEAR: 2019-2020
SUBJECT CODE: 18CIC33
What is Computer?

Computer is an electronic calculating machine which accepts


digitized input data, process it according to stored instructions
and produces output information.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.1, PAGE NO: 2 PREPARED BY: DEEPA.T.P.
Personal Computers: Desktop Computers: used Personal Notebook
used in homes, schools, in homes, schools, Computer: compact
businesses businesses version of personal Enterprise system and server- low
computer end ,Mainframes, large, powerful,
business data at large corporations,
more storage capacity
Types of Computers

Supercomputer: communication
support, high end of servers, large
data
Workstation: Engineering
applications
Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.1, PAGE NO: 2 PREPARED BY: DEEPA.T.P.
Functional Units
Keywords to Remember
1. Input Unit
2. Output Unit
3. Memory Unit
4. Arithmetic Logic Unit
(ALU)
5. Control Unit
6. Processor
7. Instructions
8. Data
9. Program
10. Stored Program
11. Object Program Basic Function Units of Computer

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.2, PAGE NO: 3-7, Fig: 1.1 PREPARED BY: DEEPA.T.P.
Basic Operational
Concepts
Keywords to Remember
1. Instruction Register (IR)
2. Program Counter (PC)
3. Memory Address Register (MAR)
4. Memory Data Register (MDR)
5. Interrupt Service Routine (ISR)

Video
Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.3, PAGE NO: 7-9. Fig: 1.2(page:8) PREPARED BY: DEEPA.T.P.
Bus Structures

Keywords to Remember
1. Bus
2. Data Bus
3. Address Bus
4. Control bus
5. Single Bus
6. Multi Bus
7. Buffer Register

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.4, PAGE NO: 9-10. Fig: 1.3(page:10) PREPARED BY: DEEPA.T.P.
Softwares
Set of instructions with deliverables
Types of Software
System Software
Application software
System software is a collection of programs to perform the following functions-
• Receiving and executing user commands
• Editing application programs and storing them in secondary memory.
• Managing and retrieving files from secondary storage.
• Running standard application programs.
• Controlling Input-Output devices.
• Translation of programs to machine instructions
• Linking and running user programs

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.4, PAGE NO: 9-10. Fig: 1.3(page:10) PREPARED BY: DEEPA.T.P.
Softwares (Contd…)

Activity 1
Source: https://www.thecrazyprogrammer.com/2016/04/difference-system-software-application-software.html PREPARED BY: DEEPA.T.P.
Softwares (Contd…)

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.5, PAGE NO: 9-10. Fig: 1.4(page:12) PREPARED BY: DEEPA.T.P.
Performance
Main Performance Measure
1. Speed
2. Elapsed time
3. Processor Time

Other Performance Factors


1. Processor Clock
2. Performance Equation
3. Pipelining and Superscalar Operations
4. Clock Rate
5. Instruction Set: CISC, RISC
6. Compiler
7. Performance Measurement
Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6, PAGE NO: 13-14. Fig: 1.5(page:13) PREPARED BY: DEEPA.T.P.
Processor Clock
1. Timing signal which controls the processor circuit.
2. It defines regular time intervals called as Clock Cycles.
3. Each action is divided into sequence of basic steps.
4. Each step is completed in one clock cycle.
5. Clock rate which is measured in cycles per second (hertz - Hz) and is given by,
𝟏
R=
𝑷
where, P is length of one clock cycle.
6. There are two ways to increase the clock rate-
1. Improve Integrated Circuits (IC)
2. Reduce the amount of processing done in one step

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.1, PAGE NO: 14. PREPARED BY: DEEPA.T.P.
Source: http://www.tambelanblog.com/2007/11/definitions-of-kilo-mega-giga-tera-peta.html
Basic Performance Equation

The program execution time is given by,

𝑵𝑿𝑺
𝑻=
𝑹
Where,
T is the processor time required to execute high level language program.
N is actual number of instructions in execution.
S is the average number of basic steps needed to execute one machine instruction.
R is the clock rate.
N,R,S are dependent parameters.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.1, PAGE NO: 14. PREPARED BY: DEEPA.T.P.
Instruction set – CISC and RISC

CISC – Complex Instruction set


RISC- Reduced Instruction set
1. Simple instructions require small number of basic steps to execute.
2. Complex instructions require large number of steps.
3. A Computer with simple instructions have to perform large number of instructions are
needed to perform a task. This will lead to large N and small value of S.
4. If individual instruction perform complex operations, fewer instructions are needed.
This will lower N and large value of S.
5. Solution is PIPELINING – Value of S is closer to 1.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.5, PAGE NO: 16-17. PREPARED BY: DEEPA.T.P.
Instruction set – CISC and RISC

1. Need for instruction set which has less steps for performing operations.
2. Two approaches to increase CPU performance
A. CISC – Complex Instruction set
Minimizes number of instructions per program but increases number of cycles per
instruction.
B. RISC- Reduced Instruction set
Reduces cycles per instructions but increases number of instructions per program.

Source: https://www.geeksforgeeks.org/computer-organization-risc-and-cisc/ PREPARED BY: DEEPA.T.P.


Instruction set – CISC and RISC

Characteristic of RISC – Examples of CISC


Simpler instruction, hence simple instruction decoding. MULT 2:3, 5:2
Instruction come under size of one word.
Instruction take single clock cycle to get executed.
Example of RISC
More number of general purpose register.
Simple Addressing Modes. LOAD A, 2:3
Less Data types. LOAD B, 5:2
Pipelining can be achieved. PROD A, B
Characteristic of CISC – STORE 2:3, A
Complex instruction, hence complex instruction decoding.
Instruction are larger than one word size.
Instruction may take more than single clock cycle to get executed.
Less number of general purpose register as operation get performed
in memory itself.
Complex Addressing Modes.
More Data types.
Source: https://www.geeksforgeeks.org/computer-organization-risc-and-cisc/
https://cs.stanford.edu/people/eroberts/courses/soco/projects/risc/risccisc/
PREPARED BY: DEEPA.T.P.
More Information: https://www.elprocus.com/difference-between-risc-and-cisc-architecture/
Compiler

1. Translate high level language into machine level language.


2. It is required to reduce the value of N.
3. Compiler rearrange program instructions to achieve better performance.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.6, PAGE NO: 17. PREPARED BY: DEEPA.T.P.
Compiler

1. Translate high level language into machine level language.


2. It is required to reduce the value of N.
3. Compiler rearrange program instructions to achieve better performance.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.6, PAGE NO: 17. PREPARED BY: DEEPA.T.P.
Performance Measurement

1. The Performance of computer is described by execution time T.


2. Performance measure is a time taken by computer to execute the benchmark programs.
3. System performance Evaluation Corporation (SPEC) selects and published benchmark programs
for different applications and their results for various computers.
4. The program is compiled in a computer which is under test and running time is measure on real-
time computer.
5. Example- For SPEC95, the reference is the SUN SPARC station 10/40, SPEC2000, it is UltraSPARC10
workstation.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.7, PAGE NO: 17. PREPARED BY: DEEPA.T.P.
Performance Measurement

𝑹𝒖𝒏𝒏𝒊𝒏𝒈 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒕𝒉𝒆 𝒓𝒆𝒇𝒆𝒓𝒆𝒏𝒄𝒆 𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓


SPEC Rating =
𝑹𝒖𝒏𝒏𝒊𝒏𝒈 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒕𝒉𝒆 𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓 𝒖𝒏𝒅𝒆𝒓 𝒕𝒆𝒔𝒕

SPEC Rating is 50% means, computer under test is 50 times faster than UltraSPARC10 for this
particular program (benchmark)
IF SPECi is the rating for program I in the suite, the overall SPEC rating for the computer is given by-

𝟏
𝒏 𝒏
𝑨 = ෑ 𝑺𝑷𝑬𝑪𝒊
𝒊=𝟏

Where, n is the number of programs in the suite.

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.6.7, PAGE NO: 18. PREPARED BY: DEEPA.T.P.
SPEC Rating Example

SPEC ratios are shown for the Pentium and the Pentium Pro (Pentium+) processors. What can
we learn from this information?

1. SPECint shows Pentium+ is 1.4 to 1.45 times faster than Pentium


2. SPECfp shows Pentium+ is 1.7 to 1.8 times faster than Pentium
3. 2.Clock rate of the Pentium doubles from 100 MHz to 200 MHz, the SPECint performance
improves by only 1.7 and SPECfp performance improves by only 1.46
Multiprocessor

1. Multiprocessor System – Large computer system contain


a number of processor units.
2. They execute subtasks of single large tasks in parallel.
3. Executes number of different application tasks in
parallel.
4. All processors can access to all the memory (Shared
Memory multiprocessor)
5. Increased complexity and cost.
6. Need for more interconnection networks to connect Source: https://www.geeksforgeeks.org/computer-
architecture-multiprocessor-and-multicomputer/

processors.
Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.7, PAGE NO: 18. PREPARED BY: DEEPA.T.P.
Multicomputer

1. Interconnection of complete computers with high


total computational power.
2. Computers have their own memory units.
3. Computers talk to each other by exchanging
messages.
4. Also known as Message Passing Multicomputer.

Source: https://www.geeksforgeeks.org/computer-
architecture-multiprocessor-and-multicomputer/

Source: TEXT NO:1, CHAPTER NO:1, TOPIC NO:1.7, PAGE NO: 19. PREPARED BY: DEEPA.T.P.
Exercise 1

Give a short sequence of machine instructions for the task “Add the contents of memory-location A to those
of location B and place the answer in location C. Instructions available to transfer data between memory and
the general purpose registers –
Load LOC , Ri
Store Ri, LOC
Solution :
1. Load A into loc using Load A, R0 Instructions are-
2. Load B into loc using Load B, R1 Load A, R0
3. Add A and B values in Registers R0 and R1 using Add R0,R1 Load B, R1
4. Store the result in C using Store R1, C Add R0,R1
Store R1, C

Source: TEXT NO:1, PROBLEMS: 1.3 a, Page No: 22


Exercise 2
For the following processor, obtain the performance.
Clock rate= 800MHz
No. of instructions executed = 1000
Average no. of steps needed/ machine instruction = 20

Solution :
The program execution time is given by,

𝑵𝑿𝑺
𝑻=
𝑹
here, N= 1000, S=20, R=800 X 10-6, Applying this in T, T= 1000 X 20 / (800 X 10-6)
T= 25 X 10-6 = 25 micro seconds

Source: TEXT NO:1, PROBLEMS: 1.3 a, Page No: 22


Exercise 3
List the steps needed to execute machine instruction:
Add R2, LOC
In terms of transfers between the components of processor and some simple control commands. Assume
that the address of the memory location containing this instruction is initially in register PC.

PC MAR R1
ALU
R2
Command MEMORY
R1+R2 in ALU R3
Word MDR
PC ALU
MDR IR
ALU= ALU + 1 PC
Source: TEXT NO:1, PROBLEMS: 1.1, Page No: 22
Exercise 4
A program contains 1000 instructions. Out of that 25% instructions requires 4 clock cycles, 40% of
instructions requires 5 clock cycles and remaining require 3 clock cycles for execution. Find the total time
required to execute the program running in a 1 GHz machine.
Solution:
N=1000, R= 1 X 109, S is different for various values of N.
NXS can be computed as –
25 % of N required 4 clock cycles, means 250 instructions require 4 clock cycles, NXS= 250 X 4
40 % of N requires 5 clock cycles, 400 instructions require 5 clock cycles, NXS= 400 X 5
Remaining 35% of N requires 3 clock cycles, NXS= 350 X 3
Therefore, total clock cycles required for 1000 instructions, NXS= (250X4) + (400 X 5) + (350 X 3)
Performance Equation,
𝑵𝑿𝑺
𝑻=
𝑹

T= (250X4) + (400 X 5) + (350 X 3) / 1 X 109 = 4.05 micro second


Source: VTU Lecture Notes
Assignment

1. Give a short sequence of machine instructions for the task “Add the contents of memory-location A to
those of location B and place the answer in location C. Instructions available to transfer data between
memory and the general purpose registers –
Move location1, location2
Add location1, location2

2. List the steps needed to execute machine instruction:


ADD R4, R2, R3
In terms of transfers between the components of processor and some simple control commands. Assume
that the address of the memory location containing this instruction is initially in register PC.

Source: TEXT NO:1, PROBLEMS: 1.3 b, 1.2, Page No: 22


Numeric Data Representation

– Positive Integers

– Zero included

– Unsigned Numbers

– Even sign is represented by binary


• O for positive

• 1 for negative

– Binary or decimal point

Source: TEXT NO:2, SECTION: 3.3 Page No: 77


Binary Point

1. Position of binary point is important

2. Two ways of positioning binary point in register

• By giving fixed position

• By using floating point representation

Source: TEXT NO:2, SECTION: 3.3 Page No: 77


Floating Point Representation

First register stores a position of decimal point.


Second register stores a number.
Floating point number has two parts
General structure is

OR

± m X r±e
Where, m is mantissa
r is radix
e is exponent

Source: TEXT NO:2, SECTION: 3.4 Page No: 83


Floating Point Representation
(Contd…)

Decimal Floating Point Representation


Consider a decimal floating point number –
• 0.0000976 can be represented as 9.76 X 10-5
• 97600000 can be represented as 9.76X107
Binary Floating Point Representation
• Consider binary number- Sign =0
1110111.10010
Mantissa= 110111110010
Exponent=110
• Can be represented as 1.11011110010
• Can be represented as 1.11011110010 X 26
1.11011110010 X 2110
Source: TEXT NO:2, SECTION: 3.4 Page No: 83
Normalization

A floating point number is NORMALIZED if its leftmost digit is “NON-ZERO”.


Example- Decimal number 550 is normalized
Decimal number 085 is not normalized

In Mantissa, the number is normalized only if left-most digit is NON-ZERO.

Example – 000101010 is NOT NORMALIZED

There are 3 Zeroes in the left-most digits. This can be normalized by shifting 3 Zeroes towards
left and discarding leading zeroes. Along with 23 for 3 shifts.
The normalized form is 101010000

Zero cannot be normalized (as there is no non-zero equivalent to it)

Source: TEXT NO:2, SECTION: 3.4 Page No: 83


More on Normalization

37.2510 = 100101.012 = 1.0010101 x 25

7.62510 = 111.1012 = 1.11101 x 22

0.312510 = 0.01012 = 1.01 x 2-2

Source: TEXT NO:2, SECTION: 3.4 Page No: 83


Understanding Floating Point Numbers

For example, 37.25 can be analyzed as:

101 100 10-1 10-2


Tens Units Tenths Hundredths
3 7 2 5

37.25 = (3 x 10) + (7 x 1) + (2 x 1/10) + (5 x 1/100)


Binary Equivalence

The binary equivalent of a floating point number


can be determined by computing the binary
representation for each part separately.
1) For the whole part:
Use subtraction or division method
previously learned.
2) For the fractional part:
Use the subtraction or multiplication
method (to be shown next)
Converting Mantissa or Whole part

Consider floating point number 28.125 in decimal, represented as (28.125)10 converted to ( )2

Lets represent the above number as 28 + 0.125, Now convert 28 into binary.

(28)10 = (11100)2

Now convert 0.125 into binary, 0.125 X 2 =0.250 mantissa is 0


0.250 X 2=0.500 mantissa is 0
0.500X2=1.000 mantissa is 1
Hence, (0.125)10 = (0.001)2

Therefore,

(28.125)10 converted to ( 11100.001 )2


Assignment

1. Find binary equivalent of 0.625

2. Convert 60.7510 into binary

3. Find binary equivalent of 190.562510


Fixed Point Representation

The position of Binary Point is fixed.

There are two positions-

– Towards extreme left of the register (to make number a fraction)

– Towards extreme right of the register (to make number an integer)

*Binary point is not physically present in the register, but its presence is
assumed.

Source: TEXT NO:2, SECTION: 3.3 Page No: 77


Storing Real Numbers

31 30 15 0
Sign Integer Fraction
1-bit 15-bits 16-bits
Fixed Point Representation

In Fixed Point Notation, the number is stored as a signed integer in two’s complement
format.
 Signed representation: range from
-(2(k-1)-1) to (2(k-1)-1), for k bits.

 1’s complement representation:


range from -(2(k-1)-1) to (2(k-1)-1),
for k bits.

 2’s complementation
representation: range from -(2(k-
1)) to (2(k-1)-1), for k bits.

Source: https://andybargh.com/fixed-and-floating-point-binary/#Fixed_Point_Representation
Text Books

Text No. Title Author(s) Publisher name Edition

Text 1 Computer Organization Carl Hamacher, ZvonksVranesic, SafeaZaky McGraw Hill 5

Text 2 Computer Systems Architecture M.Moris Mano Pearson/PHI 3


Unit-wise References

Unit No. Text Book Chapter No.


Text 1 1 (1.1 to 1.7)
1
Text 2 3 (3.3, 3.4)
2 Text 2 4 (4.1 to 4.7), 5 (5.1 to 5.7), 8 (8.3 to 8.8)
3 Text 2 7 (7.1 to 7.4) , 10 ( 10.2 to 10.7)
4 Text 1 5 (5.1 to 5.7 and 5.9)
5 Text 2 11 (11.1 to 11.8)
Pentium-4 Text 1 11.3.7
CPUSim http://www.cs.colby.edu/djskrien/CPUSim/
Wombat1, JVM https://www.revolvy.com/page/CPU-Sim

Athlon Processor http://www.cs.utah.edu/~wyman/classes/arch/athlon.html


*Faculty or Department is not responsible for any unauthorized references used by students.
It is advised to take suggestion from faculty before referring to any other materials than listed above here.

You might also like