0% found this document useful (0 votes)
11 views28 pages

Merged PDF 20240627 01.49.57

Uploaded by

Kaunghtet Sween
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views28 pages

Merged PDF 20240627 01.49.57

Uploaded by

Kaunghtet Sween
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

CST-3041

Computer Architecture and Organization - I


Chapter 1

Computing and Computers


Chapter Outlines

1.1 The Nature of Computing


1.2 The Evolution of Computers
1.3 The VLSI Era
1.1 The Nature of Computing

• Throughout history humans have relied mainly on their brains to perform calculation; in other words, they
were the computers.
• As civilization advanced, a variety of computing tools were invented that aided, but did not replace, manual
computation.
• The earliest people used their fingers, pebbles (stone), or tally sticks for counting purposes.
• The early computational aids that were widely used until quite recently are:
 the abacus
 slide rule
• An abacus is a mechanical device used to aid an individual in performing mathematical calculations.
1.1 The Nature of Computing

0 1 2 3 4 5 6 7 8 9 0

Figure 1 Japanese abacus (soroban) displaying the number 01234567890


1.1.1 The Elements of Computers

The brain versus the computer

Central
processing
unit
Program Instructions Main Input-
control memory output
equipment
Arithmetic-
logic unit Data

(b)

(a)

Figure 2 Main components of (a) human computation and (b) machine computation
1.1.1 The Elements of Computers

The brain versus the computer


• A computer has several key components that roughly correspond to Figure 2(b).
• The main memory corresponds to the paper used in the manual calculation.
• Its purpose is to store instructions and data.
• The computer 's brain is its central processing unit (CPU).
• It contains a program control unit (also known as an instruction unit) whose function is to fetch instructions
from memory and interpret them.
• An arithmetic-logic unit (ALU), which is part of the CPU's data-processing or execution unit, carries out the
instructions.
• The ALU is so called because many instructions specify either arithmetic (numerical) operations or various
forms of nonnumerical operations that loosely correspond to logical reasoning or decision making.
1.1.1 The Elements of Computers

An abstract computer
• In 1930, Alan M. Turing introduced an abstract model of a computer, called a Turing machine, has the
structure shown in Figure 3.
• Two essential elements of computer are a memory and a processor.
• The memory is a tape M.
• The machine’s tape is of unbounded length and is divided lengthwise into squares.
• Each square can be blank, or it can contain one of a small set of symbols.

Processor P
Figure 3 A Turing machine
Read-write head
Memory tape
M
1.1.1 The Elements of Computers

Turing Machine
• Four-part format
Sh Ti Oj Sk
• If oldstate = Sh and input = Ti then output = Oj and newstate = Sk;
• The output operation indicated by Oj can be any one of the following:
1. Oj = Tj, meaning write the symbol Tj on the tape to replace the symbol Ti.
2. Oj = R, meaning move the tape so that the read-write head is over the square to the right of the
current square.
3. Oj = L, meaning move the tape so that the read-write head is over the square to the left of the current
square.
4. Oj = H, meaning halt the computation.
Example 1.1

A Turing Machine To Add Two Unary Numbers


...bbb111...1b111...1bbb...

n1 n2 Table 1
Turing machine program to add two unary numbers

Instruction Comment
...bb111b11bb...
S0 b R S1 Move read-write head one square to right.
S1 1 R S1 Move read-write head rightward across n1.
n1 n2 S1 b 1 S2 Replace blank between n1 and n2 by 1.
S2 1 L S2 Move read-write head leftward across n1.
S2 b R S3 Blank square reached; move one square to right.
S3 1 b S3 Replace left-most 1 by blank.
S3 b H S3 Halt; the result n1 + n2 is now on the tape.
1.2 The Evolution of Computers

• The result pattern is

. . . b b b b 1 1 1 . . . 11 1 1 . . . 1 b b b . . .

n1 + n2
Example 1.3

Computing x2 by the method of differences

j = xj: 1 2 3 4 5 6
Initial values
y j  x 2j : 1 y1 1 yj register
4 9 16 25 36
+ Adder

First difference  y j :
1
3 5 7 9 11 13 1y1  3 1 y j register

+ Adder

