CPU - Central Processing Unit: Basic Computer Organisation and Design
CPU - Central Processing Unit: Basic Computer Organisation and Design
R1
ALU R2
R3
R4
I
1.CONTROL UNIT
The control unit is like that part of human brain that control all the operation perform by each
part of body.
Controlling is achieved through wires that can be hot(on) or cold(off).
Functions of control unit-:
1. The control unit is the component of CPU that directs the operation of the processors.
2. Control unit is interact with ALU and main memory.
3. It tells the computer memory, ALU, input and output devices . How to respond to programs
instructions.
4.It directs the operation of other units by providing timing and control signals.
5.It directs the flow of computer between CPU and main memory.
6.It also interact with ALU, which type of operation should be perform on data .
WORKING OF CONTROL UNIT
Step:2 Decode the insruction into command step:3 Execute command
ALU
1 Address
3*8
DECODER
D7 D6 D5 D4 D3 D2 D1 D0
Control
CONTROL
LOGIC inputs
I GATES
Increment(INR)
4 BIT Clear(CLR)
T0
T1
T2
T3
T4
D3
CLR
SC
MICRO – PROGRAMMED CONTROL UNIT
A micro programmed control unit is implemented by using programming approach.A sequence of micro
operations are carried out by executing a program consisting of micro operations.
Micro program , consisting of micro instructions is stored in the control memory of the control unit.
Execution of a micro operations is responsible for generation of a set of control signals.
A micro instructions consist of :- - On or more micro operations to be executed
- Address of next micro instruction to be executed
Micro operations -: The operation performed on the data stored inside the register are called micro
operations.
Micro programs -: Micro programming is concept for generating control signals using programs . These
are called micro programs.
Micro instructions -: The instructions that make micro programs are called micro instructions.
Micro code -: Micro program is a group of micro instructions . The micro programs can also be termed as
micro code.
Advantages
The design of micro program control unit is less complex because micro program are implemented using
software routines.
The micro program control unit is more flexible because design modifications , correction and
enhancement is easily possible.
Disadvantages
The micro program control unit slower than hardwired control unit.
The micro program control unit is expensive than hardwired control unit.
1 opcode address
15 14 12 11 0
First 12 bits(0-11) to specify an address , next 3 bits the operation code(OP ) code field of the instruction
and last left most bit specify the addressing mode . I = 0 for direct addressing mode
I =0 for indirect addressing mode
INSTRUCTION CODE
MEMORY-REFRENCE INSTRUCTIONS
A memory-reference instructions uses 12 bits to specify an address and 1 bit to specify the addressing
mode I .I is equal to zero for direct address and to 1 for indirect address.
REGISTER-REFERENCE INSTRUCTIONS
A register reference instructions specifies an operation on or a test of the AC registers. An operand
from the memory is not needed therefore the other 12 bits are used to specify the operation to be
executed.
INPUT-OUTPUT INSTRUCTIONS
An input-output instructions does not need a reference to memory and is recognized by operational
code 11 with a 1 in the left most bit of the instructions the remaining 12 bits are used to specify the type of
input output operation performed.
Memory-reference instructions
15 14 12 11 0 (OP-code = 000~110)
1 opcode address
Register-reference instructions
15 12 11 0 (OP-code = 111,I=0)
0111 Register operation
Input-output instructions
15 12 11 0 (OP-code = 111,I=1)
1111 I/O Operation
INSTRUCTIONS CYCLE
START
1. FETCH -:
- To copy the next instructions into the instruction no
register in the CPU.
2. DECODE -:
- Decode the instructions. yes
3. EXECUTE -:
- Execute the instructions Fetch
Decode
Execute
Stop
SC 0 START
T0
AR PC
IR M[AR],PC PC+1 T1
T2
D7
(I/O)=1 =0(register) (indirect)=1 =0(direct)
I I
T3 T3
Execute Execute register
T3 T3
input-output reference
instruction instruction AC M[AR] NOTHING
SC 0 SC 0 T4
REGISTERS
CONTROL UNIT
ALU
TYPES OF REGISTERS
1. MEMORY ADDRESS REGISTER
- Holds the memory address of data or instructions.
- Used to access data and instructions from memory during the execution phase of an instruction.
- It contains the copy of designated memory locations specified by the memory address register.
2. MEMORY DATA REGISTERS
- It contain the data to be stored in the computer storage.
- It acts like a buffer and holds anything that is copied from the memory ready for the processor to use.
- MDR holds the information before it goes to the decoder.
3. INDEX REGISTER
- It is used to modifying operand and addresses during the run of a program.
4. PROGRAM COUNTER
- Part of instruction sequencer in some computers.
- It is a 16 bit special function register in 8085 microprocessor.
- It holds the address of the memory location of the next instructions when the current instruction is
executed by the microprocessor.
5. ACCUMULATOR REGISTER
- It is used for storing the results those are produced by the system.
- When the CPU will generate some results after the processing then all the results will be stored into the
AC register.
6. MEMORY BUFFER REGISTER
- It holds the contents of data or instruction read from or written in memory.
7. DATA REGISTER
- A register used in microcomputer to temporarily store data being transmitted to or from a peripheral
devices.
REGISTER TRANSFER
Register - group of flip flops.
- capable of storing one bit of information.
Register transfer - Copying the contents of one register to another is a register transfer.
- A register transfer is indicated as R2<-R1.
(In this case, the contents of R2 is copied in register R1).
R1 – source register.
R2 – destination register.
A simultaneous transfer of all bits from the source register R1 to the destination register R2 during one clock
pulse.
diagram R2
Control circuit
p Load clock
R1
load
MEMORY
MAIN
MEMORY
RAM ROM
a.)RAM
RAM – Random Access memory.
A temporarily storage that can be read from or written into by the users.
Random access memory loses its contents whenever powered is switched off.
It is a volatile memory.
Every location can be accessed independently.
Data can be changed.
Data storage is of temporarily in nature.
Dynamic
RAM
RAM
Static
RAM
Dynamic RAM
DRAM stands for dynamic RAM.
Relatively slower and low cost memory.
Used for main memory.
Contents are constantly refreshed 1000times per second.
Access time 60-70 nano seconds.
Static RAM
SRAM stands for static RAM.
Characterised by high speed and high cost.
Use six transistors to store data.
Can accept one command and transfer one word of data per clock cycle.
Difference between DRAM and SRAM
DRAM SRAM
It is dynamic random access memory. It is static random access memory
The information stored in DRAM has to The information stored in SRAM need to
be refreshed after every few million be refreshed but it remains stable as long
seconds, otherwise . It is read. as power supply is provided.
DRAM has higher storage capacity and is SRAM is costlier but has higher speed
cheaper than SRAM. than DRAM.
b.)ROM
Read Only Memory retain the data even when the power is turned off.
It is non-volatile memory.
Data can’t be changed.
Data storage is of permanent nature . That’s why is known as field stores , dead stores or permanent
stores.
Types of ROM
i. PROM- The information is stored by programmers after manufacturing . It also can’t be altered or
erased later on.
ii. EPROM- It is similar to PROM , but its information can be erased later on by ultra violet light and it can
be programmed.
iii. EEPROM- Electrically erasable programmable ROM. Its is similar to EPROM , but its information can be
erased by using on high voltage current.
iv. EAPROM- As compared to EPROM and EAPROM , the information stored in EAPROM can be altered
later.
3.Secondary memory
Secondary memory is also called auxiliary memory.
Much larger in capacity but lower than the main memory(primary memory).
Secondary memory is an additional memory that is located outside the computer.
Secondary memory is less expensive.
Program or information which are not currently used by CPU resides in secondary memory. Example:
hard disk, floppy disk.
It is non-volatile memory.
Permanent storage of data and instructions.
CACHE MEMORY
CACHE MEMORY
System performance suffers when processor waits for data from show memory device.
Cache memory is introduced between the CPU and the main memory.
MAIN
CPU MEMOR
Y
Cache is high speed memory for holding recently accessed data in main memory.
The amount of cache memory has a tremendous impact on the computer’s speed.
OPERATION OF CACHE MEMORY
MAIN CACHE
MEMORY CPU
MEMORY
Cache fetches data from next to current addresses in main memory.
CPU checks to see whether the next instruction it requires is in cache.
If , it is fetched from the cache-a very fast position.
If not the CPU has to fetch next instruction from main memory – a much slower process.
ADDRESSING MODES
1.)Direct addressing mode
- In this mode , effective of operand is present in instruction itself.
……single memory reference to access data.
…………..no additional calculations to find the effective address of the operand.
OP memory
address
code
instruction
operand
2.)indirect addressing mode
- In this mode, the address field of instruction gives the address where the effective address is stored
in memory . This slows down the execution, as this includes multiple memory lookups to find the operand.
OP code
instruction
Pointer to
operand
operand
BUS AND TYPES OF BUS
BUS STRUCTURE
The CPU must be able to communicate with all devices.
The devices are connected together by a communication channel called a bus.
A bus is composed of set of communication lines or wires.
Communication pathway connecting multiple devices.
It is shared transmission medium.
Multiple devices connect to the bus and any signal transmitted by any 1 device is received by all
devices connected to the bus.
Only a signal transmission is possible at a time.
A bus has multiple paths in it, each is called a line.
10101
1 Multiple lines transmit their signals parallely
0 10101
1
SYSTEM BUS
It is the bus that connect the three major components of the systems (CPU, I/O, MEMORY).
control lines
data lines
SYSTEM
address lines
CPU MEMORY
CONTROL BUS
ADDRESS BUS
DATA BUS
1.)Control bus
The numbers of wires depends of control commands a computer needs.
These lines are used to transfer control signals from one component to another.
The control information is used for directing the activities of all units.
It specifies the type of operation that is used to be performed.
It also transmits the control signals like(acknowledgement signals).
When a CPU gives command to the memory for writing data, than the memory send an
acknowledgement signal to the CPU after successful writing of data.
2.)Address bus
The numbers of wires depends on the address space of memory.
It is a part of system bus. It is used to carry address signal read and write data in the memory.
An address bus is unidirectional. RAM address bus
An address bus carries address information . It is a set of wires. Similar to the data bus but it only
connects CPU and memory.
Whenever the processor needs data from the memory , it places the address of data on the address
bus.
The address is carried to the memory where the data from the requested address is fetched and
placed on the data bus. The data bus carries to CPU.
An address is unique ID of each component to the system bus.
It is called address of the component.
3.)Data bus
The most common bus is the data bus. A data bus carries data.
It is an electrical path that connects the CPU, memory, INPUT/OUTPUT devices and secondary storage
devices.
The bus contain parallel group of lines.
Data bus is used to transfer the data from one component to another.
There are 32 or 64 parallel lines of data bus.
Data bus is bidirectional.
DIFFERENCE BETWEEN ADRESS BUS , DATA BUS AND CONTROL BUS