CA Unit 1
CA Unit 1
Tech
Subject Name: Computer Architecture
Subject Code: IT-402
Semester: 4th
Downloaded from be.rgpvnotes.in
UNIT-1
Computer architecture refers to those parameters of a computer system that are visible to a programmer or
those parameters that have a direct impact on the logical execution of a program. Examples of architectural
attributes include the instruction set, the number of bits used to represent different data types, I/O
mechanisms, and techniques for addressing memory.
Computer Architecture refers to those attributes of a system visible to a programmer or those attributes that
have a direct impact on the logical execution of a program.
Examples of architectural attributes include:
a) Instruction set designing
b) Instruction format
c) No of bits used to represent various types of data
d) Different addressing mechanism to access data
Computer organization refers to the operational units and their interconnections that realize the architectural
specifications. Examples of organizational attributes include those hardware details transparent to the
programmer, such as control signals, interfaces between the computer and peripherals, and the memory
technology used.
Ex: Two different models from a same vendor like Intel are brought to analyze. Both the models (laptop and
desktop) have same processor like core 2 duo. That means both models understand the same instruction set as
we know each processor understands a fixed no of instructions. Henceforth their architecture is same. Due to
the placement of various hardware components, one model (laptop) is slim and other is bulky. Hence their
organization is different.
Computer Generations
First Generation (1940-1956) Vacuum Tubes
The first computers used vacuum tubes for circuitry and magnetic drums for memory, and were often enormous,
taking up entire rooms. They were very expensive to operate and in addition to using a great deal of electricity,
the first computers generated a lot of heat, which was often the cause of malfunctions. They relied on machine
language, the lowest-level programming language understood by computers, to perform operations.They could
only solve one problem at a time, and it could take days or weeks to set-up a new problem. Input was based on
punched cards and paper tape, and output was displayed on printouts. The UNIVAC and ENIAC computers are
examples of first-generation computing devices.
Vacuum tubes were the only electronic component available during those days.
Advantages
Very slow speed.
Limited programming capabilities.
Used machine language only.
Used magnetic drums which provide very less data storage.
Better accuracy.
Commercial production increased.
Used mouse and keyboard for input.
Small in size.
Fast processing power with less power consumption.
Fan for heat discharging and thus to keep cold.
No air conditioning required.
Totally general purpose.
Commercial production.
Cheapest among all generations.
All types of High level languages can be used in this type of computers.
AI includes −
Robotics
Neural Networks
Game Playing
Development of expert systems to make decisions in real-life situations
Natural language understanding and generation
The Von Neumann architecture is a design model for a stored-program digital computer that uses a processing
unit and a single separate storage structure to hold both instructions and data.
B. Input Unit:
With the help of input unit data from outside can be supplied to the computer. Program or data is read into
main storage from input device or secondary storage under the control of CPU input instruction. Example of
input devices: Keyboard, Mouse, Hard disk, Floppy disk, CD-ROM drive etc.
C. Output Unit:
With the help of output unit computer results can be provided to the user or it can be stored in storage device
permanently for future use. Output data from main storage go to output device under the control of CPU
output instructions.
Example of output devices: Printer, Monitor, Plotter, Hard Disk, Floppy Disk etc.
D. Memory Unit:
Memory unit is used to store the data and program. CPU can work with the information stored in memory
unit. This memory unit is termed as primary memory or main memory module. These are basically
semiconductor memories.
Non-Volatile Memory: ROM (Read only Memory), PROM (Programmable ROM) EPROM (Erasable PROM),
EEPROM (Electrically Erasable PROM).
Secondary Memory:
There is another kind of storage device, apart from primary or main memory, which is known as secondary
memory. Secondary memories are non-volatile memory and it is used for permanent storage of data and
program.
Example of secondary memories:
Hard Disk, Floppy Disk, Magnetic Tape
CPU organization
1. The single accumulator organizations are performed with the implied accumulator register. The instruction
format in this type of organization uses one address field.
Example:
ADD X --> AC
2. The stack organized computer can use 1 or 0 address instruction and uses on y two instructions POP and
PUSH
Example:
PUSH X --> TOS ss-M[X]
POP --> TOS
3. When there are more than one register, general register organization can be used and the instruction
format may contain 2 or 3 address field.
Example:
ADD R1, R2 --> R1
ADD R1, R2, R3 --> R1
Register organization
The CPU is made up of three major parts: Register Set, ALU, and Control Unit as shown in figure below. The
register set stores intermediate data used during the execution of the instructions. The arithmetic logic unit
(ALU) performs the required microoperations for executing the instructions. The control unit supervises the
transfer of information among the registers and instructs the ALU as to which operation to perform.
A bus organization for 7 CPU register is shown in a figure below. All registers are connected to two multiplexers
(MUX) that select the registers for bus A and bus B. Registers selected by multiplexers are sent to ALU. Another
selector (OPR) connected to ALU selects the operation for the ALU. Output produced by ALU is stored in some
register and this destination register for storing the result is activated by the destination decoder (SELD).
7. Accumulator Register:
The accumulator register is located inside the ALU, it is used during arithmetic & logical operations of ALU. The
control unit stores data values fetched from main memory in the accumulator for arithmetic or logical
operation.
9. Flag Register:
The Flag register is used to indicate occurrence of a certain condition during an operation of the CPU. It is a
special purpose register with size one byte or two bytes. Each bit of the flag register constitutes a flag (or
alarm), such that the bit value indicates if a specified condition was encountered while executing an instruction.
Register Transfer:
Information transferred from one register to another is designated in symbolic form by means of replacement
operator.
R ← R It de otes the tra sfer of the data fro register R i to R
Normally we want the transfer to occur only in predetermined control condition. This can be shown by
following if-then state e t: if P= the R ← R
Here P is a control signal generated in the control section.
Control Function
A control function is a Boolean variable that is equal to 1 or 0. The control function is shown as:
P: R ← R
The control condition is terminated with a colon. It shows that transfer operation can be executed only if P=1.
Arrow A transfer R1 ss R2
Colon Terminates a control function T1:
Comma Multiple operation T:R1ss R2, R3 ss R4
Square Brackets Address for memory MDR ss M[MAR]
Memory Read: The read operation for the transfer of a memory unit M from an address register MAR
Bus & Memory Transfers:
BUS ← C, R ← BUS,
R ← C, si e the us is i plied
Three-state gates
Instead of using multiplexers, three-state gates can be used to construct the bus system
The third state is a high-impedance state – this behaves like an open circuit, which means the output is
disconnected and does not have a logic significance
The three-state buffer gate has a normal input and a control input which determines the output state With
control 1, the output equals the normal input With control 0, the gate goes to a high-impedance state This
enables a large number of three-state gate outputs to be connected with wires to form a common bus line
without endangering loading effects Decoders are used to ensure that no more than one control input is active
at any given time This circuit can replace the multiplexer in figure 1.4.
To construct a common bus for four registers of n bits each using three-state buffers, we need n circuits with
four buffers in each Only one decoder is necessary to select between the four registers.
Memory Transfer
We designate a memory word by the letter M. It is necessary to specify the address of M when writing
memory transfer Operations Designate the address register by AR and the data register by DR.
The read operation can be stated as:
Read: DR ← M [AR]
The write operation can be stated as:
Write: M [AR] ← R
The address register (AR) is used to select a memory address, and the data register (DR) is used to send and
receive data. Both these registers are connected to the internal bus. DR is a bridge between the internal BUS
and the memory data BUS.
Memory can also be connected directly to the internal BUS in theory.
M[AR] ← DR
DR ← M[AR]
Hence, accessing memory outside the CPU requires at least two clock cycles. First, we load AR with the desired
memory address, and then transfer to or from DR. In most typical computer systems, memory transfers take
many clock cycles, known as wait states.
Register transfer micro-operations: These types of micro operations are used to transfer from one
Types of Micro-operations
Arithmetic micro-operations: These micro-operations are used to perform on numeric data stored
register to binary information.
Logic micro-operations: These micro operations are used to perform bit style operations /
in the registers some arithmetic operations.
Shift micro operations: As their name suggests they are used to perform shift operations in data
store in registers.
Arithmetic Micro-Operations: Some of the basic micro-operations are addition, subtraction, increment and
decrement.
Add Micro-Operation
It is defined by the following statement:
R →R +R
The above statement instructs the data or contents of register R1 to be added to data or content of register R2
and the sum should be transferred to register R3.
Subtract Micro-Operation
Let us again take an example:
R →R +R '+
In subtract micro-operation, instead of using minus operator we take 1's compliment and add 1 to the register
which gets subtracted, i.e R1 - R2 is equivalent to R → R + R ' +
Increment/Decrement Micro-Operation
Increment and decrement micro-operations are generally performed by adding and subtracting 1 to and from
the register respectively.
R →R +
R →R –1
Symbolic Designation Description
R ←R +R Contents of R1+R2 transferred to R3.
R ← R - R2 Contents of R1-R2 transferred to R3.
R2 ← R ' Compliment the contents of R2.
R ← R '+ 2's compliment the contents of R2.
R ←R + R '+ R1 + the 2's compliment of R2 (subtraction).
R ←R + Increment the contents of R1 by 1.
R ←R -1 Decrement the contents of R1 by 1.
Logic Micro-Operations
These are binary micro-operations performed on the bits stored in the registers. These operations consider
each bit separately and treat them as binary variables.
Let us consider the X-OR micro-operation with the contents of two registers R1 and R2.
P: R ← R X-OR R2
In the above statement we have also included a Control Function.
Assume that each register has 3 bits. Let the content of R1 be 010 and R2 be 100. The X-OR micro-operation
will be:
Shift Micro-Operations
These are used for serial transfer of data. That means we can shift the contents of the register to the left or
right. In the shift left operation the serial input transfers a bit to the right most position and in shift
right operation the serial input transfers a bit to the left most position.
There are three types of shifts as follows:
a) Logical Shift
It transfers 0 through the serial input. The symbol "shl" is used for logical shift left and "shr" is used for logical
shift right.
R ← she R
R ← she R
The register symbol must be same on both sides of arrows.
b) Circular Shift
This circulates or rotates the bits of register around the two ends without any loss of data or contents. In this,
the serial output of the shift register is connected to its serial input. "cil" and "cir" is used for circular shift left
and right respectively.
c) Arithmetic Shift
This shifts a signed binary number to left or right. An arithmetic shift left multiplies a signed binary number by
2 and shift left divides the number by 2. Arithmetic shift micro-operation leaves the sign bit unchanged
because the signed number remains same when it is multiplied or divided by 2.