Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
13 views21 pages

Unit 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 21

Computer Organization and Architecture

INTRODUCTION

Computer architecture acts as the interface between the hardware and the lowest level
software. Computer architecture refers to:
Attributes of a system visible to programmers like data type of variables.
Attributes that have a direct impact on the execution of programs like clock
cycle.

“ Computer Architecture is defined as study of the structure, behavior, and


design 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. The attributes in computer organization refers to:
1. Computer/peripheral interface
2. Control signals
3. Memory technology
Computer hardware: Consists of electronic circuits, displays, magnetic and
optical storage media, electromechanical equipment and communication
facilities.
Computer Architecture: It is concerned with the structure and behavior of the
computer. It includes the information formats, the instructionset and
techniques foraddressing memory.
The attributes in computer architecture refers to the:
1. Instruction set
2. Data representation
3. I/O mechanisms
4. Addressing techniques
Unit 1
Syllabus:
Basic functional blocks of a computer: CPU, memory, input-output
subsystems, control unit. Instructions: Operations and Operands,
Representing instructions, Logical operations, control operations, Basic
organization of computing machine: fetch, decode, and execute, execution
cycle, addressing modes.

FUNCTIONAL UNIT

A computer consists of five functionally independent main parts input,


memory, arithmetic logic unit (ALU), output and control unit.

Fig: Functional units of computer

Input device accepts the coded information as source program i.e. high level
language. This is either stored in the memory or immediately used by the processor
to perform the desired operations. The program stored in the memory determines the
processing steps. Basically the computer converts one source program to an object
program i.e. into machine language. Finally the results are sent to the outside world
through output device. All of these actions are coordinated by the control unit.
Input unit: -The source program/high level language program/coded information/simply
data is fed to a computer through input devices keyboard is a most common type. Whenever
a key is pressed, one corresponding word or number is translated into its equivalent
binary code over a cable & fed either to memory or processor. Joysticks, trackballs,
mouse, scanners etc are other input devices.
Memory unit: -
Its function into store programs and data. It is basically to two types
1. Primary memory
2. Secondary memory

Word:
In computer architecture, a word is a unit of data of a defined bit length that can
be addressed and moved between storage and the computer processor. Usually, the
defined bit length of a word is equivalent to the width of the computer's data bus
so that a word can be moved in a single operation from storage to a processor register.
For any computer architecture with an eight-bit byte, the word will be some multiple
of eight bits. In IBM's evolutionary System/360 architecture, a word is 32 bits,
or four contiguous eight-bit bytes. In Intel's PC processor architecture, a word is
16 bits, or two contiguous eight-bit bytes. A word can contain a computer instruction,
a storage address, or application data that is to be manipulated (for example, added
to the data in another word space).
The number of bits in each word is known as word length. Word length refers to the
number of bits processed by the CPU in one go. With modern general purpose computers,
word size can be 16 bits to 64 bits. The time required to access one word is called
the memory access time. The small, fast, RAM units are called caches. They are tightly
coupled with the processor and are often contained on the same IC chip to achieve high
performance.

1. Primary memory: - It is a fast memory that operates at electronic speeds.


Programs must be stored in the memory while they are being executed. The
memorycontains largeno of semiconductor storage cells. Each cell carries 1 bit
of information. The cells are processed in a group of fixed size called Words.
To provide easy access to any word in a memory, a distinct address is associated
with each word location. Addresses are numbers that identify successive
locations. The number of bits in each word is called the word length. The word
length ranges from 16 to 64 bits. There are 3 types of primary memory:
a. 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.
b. Cache Memory: The small, fast, RAM units are called Cache. They are
tightly coupled with processor to achieve high performance.
c. Main Memory: The largest and the slowest unit is the main memory.
2.Secondary memory: - Is used where large amounts of data & programs have to be stored,
particularly information that is accessed infrequently.
Examples: - Magnetic disks & tapes, optical disks (ie CD-ROM’s), floppies etc.,

