Professional Documents
Culture Documents
Computer Organization: Lecture - 7
Computer Organization: Lecture - 7
Lecture – 7
1
Instruction codes
Stored program organization
Direct and Indirect Address
Computer Registers
2
Instructions Codes
Prgoram: A program is a set of instructions
that specify the operations, operands and
sequence by which processing has to occur.
3
Instructions Codes
Instruction Code: It is a group of bits that
instruct the computer to perform
Instruction code = opcode + memory
address.
It is not the micro-operation.
In terms of programming, it is closest to a
single assembly language instruction.
4
Instructions Codes
Opcode: It is a group of bits that define
operation such as ADD , SUB, MUL, Shift
and Compliment.
Memory Address: It is the address of
operand, on which operation has to be
performed.
Example: ADD B
MOV X
Where B and X are operands, their address will be given in
instruction.
5
Stored Program Organization
The simplest way to organize computer is to
have:
(i) One processor register
(ii) Instruction code format
6
Instructions Codes
7
Stored Program Organization
Instructions are stored in one section of memory
and data is stored in another section of memory.
For a memory of 4096 words we need 12 bits to
specify an address, since 212 = 4096
If we store each instruction code in one 16-bit
memory word, we have available four bits for
the opcode to specify the one out of 16-possible
operations, and 12-bits to specify the address of
the operand
8
Stored Program Organization
The control unit reads 16-bit instruction
from the program portion of memory.
It uses 12-bit address part of instruction
to read 16-bit operand from the data
portion of memory.
It then executes the operation specified by
the operation code.
9
Stored Program Organization
Accumulator (AC): Computer have single
process register usually assigned the name
Accumulator (AC).
The operation is performed with the memory
operand and the contents of AC.
Some times the operation do not require operand
from memory, for example, Clear AC,
Compliment AC, Increment AC, then second part
is used to specify other operations on computer.
10
Indirect Address
Instruction
Op-Code Operand
Op-Code Address of operand
Op-Code Address of memory word
where address of operand
can be found
11
Indirect Address
12
Indirect Address
13
Indirect Address
The indirect address instruction needs two
references to memory to fetch an operand
Effective address – the address from
where operand can directly be obtained
One bit of instruction code is used to
distinguish between direct and an indirect
address
14
Computer Registers
Usually computer needs number of
registers for manipulating data and
holding memory addresses.
15
Computer Registers
16
Computer Registers
17