Unit 3 - Computer Organization
Unit 3 - Computer Organization
Computer Organization
BCA , Sem - II
Computer Organization
• An instruction code is a group of bits that instruct the computer to perform a specific operation.
• The operation code of an instruction is a group of bits that define operations such as addition,
subtraction, shift, complement, etc.
• An instruction must also include one or more operands, which indicate the registers and/or
memory addresses from which data is taken or to which data is deposited.
• The instructions are stored in computer memory in the same manner that data is stored.
• The control unit interprets these instructions and uses the operations code to determine the
sequences of microoperations that must be performed to execute the instruction.
• The simplest design is to have one processor register (called the accumulator) and two fields in the
instruction, one for the opcode and one for the operand.
Opcode Operands
Instruction Codes
Computer Register
• Registers are a type of computer memory used to quickly accept, store, and transfer data and instructions that
are being used immediately by the CPU.
• The registers used by the CPU are often termed as Processor registers.
• A processor register may hold an instruction, a storage address, or any data
• The computer needs processor registers for manipulating data and a register for holding a memory address.
• The register holding the memory location is used to calculate the address of the next instruction after the
execution of the current instruction is completed. Memory Location Instruction
PC 0001 H
0002
Memory Location Instruction
0003
Next : 001C 0004
001D 0005 H Call Next
001E 0006
001F RET 0007
Computer Register
Computer Register
Computer Instructions
• Computer instructions are a set of machine language instructions that a particular processor understands and executes.
• A computer performs tasks on the basis of the instruction provided.
• An instruction comprises of groups called fields. These fields include:
✓ The Operation code (Opcode) field which specifies the operation to be performed.
✓ The Address field which contains the location of the operand, i.e., register or memory location.
✓ The Mode field which specifies how the operand will be located.
• The timings for all the registers is controlled a master clock generator.
• Its pulses are applied to all flip-flops and registers, including in the control unit.
• There are two types of control:
➢ Hardwired – control logic is implemented with gates, flip-flops, decoders and other digital circuits.
➢ Microprogrammed – control information is stored in a control program, which is programmed to perform the
necessary steps to implement instructions.
Instruction Cycle
• The instructions of a program are carried out by a process called the instruction cycle.
• The instruction cycle consists of these phases:
1. Fetch an instruction from memory
2. Decode the instruction
3. Read the effective address from memory / Fetch the operand
4. Execute the instruction.
Instruction Cycle
• Initially, the PC has stored the address of the instruction about to be executed and the SC is cleared to 0.
• With each clock pulses the SC is incremented and the timing signals go through the sequence T0 , T1 , T2 , etc.
• It is necessary to load the AR with the PC’s address (it is connected to memory address inputs):
• T0 : AR ¬ PC Fetch and Decode
• Subsequently, as we fetch the instruction to be executed, we must increment the program counter so that it
points to the next instruction:
• T1 : IR ¬ M[AR], PC ¬ PC + 1
• In order to carry out the instruction, we must decode and prepare to fetch the operand
• During time T3 , the control unit determines if this is a memory-reference, register-reference or input/output
instruction
Machine Language
• Machine language is a collection of binary digits or bits that the computer reads and interprets.
• Machine language is the only language a computer is capable of understanding.
• It is also called as machine code or object code
• Machine language is a low-level language that machines understand but that humans can decipher using an assembler.
• A compiler plays an important role between humans and computers as it converts machine language into other code or
language that is understandable by humans.
Assembly Language