Arithmetic logic unit (ALU):-


Most of the computer operators are executed in ALU of the processor like
addition, subtraction, division, multiplication, etc. the operands are brought into
the ALU from memory and stored in high speed storage elements called register. Then
according to the instructions the operation is performed in the required sequence.
The control and the ALU are may times faster than other devices connected to a computer
system. This enables a single processor to control a number of external devices such
as key boards, displays, magnetic and optical disks, sensors and other mechanical
controllers.

Output unit:-
These actually are the counterparts of input unit. Its basic function is to
send the processed results to the outside world.
Examples:- Printer, speakers, monitor etc.

Control unit:-
It effectively is the nerve center that sends signals to other units and senses
their states. The actual timing signals that govern the transfer of data between input
unit, processor, memory and output unit are generated by the control unit.

BASIC OPERATIONAL CONCEPTS

To perform a given task an appropriate program consisting of a list of instructions


is stored in the memory. Individual instructions are brought from the memory into
the processor, which executes the specified operations. Data to be stored are also
stored in the memory.
Examples: - Add LOCA, R0
This instruction adds the operand at memory location LOCA, to operand in
register R0 & places the sum into register. This instruction requires the performance

of several steps,

1. First the instruction is fetched from the memory into the processor.
2. The operand at LOCA is fetched and added to the contents of R0
3. Finally the resulting sum is stored in the register R0

The preceding add instruction combines a memory access operation with an ALU
Operations. In some other type of computers, these two types of operations are
performed by separate instructions for performance reasons.

Load LOCA, R1 Add


R1, R0
Transfers between the memory and the processor are started by sending the
address of the memory location to be accessed to the memory unit and issuing the
appropriate control signals. The data are then transferred to or from the memory.

The fig shows how memory & the processor can be connected. In addition to the
ALU & the control circuitry, the processor contains a number of registers used
for several different purposes.

Register:
It is a special, high-speed storage area within the CPU. All data must be
represented in a register before it can be processed. For example, if two numbers
are to be multiplied, both numbers must be in registers, and the result is also placed
in a register. (The register can contain the address of a memory location where data
is stored rather than the actual data itself.) The number of registers that a CPU
has and the size of each (number of bits) help determine the power and speed of a
CPU. For example a 32-bit CPU is one in which each register is 32 bits wide.
Therefore, each CPU instruction can manipulate 32 bits of data. In high-level
languages, the compiler is responsible for translating high-level operations into
low-level operations that access registers.

INSTRUCTIONS

An instruction is a binary code, which specifies a basic operation for the computer.
 Operation Code (opcode) defines the operation type. Operands define the
operationsource and destination.
 Instruction Set Architecture (ISA) describes the processor in terms of what
the assembly language programmer sees, i.e. the instructions and registers.

Instruction Format:

Computer instructions are the basic components of a machine language program. They
are also known as macro operations, since each one is comprised of sequences of micro
operations.
Each instruction initiates a sequence of micro operations that fetch operands from
registers or memory, possibly perform arithmetic, logic, or shift operations, and
store results in registers or memory. Instructions are encoded as binary instruction
codes. Each instruction code contains of a operation code, or opcode, which
designates the overall purpose of the instruction (e.g. add, subtract, move, input,
etc.). The number of bits allocated for the opcode determined how many different
instructions the architecture supports.
In addition to the opcode, many instructions also contain one or more operands, which
indicate where in registers or memory the data required for the operation is located.
For example, and add instruction requires two operands, and a not instruction requires
one.
15 12 11 6 5 0
+----------------------- +
| Opcode | Operand | Operand |
+----------------------- +

The opcode and operands are most often encoded as unsigned binary numbers in order
to minimize the number of bits used to store them. For example, a 4-bit opcode encoded
as a binary number could represent up to 16 different operations.
The control unit is responsible for decoding the opcode and operand bits in the
instruction register, and then generating the control signals necessary to drive all
other hardware in the CPU to perform the sequence of micro operations that comprise
the instruction.
INSTRUCTION CYCLE:

The instruction register (IR):- Holds the instructions that are


currently being executed. Its output is available for the control
circuits which generates the timing signals that control the various
processing elements in one execution of instruction.

The program counter PC:-


This is another specialized register that keeps track of
execution of a program. It contains the memory address of the next
instruction to be fetched and executed.

Besides IR and PC, there are n-general purpose registers R0


through Rn-1.

The other two registers which facilitate communication with memory are:
-
1. MAR – (Memory Address Register):- It holds the address of
the location to be accessed.
2. MDR – (Memory Data Register):- It contains the data to be
written into or read out of the address location.
Operating steps are
1. Programs reside in the memory & usually get these through the I/P
unit.
2. Execution of the program starts when the PC is set to point at
the first instruction of the program.

3. Contents of PC are transferred to MAR and a Read Control Signal


is sent to the memory.

4. After the time required to access the memory elapses, the


address word is read out of the memory and loaded into the MDR.
5. Now contents of MDR are transferred to the IR & now the
instruction is ready to be decoded and executed.
6. If the instruction involves an operation by the ALU, it is
necessary to obtain the required operands.
7. An operand in the memory is fetched by sending its address
to MAR & Initiating a read cycle.
8. When the operand has been read from the memory to the MDR, it
is transferred from MDR to the ALU.
9. After one or two such repeated cycles, the ALU can perform the
desired operation.
10. If the result of this operation is to be stored in the memory,
the result is sent to MDR.
11. Address of location where the result is stored is sent to
MAR & a write cycle is initiated.
12. The contents of PC are incremented so that PC points to the next
instruction that is to be executed.

ADDRESSING MODES
1. Implied / Implicit Addressing Mode
2. Stack Addressing Mode
3. Immediate Addressing Mode
4. Direct Addressing Mode
5. Indirect Addressing Mode
6. Register Direct Addressing Mode
7. Register Indirect Addressing Mode
8. Relative Addressing Mode
9. Indexed Addressing Mode
10.Base Register Addressing Mode
11.Auto-Increment Addressing Mode
12.Auto-Decrement Addressing Mode

1. Implied Addressing Mode-

In this addressing mode,

 The definition of the instruction itself specify the operands


implicitly.
 It is also called as implicit addressing mode.
Examples-
The instruction “ Complement Accumulator ” is an implied mode
instruction.

 In a stack organized computer, Zero Address Instructions are


implied mode instructions.

(since operands are always implied to be present on the top of the stack)

2. Stack Addressing Mode-

In this addressing mode,

 The operand is contained at the top of the stack.

Example-

ADD

 This instruction simply pops out two symbols contained at the top
of the stack.
 The addition of those two operands is performed.
 The result so obtained after addition is pushed again at the top
of the stack.

3. Immediate Addressing Mode-

In this addressing mode,

 The operand is specified in the instruction explicitly.


 Instead of address field, an operand field is present that contains
the operand.

Examples-

ADD 10 will increment the value stored in the accumulator by 10.

 MOV R #20 initializes register R to a constant value 20.

4. Direct Addressing Mode-


In this addressing mode,

The address field of the instruction contains the effective address of


the operand.

 Only one reference to memory is required to fetch the operand.


 It is also called as absolute addressing mode.

Example-

ADD X will increment the value stored in the accumulator by the value
stored at memory location X.

AC ← AC + [X]

5. Indirect Addressing Mode-

In this addressing mode,

 The address field of the instruction specifies the address of memory


location that contains the effective address of the operand.
 Two references to memory are required to fetch the operand.

Example-

ADD X will increment the value stored in the accumulator by the value
stored at memory location specified by X.
AC ← AC + [[X]]

6. Register Direct Addressing Mode-

In this addressing mode,

 The operand is contained in a register set.


 The address field of the instruction refers to a CPU register that
