Unit 1
Unit 1
Unit 1
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.
FUNCTIONAL UNIT
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.
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.
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.
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 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.
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
(since operands are always implied to be present on 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.
Examples-
Example-
ADD X will increment the value stored in the accumulator by the value
stored at memory location X.
AC ← AC + [X]
Example-
ADD X will increment the value stored in the accumulator by the value
stored at memory location specified by X.
AC ← AC + [[X]]
Example-
ADD R will increment the value stored in the accumulator by the content
of register R.
AC ← AC + [R]
Example-
ADD R will increment the value stored in the accumulator by the content
of memory location specified in register R.
AC ← AC + [[R]]
Effective Address
Effective Address
Effective Address
= Content of Register
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.
Example-
Here,
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.