COMPUTER ORGANIZATION
NOTES
BCA II Year - IV SEM
Prepared By:
Vineet Deopa, Assistant Professor
Department of Electronics and Communication Engineering
Graphic Era Hill University, Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
1
Dehradun, Uttarakhand, India
SYLLABUS
UNIT- I
Introduction to Computer Organization: Definition of computer organization and its importance, Overview of computer
architecture, Computer evolution and generations, Computer components and their roles.
UNIT- II
Central Processing Unit (CPU) The fetch-decode-execute cycle, Registers and their functions, Data and control paths,
Arithmetic and logic operations, Control unit and microinstructions.
UNIT- III
Memory Hierarchy and Storage Systems: Memory hierarchy and its impact on system performance, Types of memory:
cache, main memory, secondary storage, Cache memory: organization and mapping techniques, Virtual memory and
memory management, Storage devices and technologies.
UNIT- IV
Input/Output Systems Input/output devices and their interfaces, I/O channels and controllers, I/O addressing and control
methods, Interrupts and DMA (Direct Memory Access).
UNIT- V
Pipelining in processors: Stages of pipelining, Instruction set architecture (ISA), RISC and CISC architectures, Memory
addressing modes.
TBC 403: Computer Organization Graphic Era Hill University,
2
Dehradun, Uttarakhand, India
Recommended Textbooks
William Stallings –
Computer Organization & Architecture, 10th Edition
Carl Hamacher, ZvonkoVranesic, Safwat Zaky
Computer Organization, 5th Edition, Tata McGraw Hill, 2017.
David A. Patterson and John L. Hennessy
1. Computer Organization and Design: The Hardware/Software
Interface" ,5th ed, 2014 Morgan Kaufmann
TBC 403: Computer Organization Graphic Era Hill University,
3
Dehradun, Uttarakhand, India
Unit: 1
Introduction to Computer Organization
• Computer Organization is about how the components of a computer system, like the CPU, memory, and
input/output devices, are connected and work together to execute programs. It focuses on the operational
aspects and how hardware components are implemented to support the architecture.
• Computer architecture is about designing a computer system to balance performance, efficiency, cost,
and reliability. It describes how a system is built from its components. This can be a high-level overview or
a detailed explanation, including the instruction set architecture, microarchitecture, logic design, and
implementation.
TBC 403: Computer Organization Graphic Era Hill University,
4
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
5
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
6
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
7
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
8
Dehradun, Uttarakhand, India
Von Neumann Architecture
The first computers had fixed programs and changing a computer program required physically
rewiring or redesigning the machine. This meant that repurposing a computer was a difficult,
expensive and time-consuming process. The Mathematician John Von-Neuman designed the
specification for the first programmable computer in 1954, where the programs themselves could
be stored in memory, not just data.
Instructions are stored in memory and are retrieved and processed by the Central Processing Unit
one by one. This blueprint is known as the Von-Neumann Architecture.
The Von-Neuman Architecture is based on the principle of:
•Fetch an Instruction
•Decode the Instruction
•Execute the Instruction
The process above is repeated indefinitely, and is known as the fetch, decode, execute cycle.
TBC 403: Computer Organization Graphic Era Hill University,
9
Dehradun, Uttarakhand, India
Von-Neumann Architecture
This model is proposed by Von-Neumann in 1945. A control unit,
Arithmetic logic memory unit and I/O consist of this model. Von-
Neumann architecture is based on the stored-program computer concept.
Here data and instructions are using the same memory for storing
the data.
We can see these three main facts where the Von- Neumann Based computer.
1. A single processor is used in Von-Neumann based computer.
2. Both instructions and data are in the same memory
3. The fetch-decode-executive cycle is used for executing the program.
There are three main components in Von-Naumann architecture.
1. Central processing unit
2. Memory
3. Input/Output devices
TBC 403: Computer Organization
10
Graphic Era Hill University, Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
11
Dehradun, Uttarakhand, India
Harvard Architecture
Most of the computers are followed by Von-Neumann architecture.
In that architecture, both instructions and data are stored in the same
memory. Same buses are used for fetching data and instructions. That
means the CPU cannot do read instructions and read/write data in
both functions together.
Harvard architecture is the solution to this.
In this computer, architecture has been created by separate buses and
separate storage for data and instructions.
This architecture has been developed to overcome the bottleneck of
Von- Neumann architecture.
The main advantage of Harvard architecture is CPU can read-write
data and access instructions same time because of having separate
buses and instructions.
TBC 403: Computer Organization Graphic Era Hill University,
12
Dehradun, Uttarakhand, India
Generations of Computers
Generations of Computer
• The computer has evolved from a large-sized simple
calculating machine to a smaller but much more powerful
machine.
• The evolution of computer to the current state is defined
in terms of the generations of computer.
• Each generation of computer is designed based on a new
technological development, resulting in better, cheaper
and smaller computers that are more powerful, faster and
efficient than their predecessors.
TBC 403: Computer Organization Graphic Era Hill University,
14
Dehradun, Uttarakhand, India
Generations of Computer
• Currently, there are five generations of computer.
In the following subsections, we will discuss the
generations of computer in terms of the technology
used by them (hardware and software), computing
characteristics (speed, i.e., number of instructions
executed per second), physical appearance, and
their applications.
TBC 403: Computer Organization Graphic Era Hill University,
15
Dehradun, Uttarakhand, India
First Generation Computers
(1940-1956)
• The first computers used vacuum tubes(a sealed glass tube containing a near-vacuum
which allows the free passage of electric current.) for circuitry and magnetic
drums for memory.
• They were often enormous and taking up entire room.
• First generation computers relied on machine language.
• They were very expensive to operate and in addition to using a great deal of electricity,
generated a lot of heat, which was often the cause of malfunctions(defect or breakdown).
• The UNIVAC and ENIAC computers are examples of first-generation computing devices.
TBC 403: Computer Organization Graphic Era Hill University,
16
Dehradun, Uttarakhand, India
First Generation Computers
Advantages :
• It was only electronic device.
• First device to hold memory.
Disadvantages :
• Too bulky i.e large in size.
• Vacuum tubes burn frequently.
• They were producing heat.
• Maintenance problems.
TBC 403: Computer Organization Graphic Era Hill University,
17
Dehradun, Uttarakhand, India
Second Generation Computers
(1956 – 1963)
• The vacuum tubes were replaced by transistors.
• Smaller in size compared to the first generation computers.
• Generated a lower level of heat, as components were much smaller.
• Higher capacity of internal storage.
• Processor operated in the microsecond speed.
TBC 403: Computer Organization Graphic Era Hill University,
18
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
19
Dehradun, Uttarakhand, India
Second Generation Computers
Advantages :
• Size reduced considerably.
• Faster than first generation computers.
• Very much reliable.
Disadvantages :
• Heating issues.
• Maintenance problems.
TBC 403: Computer Organization Graphic Era Hill University,
20
Dehradun, Uttarakhand, India
Third Generation Computers
(1964-1971)
• The development of the integrated circuit was the hallmark of the
third generation of computers.
• Transistors were miniaturized and placed on siliconchips, called
semiconductors.
• Instead of punched cards and printouts, users interacted with third
generation computers through keyboards
and monitors and interfaced with an operating system.
• Allowed the device to run many different applications at one time.
TBC 403: Computer Organization Graphic Era Hill University,
21
Dehradun, Uttarakhand, India
Third generation computers
Advantages :
• ICs are very small in size.
• Improved performance.
• Production cost cheap
Disadvantages :
• ICs are sophisticated.
TBC 403: Computer Organization Graphic Era Hill University,
22
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
23
Dehradun, Uttarakhand, India
Fourth Generation Computers
(1971-1990)
• The microprocessor brought the fourth generation of computers, as
thousands of integrated circuits were built onto a single silicon chip.
• The Intel 4004 chip, developed in 1971, located all the components of
the computer.
• From the central processing unit and memory to input/output
controls—on a single chip.
• . Fourth generation computers also saw the development of GUIs,
the mouse and handheld devices.
TBC 403: Computer Organization Graphic Era Hill University,
24
Dehradun, Uttarakhand, India
Fourth Generation Computers
TBC 403: Computer Organization Graphic Era Hill University,
25
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
26
Dehradun, Uttarakhand, India
Fifth Generation Computers
(present and beyond)
• Fifth generation computing devices, based on artificial intelligence.
• Are still in development, though there are some applications, such
as voice recognition.
• The use of parallel processing and superconductors is helping to make
artificial intelligence a reality.
• The goal of fifth-generation computing is to develop devices that
respond to natural language input and are capable of learning and
self-organization.
TBC 403: Computer Organization Graphic Era Hill University,
27
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
28
Dehradun, Uttarakhand, India
Generations of Evolving
Time-Period
Computer Hardware
First Generation 1940s – 1950s Vacuum Tube Based
Second Generation 1950s – 1960s Transistor Based
Third Generation 1960s – 1970s Integrated Circuit Based
Fourth Generation 1970s – Present Microprocessor Based
Fifth Generation Present – Future Artificial Intelligence Based
TBC 403: Computer Organization Graphic Era Hill University, Dehradun, Uttarakhand, India 29
TBC 403: Computer Organization Graphic Era Hill University,
30
Dehradun, Uttarakhand, India
Computer System Components
Access, decode,
Math calculations
coordinate instructions
Hold program
instructions and data
TBC 403: Computer Organization Graphic Era Hill University,
31
Dehradun, Uttarakhand, India
Hardware Components in Action
• Instruction phase
• Step 1: Fetch instruction
• Step 2: Decode instruction
• Execution phase
• Step 3: Execute the instruction
• Step 4: Store the results
TBC 403: Computer Organization Graphic Era Hill University,
32
Dehradun, Uttarakhand, India
Hardware
Components
I nput Devices -- "How to tell it what to do“
- A keyboard and mouse are the standard way to
interact with the computer. Other devices include
joysticks and game pads used primarily for games.
Output Devices -- "How it shows you what it is doing"
- The monitor (the screen) is how the computer
sends information back to you. A printer is also an
output device.
TBC 403: Computer Organization Graphic Era Hill University,
33
Dehradun, Uttarakhand, India
Hardware
Components
OUTPUT DEVICES
• VDU
• The computer screen is used for outputting
information in an understandable format
• Printers
• There are many different types of printers.
• In large organizations laser printers are
most commonly used due to the fact that
they can print very fast and give a very
high quality output.
TBC 403: Computer Organization Graphic Era Hill University,
34
Dehradun, Uttarakhand, India
Hardware
Components
OUTPUT DEVICES
• Plotters
• A plotter is an output device similar to a
printer, but normally allows you to print
larger images.
• Speakers
• Enhances the value of educational and
presentation products.
• Speech synthesisers
• Gives you the ability to not only to display
text on a monitor but also to read the text
to you
TBC 403: Computer Organization Graphic Era Hill University,
35
Dehradun, Uttarakhand, India
Hardware
Components
Storage Devices -- "How it saves data and
programs“
- Hard disk drives are an internal,
higher capacity drive which also stores the
operating system which runs when you power
on the computer.
- "Floppy" disk drives allow you to save
work on small disks and take the data with
you.
TBC 403: Computer Organization Graphic Era Hill University,
36
Dehradun, Uttarakhand, India
Hardware
Components
Hard Disks
• Speed:
• Very fast!
• The speed of a hard disk is often quoted as "average
access time" speed, measured in milliseconds. The
smaller this number the faster the disk.
• Capacity:
• Enormous! Often 40/80 Gigabytes. A Gigabyte is
equivalent to 1024 Megabytes.
• Cost:
• Hard disks costs are falling rapidly and normally
represent the cheapest way of storing data.
TBC 403: Computer Organization Graphic Era Hill University,
37
Dehradun, Uttarakhand, India
Hardware
Components
Diskettes (Floppy Disks)
• Speed:
• Very slow!
• Capacity:
• Normally 1.44 Mbytes.
• Cost:
• Very cheap.
TBC 403: Computer Organization Graphic Era Hill University,
38
Dehradun, Uttarakhand, India
Hardware
Components
CD-ROM Disks
• Speed:
• Much slower than hard disks. The original
CD-ROM speciation is given a value of 1x
speed, and later, faster CD-ROMs are
quoted as a multiple of this value.
• Capacity:
• Around 650 Mbytes and more
TBC 403: Computer Organization Graphic Era Hill University,
39
Dehradun, Uttarakhand, India
Hardware
Components
DVD Drives
• Speed:
• Much faster than CD-ROM drives but
not as fast as hard disks.
• Capacity:
• Up to 17 Gbytes.
• Cost:
• Slightly higher than CD-ROM drives.
TBC 403: Computer Organization Graphic Era Hill University,
40
Dehradun, Uttarakhand, India
Main Parts of
Computer
M em ory -- "How the processor stores and uses
immediate data“
• RA M - Random Access Memory
• The main 'working' memory used by the computer.
• When the operating system loads from disk when you
first switch on the computer, it is copied into RAM.
• As a rough rule, a Microsoft Windows based computer will
operate faster if you install more RAM. Data and
programs stored in RAM are volatile (i.e. the information
is lost when you switch off the computer).
TBC 403: Computer Organization Graphic Era Hill University,
41
Dehradun, Uttarakhand, India
Hardware
Components
Memory
• ROM – Read Only Memory
• Read Only Memory (ROM) as the name suggests is a special
type of memory chip that holds software that can be read
but not written to.
• A good example is the ROM-BIOS chip, which contains read-
only software.
• Often network cards and video cards also contain ROM
chips.
TBC 403: Computer Organization Graphic Era Hill University,
42
Dehradun, Uttarakhand, India
Hardware
Components
M icroprocessors -- "The brain of the computer“
-PCs primarily use microprocessors (sometimes called the chip).
The older Intel versions include the 386, 486 and now the Pentium
line.
The CPU (Central Processing Unit) is normally an Intel
Pentium (or equivalent) and it is one of the most important
components within your computer.
• It determines how fast your computer will run and is
measured by its MHz speed.
• Thus a 600 MHz Pentium is much faster than say a 400
MHz Pentium CPU.
• It is the CPU that performs all the calculations within the
computer.
TBC 403: Computer Organization Graphic Era Hill University,
43
Dehradun, Uttarakhand, India
Hardware
Components
Some of the Factors
That Impact on a Computer's Performance
• CPU speed
• RAM size
• Hard disk speed and capacity
TBC 403: Computer Organization Graphic Era Hill University,
44
Dehradun, Uttarakhand, India
Software
Components
Operating systems software
The operating system is a special type of program that loads
automatically when you start your computer.
The operating system allows you to use the advanced features of
a modern computer without having to learn all the details of how
the hardware works
The link between the hardware and you, the user
Makes the computer easy to use without having to understand bits
and bytes!
TBC 403: Computer Organization Graphic Era Hill University,
45
Dehradun, Uttarakhand, India
Software
Components
Applications software
An application program is the type of program that
you use once the operating system has been loaded.
Examples include word-processing programs,
spreadsheets and databases
TBC 403: Computer Organization Graphic Era Hill University,
46
Dehradun, Uttarakhand, India
Software
Components
Application Software
• Word processing applications
• Microsoft Word
• Lotus Word Pro
• WordPerfect
• Spreadsheets
• Microsoft Excel
• Lotus 123
• Database
• Microsoft Access
• Lotus Approach
TBC 403: Computer Organization Graphic Era Hill University,
47
Dehradun, Uttarakhand, India
Software
Components
Application Software
• Payroll
• Sage software
• Presentation tools
• Microsoft PowerPoint
• Lotus Freelance
• Desktop publishing
• Abode Photoshop
• Multimedia applications
• Microsoft's Encarta CD-ROM based
encyclopaedias
TBC 403: Computer Organization Graphic Era Hill University,
48
Dehradun, Uttarakhand, India
Unit II
Central Processing Unit
• The Central Processing Unit (CPU) is the heart of a computer
system.
• As CPUs are small, they are also referred to as
microprocessors.
• A CPU comprises three major components. They are:
• Register Set
• ALU
• Control Unit (CU)
TBC 403: Computer Organization Graphic Era Hill University,
49
Dehradun, Uttarakhand, India
Unit II
• Register Set
• The register set comprises of many registers which include
general purpose registers and special purpose registers.
• The general - purpose registers do not perform any specific
function.
• They store the temporary data that is required by a program.
• The special purpose registers perform specific functions for
the CPU.
TBC 403: Computer Organization Graphic Era Hill University,
50
Dehradun, Uttarakhand, India
Unit II
• Instruction Register (IR) is a special purpose register that
stores the instruction that is currently being executed.
• ALU(Arithmetic and Logic Unit)
• The ALU performs all the arithmetic, logical, and shift
operations.
• Control Unit
• The control unit fetches the instructions from the main
memory, decodes the instructions and then executes it.
TBC 403: Computer Organization Graphic Era Hill University,
51
Dehradun, Uttarakhand, India
Unit II
TBC 403: Computer Organization Graphic Era Hill University,
52
Dehradun, Uttarakhand, India
Unit II
TBC 403: Computer Organization Graphic Era Hill University,
53
Dehradun, Uttarakhand, India
A program cannot be run until the program instructions are loaded into main memory
(RAM).
Fetch
The instruction is fetched from main memory and stored in the processor. The control
unit can then access the instruction so that it can be decoded and executed.
Decode
The instruction needs to be decoded before it can be run. This is the process the control
unit uses to work out what signals to issue to the other components for the instruction to
be executed.
Execute
The control unit will send signals to the relevant components so that the instruction is
carried out.
Repeat
This cycle is repeated over and over until every instruction has been executed.
TBC 403: Computer Organization Graphic Era Hill University,
54
Dehradun, Uttarakhand, India
Unit II
We want our CPU repeatedly to FETCH the next instruction from memory into
the instruction register DECODE the instruction (that is, work out which it is)
EXECUTE the instruction.
Data is moved from memory to registers, and between registers Data is passed
(sometimes) through the ALU.
TBC 403: Computer Organization Graphic Era Hill University,
55
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
56
Dehradun, Uttarakhand, India
The Three Stages of the Instruction Cycle
1️. Fetch: Retrieving the Instruction
The first step in the instruction cycle is fetching the instruction from memory. The CPU relies on a special
register called the program counter (PC) to keep track of the address of the next instruction to be executed.
•The PC points to the memory address of the instruction.
•The CPU sends a signal to the memory to retrieve the instruction at that address.
•The retrieved instruction is then stored in the instruction register (IR).
This stage is crucial because it ensures that the CPU knows what task to perform next.
2. Decode: Interpreting the Instruction
Once the instruction is fetched, the next step is to decode it. The control unit (CU) of the CPU is responsible for
this process.
•The CPU breaks down the instruction into its components, typically an operation code (opcode -> The part of
a machine language instruction that specifies the operation to be performed) and operands(The components of
an instruction that provide the data or addresses needed for the operation).
•The opcode indicates the type of operation to be performed, such as addition, subtraction, data transfer, or
control operations like jumps.
•The operands specify the data to be used or the addresses of the data involved.
Decoding translates the instruction into signals that can trigger the appropriate actions within the CPU.
TBC 403: Computer Organization Graphic Era Hill University,
57
Dehradun, Uttarakhand, India
3. Execute: Performing the Operation
The final stage is execution. Here, the CPU carries out the decoded instruction using its arithmetic
logic unit (ALU) and other components.
•Fetching any necessary data from registers or memory as specified by the instruction.
•Performing the operation defined by the opcode (e.g., adding two numbers, moving data from
one place to another, or branching to a different part of the program).
•Storing the result back in a register or memory location as required.
Example
Consider a simple instruction to add two numbers stored in memory.
1️.Fetch: The PC points to the memory address 100. The instruction at this address, ADD A, B, is fetched
and stored in the IR.
2.Decode: The CU decodes the ADD A, B instruction, identifying it as an addition operation and
determining the locations of operands A and B.
3.Execute: The CPU fetches the values from locations A and B, performs the addition, and stores the result
in a specified register or memory location.
TBC 403: Computer Organization Graphic Era Hill University,
58
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
59
Dehradun, Uttarakhand, India
TBC 403: Computer Organization Graphic Era Hill University,
60
Dehradun, Uttarakhand, India
Special-Purpose Registers
Special-purpose registers are designed for specific tasks within the CPU. Each one plays a
unique role in facilitating the CPU's operation.
Program Counter (PC)
•Function: The PC holds the address of the next instruction to be executed in the program.
•Importance: It ensures the sequential execution of instructions by incrementing to point to
the next instruction after one is executed.
•Operation: During the fetch phase of the instruction cycle, the PC is used to retrieve the
next instruction from memory.
Memory Data Register (MDR)
•Role: It temporarily stores data that is being transferred to or from the memory.
•Significance: Acts as a two-way register, interfacing between the CPU and the memory for
data transactions.
Memory Address Register (MAR)
•Purpose: Stores the memory address from which data will be fetched to the CPU or where
data will be sent and stored.
.
TBC 403: Computer Organization Graphic Era Hill University,
61
Dehradun, Uttarakhand, India
•Instruction Register (IR): The IR holds the instruction which is just about to be executed. The
instruction from the PC is fetched and stored in IR. As soon as the instruction is placed in IR, the CPU
starts executing the instruction, and the PC points to the next instruction to be executed.
•Stack Pointer (SP): The stack PCs pointer points to the top of the stack, which is a part of the memory
used to store function calls and other operations.
General Purpose Registers
Accumulator (A)
•Function: A crucial register that stores intermediate results of calculations in the Arithmetic and Logic
Unit (ALU).
•Benefit: Reduces the need to access the slower main memory for intermediate calculations, thereby
speeding up processing.
Status Register
•Function: Contains flags that represent the state of the CPU and the outcomes of operations, like zero,
carry, or overflow.
•Flag Register: A flag register , also known as a status register or condition code register, is a special type
of register in a computer’s central processing unit (CPU) used to indicate the status of the CPU or the
outcome of various operations such as Zero Flag, Carry flag, Sign Flag, Overflow Flag, Parity Flag,
Auxiliary Carry Flag, and Interrupt Enable Flag.
TBC 403: Computer Organization Graphic Era Hill University,
62
Dehradun, Uttarakhand, India
MAR and MDR Registers
• Collectively, the memory is viewed at the register level as a device,
M.
• Memory is usually accessed in computer systems by putting the
desired address in a special register, the Memory Address Register
(MAR, or AR)
• When data is to be accessed from the memory then it is accessed
using a special register, called as Memory Data Register (MDR,
or DR)
M
Memory Read
AR
unit Write
Data out Data in
TBC 403: Computer Organization Graphic Era Hill University,
63
Dehradun, Uttarakhand, India
Memory READ and WRITE Operation
• To read a value from a location in memory
and load it into a register.
R1 M[AR]
• To write a value from a register to a location
in memory.
M[AR] R1
TBC 403: Computer Organization Graphic Era Hill University,
64
Dehradun, Uttarakhand, India
List of Registers
DR 16 Data Register Holds data for the memory.
AC 16 Accumulator Processor register
IR 16 Instruction Register Holds instruction code
PC 16 Program Counter Holds address of instruction
TR 16 Temporary Register Holds temporary data
INPR 8 Input Register Holds input character
OUTR 8 Output Register Holds output character
TBC 403: Computer Organization Graphic Era Hill University,
65
Dehradun, Uttarakhand, India
Unit II
Components of CPU
TBC 403: Computer Organization Graphic Era Hill University,
66
Dehradun, Uttarakhand, India
Unit II
• A simple execution cycle in the CPU can be described as
below:
• The CPU fetches the instruction to be executed from the
main memory and stores it in the Instruction Register (IR).
• The instruction is decoded.
• The operands are fetched from the memory system and
stored in the CPU registers.
• The instructions are then executed.
TBC 403: Computer Organization Graphic Era Hill University,
67
Dehradun, Uttarakhand, India
Unit II
General Register Organization
• A group of flip-flops forms a register.
• A register is a special high speed storage area in the CPU.
• The data registers perform two important functions in the CPU
operation.
• Providing a temporary storage area for data.
• Storing the status of the CPU as well as information about the
currently executing program.
• Address of the next program instruction, such information is
stored in the registers.
TBC 403: Computer Organization Graphic Era Hill University,
68
Dehradun, Uttarakhand, India
General Organization of Registers
R1 ALU
R2
I/O R3 Memory
R4
Control
Unit
R5
AC(Accumulator),
CY(Carry Flag),
FR(Flag Register)
TBC 403: Computer Organization Graphic Era Hill University,
69
Dehradun, Uttarakhand, India
Data Path and Control Path
TBC 403: Computer Organization Graphic Era Hill University,
70
Dehradun, Uttarakhand, India
Data Path and Control Path
TBC 403: Computer Organization Graphic Era Hill University,
71
Dehradun, Uttarakhand, India
Data Path and Control Path
Data Path:
Data path operates on operands stored in internal data registers and
stores the result in another data register. Figure shows data path under
the control of control path.
Control Path:
Control path issues control words to data path in proper sequence and at
proper times in order to control the operation on data.
Data path generates status signals, which may provide valuable
feedback to control path.
TBC 403: Computer Organization Graphic Era Hill University,
72
Dehradun, Uttarakhand, India
Data Path and Control Path
The processor can be viewed as integration of two things : a data path and a control
unit.
• The data path includes the ALU, registers including program counter, memories
(memory bus paths), and multiplexers used in processing elements of the processor.
All these components of data path perform various operations depending upon the
instruction encountered. The coordination among these components is the task of the
control unit.
• When we call the ALU as heart of the processor, we can see the control unit as the
'brain' of processor. Control unit performs the major functionality in the processor
and is perhaps the most complex part of any processor. The control unit is also
termed as decode unit since it decodes the instruction. The instruction fetched from
memory (contained in the Instruction Register), is fed to the control unit and
appropriate control signals are generated by it, to execute that instruction. These
control signals are fed to various parts of data path as their control signals.
TBC 403: Computer Organization Graphic Era Hill University,
73
Dehradun, Uttarakhand, India
Data Path and Control Path
• Some components of data path may feed-back certain status signals to the
control unit, using which some conditional instruction might be executed.
Design of the data path is concerned with the processor organization. A good
data path is the one through which data signal takes minimum end-to-end path
for execution, giving highest possible speed.
• The control unit which is almost biggest part (in terms of logic) of processor has
to be designed carefully to get best performance. Some components of data path
may feed-back certain status signals to the control unit, using which some
conditional instruction might be executed.
• Design of the data path is concerned with the processor organization. A good
data path is the one through which data signal takes minimum end-to-end path
for execution, giving highest possible speed.
TBC 403: Computer Organization Graphic Era Hill University,
74
Dehradun, Uttarakhand, India
ARITHMETIC MICROOPERATIONS
• R3 R1 + R2 Contents of R1 plus R2 transferred to R3
• R3 R1 - R2 Contents of R1 minus R2 transferred to R3
• R2 R2’ Complement the contents of R2
• R2 R2’+ 1️ 2's complement the contents of R2
• R3 R1️ + R2’+ 1️ Subtraction
• R1 R1 + 1 Increment
• R1 R1 - 1 Decrement
TBC 403: Computer Organization Graphic Era Hill University,
75
Dehradun, Uttarakhand, India
LOGIC MICROOPERATIONS
• Logic microoperations are bit-wise operations, i.e.,
they work on the individual bits of data.
• Useful for bit manipulations on binary data.
• Useful for making logical decisions based on the bit
value.
• However, most systems only implement four of these
• AND (), OR (), XOR (), Complement/NOT
• The others can be created from combination of these.
TBC 403: Computer Organization Graphic Era Hill University,
76
Dehradun, Uttarakhand, India
LIST OF LOGIC MICROOPERATIONS
Micro-Operations Name
A0 Clear
A AND B AND
A B Transfer B to A
A XOR B Exclusive-OR
A OR B OR
(A OR B)’ NOR
(A XOR B)’ Exclusive-NOR
B B’ Complement B
A A’ Complement A
(A AND B)’ NAND
A all 1's Set to all 1's
TBC 403: Computer Organization Graphic Era Hill University,
77
Dehradun, Uttarakhand, India
LOGICAL SHIFT
• In a logical shift the serial input to the shift is a 0.
• A right logical shift operation:
• A left logical shift operation:
0
• shl for a logical shift left
• shr for a logical shift right
• Examples:
• R2 shr R2
• R3 shlTBCR3
403: Computer Organization Graphic Era Hill University,
78
Dehradun, Uttarakhand, India
CIRCULAR SHIFT
• In a circular shift the bit that is shifted is also rotated at the other end
of the register.
• A right circular shift operation:
A left circular shift operation:
• cil for a circular shift left
• cir for a circular shift right
• Examples:
• R2 cir R2
• R3 cil R3
TBC 403: Computer Organization Graphic Era Hill University,
79
Dehradun, Uttarakhand, India
ARITHMETIC SHIFT
• In arithmetic shift microoperation along with the serial bit signed bit
is also shifted. 0
sign
bit
– ashl for an arithmetic shift left
– ashr for an arithmetic shift right
–Examples:
R2 ashr R2
R3 ashl R3
TBC 403: Computer Organization Graphic Era Hill University,
80
Dehradun, Uttarakhand, India
ARITHMETIC SHIFT
• In arithmetic shift microoperation along with the serial bit signed bit
is also shifted. 0
sign
bit
– ashl for an arithmetic shift left
– ashr for an arithmetic shift right
–Examples:
R2 ashr R2
R3 ashl R3
TBC 403: Computer Organization Graphic Era Hill University,
81
Dehradun, Uttarakhand, India
Microprogrammed Control
TBC 403: Computer Organization Graphic Era Hill University,
82
Dehradun, Uttarakhand, India
Microprogrammed Control Organization
External Next Address Control
input CDR Control
Generator CAR Memory word
(sequencer) (ROM)
• Next Address Generator:
• It is used to generate the next address of the microinstruction incrementing by
1 to the initial address of the microinstruction.
• Control address register (CAR)
• Specifies address of next microinstruction
Example:
-Initial Address 20H LDA A //Microinstruction 1
21H LDA B //Microinstruction 2
22H ADD A, B //Microinstruction 3
• Collection of microinstructions is called a microprogram.
TBC 403: Computer Organization Graphic Era Hill University,
83
Dehradun, Uttarakhand, India
Microprogrammed Control Organization
• Control memory
• Contains microprograms (set of microinstructions)
• Microinstruction contains
• Bits initiate microoperations
• Bits determine address of next microinstruction.
• Control data register (CDR)
• Specifies the data provided in the microinstructions
-Initial Address 20H LDA A //Microinstruction 1
21H LDA B //Microinstruction 2 Routine1
22H ADD A, B //Microinstruction 3
Microprogram
23H LDA A //Microinstruction 4
24H LDA B //Microinstruction 5 Routine2
25H ADD A, B //Microinstruction 6
.
TBC 403: Computer Organization Graphic Era Hill University,
84
Dehradun, Uttarakhand, India