
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















An instruction in a computer is made up of groups called fields. Each field carries different information that tells the CPU what to perform. The most common fields are:
Instructions are of variable length depending on the number of addresses they contain. Based on the number of address fields, CPU organization is generally of three types:
A blend of these organizations is mostly what is seen in real systems, rather than only one being applied.
A stack-based computer does not use the address field in the instruction. All arithmetic operations take place using the top one or two positions of the stack.
To evaluate an expression, it is first converted to Reverse Polish Notation (Postfix Notation).
Expression: X = (A+B)(C+D) → Postfix: AB+CD+**
(TOS = Top of Stack, M[X] = any memory location)
Instruction Operation
PUSH A TOP = A PUSH B TOP = B
ADD TOP = A+B PUSH C TOP = C
Instruction Operation
PUSH D TOP = D ADD TOP = C+D
MUL TOP = (C+D)*(A+B) POP X M[X] = TOP
This format uses an implied ACCUMULATOR (AC) register for data manipulation. One operand is in the accumulator and the other is in a register/memory location. 'Implied' means the CPU already knows one operand is in the accumulator, so it need not be specified.
Format:
Opcode Operand/address of operand mode
Expression: X = (A+B)*(C+D) (AC = accumulator, M[] = memory location, M[T] = temporary location)
Instruction Operation
LOAD A AC = M[A] ADD B AC = AC + M[B]
STORE T M[T] = AC
LOAD C AC = M[C] ADD D AC = AC + M[D]
MUL T AC = AC * M[T] STORE X M[X] = AC
Common in commercial computers. Two addresses can be specified in the instruction. Unlike one- address instructions (where the result is stored in the accumulator), here the result can be stored at different locations — but this requires more bits to represent the address. The destination address can also contain an operand.
Format:
to perform tasks — some are simple read, write, and move commands directing data to different hardware elements.
Instructions are made up of a specific number of bits. For example, an 8-bit instruction may have the first 4 bits as the operation code (what to do) and the next 4 bits as the operand (data to use). Instruction length can vary from as few as 4 bits to several hundred, and can differ between instructions within the same ISA.
Note: A concise RISC vs CISC table also appears in Section 8.4 as given directly in the teacher's handwritten notes (M-2(1).pdf); this expanded table below is from PART_A.pdf for additional reference.
CISC RISC
Has a microprogramming unit Has a hard-wired unit of programming Instruction set has many different Instruction set is reduced; most
instructions used for complex operations
instructions are very primitive
Performance optimized with emphasis on hardware
Performance optimized with emphasis on software Only single register set Multiple register sets are present
Mostly less or not pipelined Highly pipelined Execution time is very high Execution time is very less
Code expansion is not a problem Code expansion may create a problem Decoding of instructions is complex Decoding of instructions is simple
Requires external memory for calculations
Doesn't require external memory for calculations
Examples: System/360, VAX, AMD, Intel x
Examples: ARC, Alpha, ARM, AVR, PA-RISC, SPARC
Instructions can take several clock cycles
Single-cycle for each instruction
Complex and variable-length instructions
Simple, standardized instructions
A large number of instructions A small number of fixed-length instructions
Compound addressing modes Limited addressing modes Applications: Smartphones, PDAs Applications: Security systems, Home automation
To understand CPU organization, consider what the CPU must do:
◦ Decode the instruction – the opcode defines the instruction type (data processing, memory access, etc.). ◦ Fetch the operands – based on opcode and instruction format, the control unit determines what operands are needed and where to fetch them from.
The last phase — the actual operation specified by the instruction is performed. For data- processing instructions, operands pass through the ALU/other data manipulation units. At the end, the result is stored in data memory or a CPU register (depending on architecture/instruction).
An Interrupt is a signal that temporarily stops the normal execution of a program so the CPU can respond to an urgent event. After servicing the interrupt, the CPU resumes execution of the interrupted program.
Interrupt Cycle: After executing each instruction, the CPU checks whether an interrupt request is pending.
The control unit generates control signals in two organizations:
There are different methods to implement a hardwired control unit:
To interpret instructions and generate control signals for them, the control unit uses fixed logic circuits. To generate signals, these circuits use the contents of the control step counter, instruction register, and condition (code) flags, along with external input signals such as interrupt signals.
Microprogramming is the process of writing microcode for the control memory of the control unit in the CPU.
Microinstruction sequencing is the method of determining the flow of the microprogram.
Techniques based on the number of addresses utilized for sequencing:
The microprogrammed control unit produces control signals using microinstructions.
Attributes Hardwired Control Unit Microprogrammed Control Unit Speed Speed is fast Speed is slow
Cost of Implementation
More costly Cheaper
Flexibility Not flexible to accommodate new system specifications
More flexible to accommodate new system specifications
Ability to handle complex instructions
Difficult to handle complex instructions
Easier to handle complex instructions Decoding Complex decoding and sequencing logic
Easier decoding and sequencing logic
Applications RISC Microprocessor CISC Microprocessor
Control memory Absent Present Chip area required Less More
Occurrence (of error) Occurrence of error is more Occurrence of error is less
Instruction execution is operationally divided into smaller logical tasks called micro-operations. Therefore, an instruction can be seen as a sequence of micro-operations.
A micro-operation is a fundamental action performed by a machine on data stored in a register, as a step toward instruction execution.
Example (from PART_B.pdf) — LOAD R1, [0500] is executed through the micro-instructions: Read Address → Access Memory → Read Data → Load into Register → Next Instruction.
Transfers information from one register to another register.
Example: R2 ← R1 (R1 = source, R2 = destination) and R1 ← R2 (R2 = source, R1 = destination)
Arithmetic micro-operations are performed by the ALU inside the CPU. They perform basic arithmetic operations on numeric data — addition, subtraction, complement, 2's complement, addition with 2's complement, increment, decrement.
Symbolic Designation Description R3 ← R1 + R2 Contents of R1 + R2 transferred to R3.
R3 ← R1 - R2 Contents of R1 - R2 transferred to R3.
R1 ← R1 + 1 Increment the contents of R1 by 1. R1 ← R1 - 1 Decrement the contents of R1 by 1.
Example: Addition micro-operation R3 ← R1 + R2 is broken down as (M-2(1).pdf):
The functional requirements of the control unit are the functions it must perform. A three-step process characterizes the Control Unit:
The control unit performs two tasks:
Sequence of micro-operations needed to execute this instruction:
Parallel processing increases the computational speed of computer systems by performing multiple data-processing operations simultaneously. For example, while one instruction is being executed in the ALU, the next instruction can be read from memory. A system may have two or more ALUs to execute multiple instructions at the same time.
Parallel processing capacity increases along with system cost, but technological development has reduced hardware costs, making parallel processing economically feasible. It derives from multiple levels of complexity. Applications include:
Only one instruction stream and one data stream exist. The CPU can be visualized as made up of two parts: Data Processing Unit (DPU) and Control Unit (CU).
Multiple processing elements (DPUs) exist in the computer architecture, all controlled by a single control unit.
Multiple data processing units and multiple control units exist. The data processing units are arranged sequentially so the output of one DPU is the input of the next DPU in order. Each DPU receives controls from its own independent CU, and each CU processes a different instruction.
Multiple control units and multiple data processing units exist. Each DPU processes a different data element using a different data stream. Each DPU receives controls from its independent CU,