Professional Documents
Culture Documents
UNIT One PDF
UNIT One PDF
Memory
Output Control
I/O Processor
PC R0
R1
Processor
IR
ALU
Rn - 1
n general purpose
registers
Memory
Registers
• Instruction register (IR)
• Program counter (PC)
• General-purpose register (R0 – Rn-1)
• Memory address register (MAR)
• Memory data register (MDR)
Typical Operating Steps
• Programs reside in the memory through input devices
• PC is set to point to the first instruction
• The contents of PC are transferred to MAR
• A Read signal is sent to the memory
• The first instruction is read out and loaded into MDR
• The contents of MDR are transferred to IR
• Decode and execute the instruction
Typical Operating Steps (Cont’)
• Get operands for ALU
General-purpose register
Memory (address to MAR – Read – MDR to ALU)
• Perform operation in ALU
• Store the result back
To general-purpose register
To memory (address to MAR, result to MDR – Write)
• During the execution, PC is incremented to the next instruction
Addressing Modes
Prerequisite - Introduction to
parts of CPU
• Arithmetic and Logic Unit (ALU)
It performs all the arithmetic and logical micro
CU operations.
• Floating Point Unit (FPU)
REGISTERS
It performs operations on floating point numbers.
ALU
• Memory Unit (MU)
It stores the set of instructions.
FPU • Control Unit (CU)
It supervises the sequence of micro operations.
MU • Registers
Temporary storage area, which holds the data during
the execution of an instruction.
Prerequisite - Registers inside CPU
Accumulator Flag Register / Program Status Word (PSW)
S = Sign, Z = Zero, CY = Carry,
A C
A (8-bit) S Z C P Y AC = Auxiliary Carry, P = Parity,
B (8-bit) C (8-bit)
PC (16-bit)
Index
SP (16-bit) Registers
Addressing Modes
• Microprocessor executes the instructions stored in memory
(RAM).
• It executes one instruction at a time.
• Each of the instruction contains operations and operands.
• Operation specifies the type of action to be performed.
• For example: ADD, SUB, MOV, INC, LOAD, STORE
• Operands are the data on which the operation is to be
performed.
Add Immediate
ADI 3Eh A ← A + 3Eh Here 3Eh is the immediate
operand
2. Register Addressing Mode
Move
Here A is the operand specified in register
MOV C , A C ← A
Add
ADD B A ← A + B Here B is the operand specified in register
3. Register Indirect Addressing Mode
• The instruction specifies the register in which the
memory address of operand is placed.
• It do not specify the operand itself but its location with
in the memory where operand is placed.
Move
MOV A , M A ← [[H][L]]
It moves the data from memory location specified by HL register pair toA.
3. Register Indirect Addressing Mode
• MOV A , M A ← [[H][L]]
• It moves the data from memory location specified by HL register pair
toA.
2807
2807
• Before 2806 After
2806
• A 2805 A9 A A9
2805 A9
H 28 2804 H 28
2804
2803
L 05 L 05 2803
2802
2802
A ← [2805] 2801 A ← A9
2801
2800
2800
4. Direct Addressing Mode
• The instruction specifies the direct address of
the operand.
• The memory address is specified where the
actual operand is.
• Load Accumulator
LDA 2805h A ← [2805]
It loads the data from memory location 2805 to A.
Store Accumulator
STA 2803h [2803] ← A
It stores the data from A to memory location 2803.
4. Direct Addressing Mode
LDA 2805h A ← [2805]
It loads the data from memory location
2805 to A.
2807 2807
Before After
2806 2806
2805 5C 2805 5C
A A 5C
2804 2804
2802 2802
2801 2801
2800 2800
4. Direct Addressing Mode
STA 2803h [2803] ← A
It stores the data from A to memory
location 2803.
Before After
2807 2807
2806 2806
A 9B A 9B
2805 2805
2804 2804
[2803] ← A [2803] ← 9B
2803 2803 9B
2802 2802
2801 2801
2800 2800
5. Indirect Addressing Mode
Move
MOV A, 2802h A ← [[2802]]
It moves the data from memory location specified by the location 2802 to A.
5. Indirect Addressing Mode
A 2807 A FF 2807
2806 FF 2806 FF
2805 2805
A ← [[2802]] 2804 A ← FF 2804
2803 2803
2802 2806 2802 2806
2801 2801
2800 2800
6. Implied Addressing Mode
• It is also called inherent addressing mode.
• The operand is implied by the instruction.
• The operand is hidden/fixed inside the instruction.
2807 22 2807 22
2806 FF 2806 FF Actual
Offset = 04h
2805 6D 2805 6D Operand
2804 59 2804 59
PC 2801 2803 08 2803 08
2802 2E 2802 2E
2801 F3 2801 F3
2800 9F 2800 9F
At H 2802
start: L
• The Von Neumann Architecture which is also known as the Von Neumann
Model and Princeton Architecture, is a design model for stored programs.
• The most important feature is the memory that can holds both data and
program.
• In 1945, the mathematician and physician John Von Neumann wrote a
report on the stored program concept, known as the First Draft of a Report
on EDVAC.
• The new idea was that not only the data should be stored in memory but
the program processing that data should also be stored in the same
memory.
Components:
Input / Output Subsystem:
• This Architecture handles devices that allow the computer
system to communicate and interact with the outside world.
• Inputs are the signals or data received by the system and
outputs are the signals or data sent from it.
• I/O system includes two basic components.
• I/O module is normally connected to the computer system.
• I/O device is connected to I/O module of the computer
called peripheral device.
Input / Output Subsystem:
• I/O module gets data from peripherals while CPU
does other work. I/O module interrupts CPU. CPU
requests for data. I/O module transfers data.
• Speed of I/O devices are slower as compared to
CPU. i.e. Suppose a benchmark executes in 100 sec
• .
• CPU 90%
• I/O 10%
• Two versions: SIC and SIC/XE (extra equipments). SIC program can be
executed on SIC/XE.
• Memory consists of 8-bit bytes. 3 consecutive bytes form a word (24 bits)
• In total, there are 2^15 bytes in the memory.
• There are 5 registers. Each is 24 bits in length.
Five Registers
DATA FORMAT
Additional Registers
Data Format
Must be 1
e=0
e=1
Addressing Mode
• Two additional modes are introduced for format 3:
In format 3, if both bits b and p are set to 0, the disp (or address) is taken as the
target address. This is called direct addressing mode.
Both modes can be combined with indexed addressing – if bit x is set to 1, the
value of register X is added in the target Address calculation.
Addressing Modes
P: privileged instruction
X: available Only on XE
F: floating- Point Instruction
C: condition code CC set to
indicate result of operation
INTERACTION OF A PROGRAM WITH HARDWARE
RISC and CISC
What is CISC?
• CISC is an acronym for Complex Instruction Set Computer and are chips
that are easy to program and which make efficient use of memory. Since the
earliest machines were programmed in assembly language and memory was
slow and expensive, the CISC philosophy made sense
• CISC was developed to make compiler development simpler. It shifts most
of the burden of generating machine instructions to the processor. For
example, instead of having to make a compiler write long machine
instructions to calculate a square-root, a CISC processor would have a built-
in ability to do this.
Most CISC hardware architectures have several characteristics in common:
• Complex instruction-decoding logic, driven by the need for a single
instruction to support multiple addressing modes.
• A small number of general purpose registers. This is the direct result of
having instructions which can operate directly on memory and the limited
amount of chip space not dedicated to instruction decoding, execution,
and microcode storage.
• Several special purpose registers. Many CTSC designs set aside special
registers for the stack pointer, interrupt handling, and so on. This can
simplify the hardware design somewhat, at the expense of making the
instruction set more complex.
• A 'Condition code" register which is set as a side-effect of most
instructions. This register reflects whether the result of the last operation
is less than, equal to, or greater than zero and records if certain error
conditions occur.
What is RISC?
• RISC?
RISC, or Reduced Instruction Set Computer. is a type of microprocessor
architecture that utilizes a small, highly-optimized set of instructions, rather
than a more specialized set of instructions often found in other types of
architectures.
• History
The first RISC projects came from IBM, Certain design features have been
characteristic of most RISC processors:
• one cycle execution time: RISC processors have a CPI (clock per
instruction) of one cycle. This is due to the optimization of each
instruction on the CPU and a technique called PIPELINING
• pipelining: a technique that allows for simultaneous execution of parts, or
stages, of instructions to more efficiently process instructions;
• large number of registers: the RISC design philosophy generally
incorporates a larger number of registers to prevent in large amounts of
interactions with memory
RISC Attributes
The main characteristics of CISC microprocessors are:
• Extensive instructions.
• Complex and efficient machine instructions.
• Microencoding of the machine instructions.
• Extensive addressing capabilities for memory operations.
• Relatively few registers.
In comparison, RISC processors are more or less the opposite of the above:
• Reduced instruction set.
• Less complex, simple instructions.
• Hardwired control unit and machine instructions.
• Few addressing schemes for memory operands with only two basic instructions, LOAD
and STORE
• Many symmetric registers which are organized into a register file.
CISC versus RISC
CISC RISC
Emphasis on hardware Emphasis on software
Includes multi-clock Single-clock,
complex instructions reduced instruction only
Small code sizes, high cycles per large code sizes, Low cycles per
second second