contains the operand.
 No reference to memory is required to fetch the operand.

Example-

ADD R will increment the value stored in the accumulator by the content
of register R.

AC ← AC + [R]

7. Register Indirect Addressing Mode-

In this addressing mode,

 The address field of the instruction refers to a CPU register that


contains the effective address of the operand.
 Only one reference to memory is required to fetch the operand.

Example-
ADD R will increment the value stored in the accumulator by the content
of memory location specified in register R.

AC ← AC + [[R]]

8. Relative Addressing Mode-

In this addressing mode,

 Effective address of the operand is obtained by adding the content


of program counter with the address part of the instruction.

Effective Address

= Content of Program Counter + Address part of the instruction

9. Indexed Addressing Mode-

In this addressing mode,

 Effective address of the operand is obtained by adding the content


of index register with the address part of the instruction.

Effective Address

= Content of Index Register + Address part of the instruction


10. Base Register Addressing Mode-

In this addressing mode,

 Effective address of the operand is obtained by adding the content


of base register with the address part of the instruction.

Effective Address

= Content of Base Register + Address part of the instruction

11. Auto-Increment Addressing Mode-

This addressing mode is a special case of Register Indirect Addressing


Mode where-
Effective Address of the Operand

= Content of Register

In this addressing mode,

 After accessing the operand, the content of the register is


automatically incremented by step size ‘d’.
 Step size ‘d’ depends on the size of operand accessed.
 Only one reference to memory is required to fetch the operand.
 Example-

Assume operand size = 2 bytes.

Here,

 After fetching the operand 6B, the instruction register RAUTO will
be automatically incremented by 2.
 Then, updated value of RAUTO will be 3300 + 2 = 3302.
 At memory address 3302, the next operand will be found.

12. Auto-Decrement Addressing Mode-

This addressing mode is again a special case of Register Indirect


Addressing Mode where-

Effective Address of the Operand

= Content of Register – Step Size

In this addressing mode,

 First, the content of the register is decremented by step size ‘d’.


 Step size ‘d’ depends on the size of operand accessed.
 After decrementing, the operand is read.
 Only one reference to memory is required to fetch the operand.

Example-

Assume operand size = 2 bytes.

Here,

 First, the instruction register RAUTO will be decremented by 2.


 Then, updated value of RAUTO will be 3302 – 2 = 3300.
 At memory address 3300, the operand will be found.

THE VON NEUMANN ARCHITECTURE

The task of entering and altering programs for the ENIAC was extremely
tedious. The programming process can be easy if the program could be
represented in a form suitable for storing in memory alongside the data.
Then, a computer could get its instructions by reading them from memory,
and a program could be set or altered by setting the values of a portion
of memory. This idea is known a the stored-program concept. The first
publication of the ideawas in a 1945 proposal by von Neumann for a new
computer, the EDVAC (Electronic Discrete Variable Computer).
In 1946, von Neumann and his colleagues began the design of a
new stored-program computer, referred to as the IAS computer, at the
Princeton Institute for Advanced Studies. The IAS computer, although
not completed until 1952, is the prototype of all subsequent
general-purpose computers.
It consists of
 A main memory, which stores both data and instruction
 An arithmetic and logic unit (ALU) capable of operating on binary
data
 A control unit, which interprets the instructions in memory
and causes them to be executed
 Input and output (I/O) equipment operated by the control unit

Question Bank
1. Explain the Basic Functional units of Computer.
2. Explain the Block Diagram of Computer System.
3. Explain Primary Storage and Secondary Storage.
4. What is meant by Instruction in Computer Architecture?
5. What are Instruction Codes and Operands in Computer Architecture?
6. What is instruction cycle? Explain in detail.
7. What is Logical Operations?
8. What is Controlled Operations?
9. Explain the addressing modes in Computer Architecture?
10. Explain General Structure of the VON NEUMANN Architecture.

You might also like