CO Design
CO Design
Organization
• In general terms, the architecture of a
computer system can be considered as a
catalogue of tools or attributes that are
visible to the user such as instruction sets,
number of bits used for data, addressing
techniques, etc.
Definition
• Whereas, Organization of a computer system
defines the way system is structured so that
all those catalogued tools can be used. The
significant components of Computer
organization are ALU, CPU, memory and
memory organization.
Computer Architecture Computer Organization
Computer Architecture is concerned with the way Computer Organization is concerned with the structure
hardware components are connected together to form a and behaviour of a computer system as seen by the user.
computer system.
It acts as the interface between hardware and software. It deals with the components of a connection in a system.
Computer Architecture helps us to understand the Computer Organization tells us how exactly all the units
functionalities of a system. in the system are arranged and interconnected.
A programmer can view architecture in terms of Whereas Organization expresses the realization of
instructions, addressing modes and registers. architecture.
While designing a computer system architecture is An organization is done on the basis of architecture.
considered first.
Computer Architecture deals with high-level design Computer Organization deals with low-level design
issues. issues.
Architecture involves Logic (Instruction sets, Addressing Organization involves Physical Components (Circuit
modes, Data types, Cache optimization) design, Adders, Signals, Peripherals)
• A computer instruction is a binary code that
specifies a sequence of microoperations for the
computer. The instruction code with the data
Instruction stored in memory.
• Generally, we can categorize instruction codes
Codes in and addresses into operation codes(Opcodes)
Computer and addresses. Opcodes specify how to perform
a specific instruction. An address specifies
Architecture which we should use- a register or an area, for a
particular action. Operands are precise
computer instructions that show what
information the computer requires to function.
What is the Instruction Code?
• Instruction codes are bits that instruct the computer to execute a
specific operation. An instruction comprises groups called fields.
These fields include:
• An instruction comprises groups called fields. These fields include:
• The Operation code (Opcode) field determines the process that needs
to perform.
• The Address field contains the operand's location, i.e., register or
memory location.
OPCODE
• The Opcode define operations such as add, subtract, etc.
• The Opcode must consist with n bits for a given 2^n distinct
operation.
• When this operation code is decoded in the control unit the computer
issues signals to read an operand from memory and add the operand
to processor register.
Stored Program
Organization
Structure of an Instruction Code
Indirect
Addressing
Lecture-Register
Computer Registers
• Operand(s): The operand(s) represents the data that the operation must be performed on. This data can take
various forms, depending on the processor's architecture. It might be a register containing a value, a memory
address pointing to a location in memory where the data is stored, or a constant value embedded within the
instruction itself.
• Addressing mode: The addressing mode represents how the operand(s) can be interpreted. It might indicate that
the operand is a direct address in memory, an indirect address (i.e. a memory address stored in a register), or an
immediate value (i.e. a constant embedded within the instruction).
• Prefixes or modifiers: Some instruction sets may include additional prefixes or modifiers that modify the
behavior of the instruction. For example, they may specify that the operation should be performed only if a
specific condition is met or that the instruction should be executed repeatedly until a specific condition is met.
Types of Instruction Code
There are various types of instruction codes. They are classified based on
the number of operands, the type of operation performed, and the
addressing modes used. The following are some common types of
instruction codes:
• One-operand instructions: These instructions have one operand and
perform an operation on that operand. For example, the "neg"
instruction in the x86 assembly language negates the value of a single
operand.
• Two-operand instructions: These instructions have two operands and
perform an operation involving both. For example, the "add" instruction
in x86 assembly language adds two operands together
• Three-operand instructions: These instructions have three operands
and perform an operation that involves all three operands. For
example, the "fma" (fused multiply-add) instruction in some
processors multiplies two operands together, adds a third operand,
and stores the result in a fourth operand.
• Data transfer instructions: These instructions move data between
memory and registers or between registers. For example, the "mov"
instruction in the x86 assembly language moves data from one
location to another.
• Control transfer instructions: These instructions change the flow of
program execution by modifying the program counter. For example,
the "jmp" instruction in the x86 assembly language jumps to a
different location in the program.
• Arithmetic instructions: These instructions perform mathematical
operations on operands. For example, the "add" instruction in x86
assembly language adds two operands together.
• Logical instructions: These instructions perform logical operations on
operands. For example, the "and" instruction in x86 assembly
language performs a bitwise AND operation on two operands.
• Comparison instructions: These instructions compare two operands
and set a flag based on the result. For example, the "cmp" instruction
in x86 assembly language compares two operands and sets a flag
indicating whether they are equal, greater than, or less than.
• Floating-point instructions: These instructions perform arithmetic and
other operations on floating-point numbers. For example, the "fadd"
instruction in the x86 assembly language adds two floating-point
numbers together.
Opcodes
• An opcode is a collection of bits representing the basic operations,
including add, subtract, multiply, complement, and shift. The number
of bits required for the opcode is determined by the number of
functions the computer gives. For ‘2n’ operations, the minimum bits
accessible to the opcode should be ‘n’, where n is the number of bits.
We implement these operations on information saved in processor
registers or memory.
Types of Opcodes
There are three different types of instruction codes on the main
computer. The instruction's operation code (opcode) is 3 bits long, and
the remaining 13 bits are determined by the operation code
encountered.
There are three types of formats:
• Memory Reference Instruction: It specifies the address with 12 bits
and the addressing mode with 1 bit (I). For direct addresses, I equal 0,
while for indirect addresses, I equal 1.
• Register Reference Instruction: The opcode 111 with a 0 in the
leftmost bit of the instruction recognizes these instructions. The
remaining 12 bits specify the procedure to be carried out
• Input-Output Instruction: The operation code 111 with a 1 in the
leftmost bit of instruction recognizes these instructions. The input-
output action is specified using the remaining 12 bits.