Second difference  y j :
2 2y1  2 2 y j register
2 2 2 2 2 2
(a) (b)

Figure 4 Computing x2 by the method of differences: (a) a representative computation and (b) the corresponding Difference Engine
configuration
Example 1.5

A Nonstandard Architecture: Stack Computers


• Essential of a stack processor of
z:= w + 3 × (x – y)

Program
...
PUSH W
PUSH 3 Control Arithmetic-
PUSH X unit logic unit
PUSH Y SP
SUBTRACT
MULTIPLY Stack pointer ... Top of stack TOS
ADD
Stack
POP Z
Figure 5 (a) Essentials of a stack processor
Example 1.5

A Nonstandard Architecture: Stack Computers


... ... ... ...
Z Z Z Z
TOS y
TOS x x
TOS 3 3 3
TOS w w w w
... ... ... ...
PUSH W PUSH 3 PUSH X PUSH Y
Figure 5 (b) stack states
... ... ... ... during the execution of
Z Z Z Z w  3  (x  y) z := w + 3 × (x – y )

TOS x–y
3 TOS 3 (x  y)
w w TOS w  3  (x  y) TOS w  3  (x  y)
... ... ... ...
SUBTRACT MULTIPLY ADD POP Z
Example 1.5

A Nonstandard Architecture: Stack Computers


• A stack computer evaluates arithmetic and other expressions using a format known as Polish notation.
• Instead of placing an operator between its operands as in x + y, the operator is places to the right of its
operands as in x y +.
• A more complex expression such as
z := w + 3 × (x – y ) becomes
z w 3 x y – × + :=
1.3 The VLSI Era

Performance Measures
The CPU's processing of an instruction involves several steps, each of which requires at least one clock cycle:
• Fetch the instruction from main memory M.
• Decode the instruction's opcode.
• Load (read) from M any operands needed unless they are already in CPU registers.
• Execute the instruction via a register-to-register operation using an appropriate functional unit of the CPU,
such as a fixed-point adder.
• Store (write) the results in M unless they are to be retained in CPU registers.
1.3 The VLSI Era

Performance Measures
Suppose that execution of a particular benchmark program (measuring the run time) or set of such programs Q on
a given CPU takes T seconds and involves the execution of a total of N instructions, where N is the actual number
of instructions executed, including repeated executions of the same instruction, it is not the number of instructions
appearing in Q.
IPS = average number of instructions
1
T executed per second
f CPI = average number of cycles per
N instruction
T T = program execution time
IPS
MIPS = millions of instructions executed per
f  10 6
second
CPI 
IPS MIPS  IPS  106
N  CPI
T MIPS 
f
f  106 CPI
1.3 The VLSI Era

Table 1
Some important speedup features of modern computers

Feature Objective Description


Cache memory To provide the CPU with faster access to A cache is a memory unit inserted between the CPU and main
instructions and data. memory M. It is faster than M but has less storage capacity.
Pipelined To increase performance by allowing the The CPU is constructed from independent subunits (stages), which
processing processing of several instructions to be can hold several instructions in different stages of execution.
partially overlapped.
Superscalar To increase performance by allowing several Multiple (pipelined) units are provided for instruction processing.
processing instructions to be processed in parallel (full Instructions can be issued simultaneously to each unit.
overlapping).
1.3 The VLSI Era

Instruction I1
Instruction I2 Instruction I3

Instruction fetch IF: IF1 IF2 IF3


Instruction decode ID: ID1 ID2 ID3

Operand load OL: OL1 OL2 OL3

Execution EX: EX1 EX 2 EX3


Operand Store OS: OS1 OS 2 OS3

Time(clock cycles): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Figure 6 (a) Instruction processing: sequential or nonpipelined


1.3 The VLSI Era

Instruction fetch IF: IF 1 IF 2 IF 3


Instruction decode ID: ID 1 ID 2 ID 3
Operand load OL: OL 1 OL 2 OL 3
Execution EX: EX1 EX 2 EX 3
Operand Store OS: OS 1 OS 2 OS 3
Time(clock cycles): 1 2 3 4 5 6 7

Figure 6 (a) Instruction processing: pipelined


Reference:

Computer Architecture and Organization Third Edition by John P. Hayes

You might also like