Computer Organization
Chapter 3
BCA , Sem - II
• Computer Organization is realization of what is specified by the computer architecture .
• It deals with how operational attributes are linked together to meet the requirements specified by computer architecture.
• Some organizational attributes are hardware details, control signals, peripherals.
Computer Organization
Computer Architecture Vs Organization
Instruction Codes
• 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
0001 H
0002
0003
0004
0005 H Call Next
0006
0007
PC
Memory Location Instruction
001C
001D
001E
001F RET
Next :
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.
A basic computer has three instruction code formats which are:
1. Memory - reference instruction
2. Register - reference instruction
3. Input-Output instruction
Computer Instructions
Memory - reference instruction
In Memory-reference instruction, 12 bits
of memory is used to specify an address
and one bit to specify the addressing
mode 'I'.
Register - reference instruction
The Register-reference instructions are
represented by the Opcode 111 with a 0 in the
leftmost bit (bit 15) of the instruction.
Input-Output instruction
Just like the Register-reference instruction, an
Input-Output instruction does not need a
reference to memory and is recognized by the
operation code 111 with a 1 in the leftmost bit
of the instruction. The remaining 12 bits are
used to specify the type of the input-output
operation or test performed.
Timing & Control
• 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.
• 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
Instruction Cycle
• 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.
Machine Language
• An assembly language is a low-level programming language.
• Sometimes referred to as assembly or ASM
• Programs written in assembly languages are compiled by an assembler.
• Every assembler has its own assembly language, which is designed for one specific computer architecture.
• Using ASM, programmers can write human-readable programs that correspond almost exactly to machine language.
• The disadvantage is that everything the computer does must be described explicitly, in precise detail.
• The advantage is that the programmer has maximum control over what the computer is doing.
• An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the
computer's processor can use to perform its basic operations
Assembly Language

Unit 3 - Computer Organization .pdf

  • 1.
  • 2.
    • Computer Organizationis realization of what is specified by the computer architecture . • It deals with how operational attributes are linked together to meet the requirements specified by computer architecture. • Some organizational attributes are hardware details, control signals, peripherals. Computer Organization
  • 3.
  • 4.
    Instruction Codes • Aninstruction 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
  • 5.
  • 6.
    Computer Register • Registersare 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 0001 H 0002 0003 0004 0005 H Call Next 0006 0007 PC Memory Location Instruction 001C 001D 001E 001F RET Next :
  • 7.
  • 8.
  • 9.
    Computer Instructions • Computerinstructions 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. A basic computer has three instruction code formats which are: 1. Memory - reference instruction 2. Register - reference instruction 3. Input-Output instruction
  • 10.
    Computer Instructions Memory -reference instruction In Memory-reference instruction, 12 bits of memory is used to specify an address and one bit to specify the addressing mode 'I'.
  • 11.
    Register - referenceinstruction The Register-reference instructions are represented by the Opcode 111 with a 0 in the leftmost bit (bit 15) of the instruction.
  • 12.
    Input-Output instruction Just likethe Register-reference instruction, an Input-Output instruction does not need a reference to memory and is recognized by the operation code 111 with a 1 in the leftmost bit of the instruction. The remaining 12 bits are used to specify the type of the input-output operation or test performed.
  • 13.
    Timing & Control •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.
  • 14.
    Instruction Cycle • Theinstructions 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.
  • 15.
    • Initially, thePC 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 Instruction Cycle
  • 16.
    • Machine languageis 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. Machine Language
  • 17.
    • An assemblylanguage is a low-level programming language. • Sometimes referred to as assembly or ASM • Programs written in assembly languages are compiled by an assembler. • Every assembler has its own assembly language, which is designed for one specific computer architecture. • Using ASM, programmers can write human-readable programs that correspond almost exactly to machine language. • The disadvantage is that everything the computer does must be described explicitly, in precise detail. • The advantage is that the programmer has maximum control over what the computer is doing. • An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer's processor can use to perform its basic operations Assembly Language