Unit 1 - Computer Architecture - WWW - Rgpvnotes.in
Unit 1 - Computer Architecture - WWW - 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 diferent 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. Diferent addressing mechanism to access data
Computer organization refers to the operational units and their interconnections that
realize the architectural speciications. 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 diferent 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 you know each processor understands a ixed no of
instructions. Hence forth 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 diferent.
Computer Generations
First Generation (1940-1956) Vacuum Tubes
The irst 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 irst computers generated a lot of heat,
which was often the cause of malfunctions. First generation computers relied on machine
language, the lowest-level programming language understood by computers, to perform
operations, and 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 irst-
generation computing devices.
Advantages
• Vacuum tubes were the only electronic component available during those days.
• Vacuum tube technology made pssible to make electronic digital computers.
• These computers could calculate data in millisecond.
Disadvantages
• The computers were very large in size.
• They consumed a large amount of energy.
• They heated very soon due to thousands of vacuum tubes.
• They were not very reliable.
• Air conditioning was required.
Advantages
• Smaller in size as compared to the irst-generation computers.
• The 2nd generation Computers were more reliable
• Used less energy and were not heated.
• Wider commercial use.
• Better portability as compared to the irst-generation computers.
• Better speed and could calculate data in microseconds
• Used faster peripherals like tape drives, magnetic disks, printer etc.
• Used Assembly language instead of Machine language.
• Accuracy improved.
Disadvantages
• Cooling system was required
• Constant maintenance was required
• Commercial production was diicult
• Only used for speciic purposes
• Costly and not versatile
• Punch cards were used for input.
Third Generation (1964-1971) Integrated Circuits
The period of third generation was from 1965-1971. The computers of third generation used
Integrated Circuits (ICs) in place of transistors. A single IC has many transistors, resistors, and
capacitors along with the associated circuitry. The IC was invented by Jack Kilby. This
development made computers smaller in size, reliable, and eicient. In this generation
remote processing, time-sharing, multiprogramming operating system were used. High-
level languages (FORTRAN-II TO IV, COBOL, PASCAL PL/1, BASIC, ALGOL-68 etc.) were used
during this generation.
The main features of third generation are:
• IC used
• More reliable in comparison to previous two generations
• Smaller size
• Generated less heat
• Consumed lesser electricity
• Supported high-level language
Advantages
• Smaller in size as compared to previous generations.
• Used less energy
• Produced less heat as compared to the previous two generations of computers.
• Better speed and could calculate data in nanoseconds.
• Used fan for heat discharge to prevent damage.
• Totally general purpose
• Could be used for high-level languages.
• Good storage
• Less expensive
• Better accuracy
• Commercial production increased.
• Used mouse and keyboard for input.
Disadvantages
• Air conditioning was required.
• Highly sophisticated technology required for the manufacturing of IC chips.
Advantages
• More powerful and reliable than previous generations.
• 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
• Less need of repair.
• Cheapest among all generations
• All types of High level languages can be used in this type of computers
Disadvantages
• The latest technology is required for manufacturing of Microprocessors.
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. It is named after mathematician and early computer scientist John von Neumann.
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.
There are two types of semiconductor memories -
• Volatile Memory: RAM (Random Access Memory).
• 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 ield.
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 ield.
Example:
Register organization
The CPU is made up of three major parts: Register Set, ALU, and Control Unit as shown in
igure 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 igure 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).
Fig 1.3
General register organization
Example: R1
– MUX selector (SELA): BUS A
– MUX selector (SELB): BUS B
– ALU operation selector (OPR): ALU to ADD
– Decoder destination selector (SELD): R1
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 lag
register constitutes a lag (or alarm), such that the bit value indicates if a speciied
condition was encountered while executing an instruction.
Register Transfer:
The symbolic notation used to describe microoperation transfer among registers is known
as RTL. The three basic components of a RTL are:
1. The set of registers.
2. The sequence of microoperation performed on the binary information stored in
registers.
3. The control function that initiates the sequence of microoperation. It is a Boolean
variable that can be either 0 or 1.
Memory Transfer:
Read Operation: The transfer of information from a memory word to the outside
environment is called a read operation.
Read: DR ss M[AR]
Write Operation: The transfer of new information to be stored into the memory is called a
write operation.
Write: M[AR] ss R1
BUS transfer
Using Multiplexers
Rather than connecting wires between all registers, a common bus is used A bus structure
consists of a set of common lines, one for each bit of a register Control signals determine
which register is selected by the bus during each transfer Multiplexers can be used to
construct a common bus Multiplexers select the source register whose binary information is
then placed on the bus the select lines are connected to the selection inputs of the
multiplexers and choose the bits of one register
In general, a bus system will multiplex k registers of n bits each to produce an n-line
common bus
• This requires n multiplexers – one for each bit
• The size of each multiplexer must be k x 1
• The number of select lines required is log k
• To transfer information from the bus to a register, the bus lines are connected to the
inputs of all destination registers and the corresponding load control line must be
activated rather than listing each step as
BUS ← C, R1 ← BUS,
R1 ← C, since the bus is implied
Three-state gates
Instead of using multiplexers, three-state gates can be used to construct the bus
system
A three-state gate is a digital circuit that exhibits three states
• Two of the states are signals equivalent to logic 1 and 0
• 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 signiicance
The three-state bufer 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 efects
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 igure 1.4.
To construct a common bus for four registers of n bits each using three-state bufers, we
need n circuits with four bufers in each Only one decoder is necessary to select between
the four registers.
Memory Transfer
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.
Types of Microoperations
- Register transfer micro-operations: These types of micro operations are used to
transfer from one register to another binary information.
- Arithmetic micro-operations : These micro-operations are used to perform on numeric
data stored in the registers some arithmetic operations.
- Logic micro-operations: These micro operations are used to perform bit style
operations / manipulations on non-numeric data.
- Shift micro operations: As their name suggests they are used to perform shift
operations in data store in registers.
Arithmetic Microoperation
The basic arithmetic microoperations are
• Addition
• Subtraction
• Increment
• Decrement
The arithmetic microoperations deined by the statement R3 ss R1 + R2 speciies the odd
microoperation. It means the content of registers R1 and R2 are added together and
transferred to the register R3. The subtraction microoperation is implemented by
complementation and addition instead of subtracting directly. The increment and
decrement microoperations are indicated by +1 and -1 operations.
The additional arithmetic microoperations are
• Add with carry
• Subtract with borrow
Logic microoperations
– Selective-set A ss A + B
– Selective-complement A ss A ⊕ B
– Selective-clear A ss A • B’
– Mask (Delete) A ss A • B
– Clear A ss A ⊕ B
– Insert A ss (A • B) + C
– Compare A ss A ⊕ B
Selective Set
In a selective set operation, the bit pattern in B is used to set certain bits in A.
1100 At
1010 B
---------------------
1110 At+1 (A ss A + B)
Bits in resister A are set to 1 when there are corresponding 1's in resister B. It does not
afect the bit positions that have 0's in B.
Selective-complement
In a selective complement to operation, the bit pattern in B is used to complement certain
bits in A.
1100 At
1010 B
---------------------
0110 At+1 (A ss A ⊕ B)
If a bit in B is 1, corresponding position in A get complemented from its original value,
otherwise it is unchanged.
Selective-clear
In a selective clear operation, the bit pattern in B is used to clear certain bits in A.
1100 At
1010 B
----------------------
0100 At+1 (A ss A • B')
If a bit in B is 1, corresponding position in A is set to 0, otherwise it is unchanged.
Mask Operation
In a mask operation, the bit pattern in B is used to clear certain bits in A.
1100 At
1010 B
----------------------
1000 At+1 (AssA•B)
Suppose you want to introduce 1010 into the low order four bits of A:
1101 1000 1011 0001 A (Original)
1101 1000 1011 1010 A (Desired)
1101 1000 1011 0001 A (Original)
1111 1111 1111 0000 B (Mask)
---------------------------
1101 1000 1011 0000 A (Intermediate)
0000 0000 0000 1010 Added bits
---------------------------
1101 1000 1011 1010 A (Desired)
Shift Microoperations
Shift microoperations are used for serial transfer of data. They are also used in conjunction
with arithmetic, logic and other data processing operations. The contents of are sister can
be shifted left or right. There are three types of shifts
1. Logical shift
2. Circular shift
3. Arithmetic shift
Logical Shift
A logical shift is one that transfers 0 through the serial input. In a Register Transfer
Language, the following notation is used
– shl for a logical shift left
– shr for a logical shift right
Examples:
Page no: 12 Follow us on facebook to get real-time updates from RGPV
Downloaded from be.rgpvnotes.in
R2 ss-shrR2
R3
Circular Shift
Circular-shift circulates the bits of the resister around the two ends without the loss of
information.
Arithmetic Shift
An arithmetic shift is meant for signed binary numbers (integer). An arithmetic left shift
multiplies a signed number by 2 and an arithmetic right shift divides a signed number by 2.
Arithmetic shifts must leave the sign bit unchanged because the sign of the number
remains the same when it is multiplied or divided by 2. The left most bit in a resister holds
a sign bit and remaining hold the number. Negative numbers are in 2's complement form.
In a Resister Transfer Language, the following notation is used
– a shl for an arithmetic shift left
– a shr for an arithmetic shift right
Arithmetic shift-right
Arithmetic shift-right leaves the sign bit unchanged and shifts the number (including a sign
bit) to the right. Thus ,Rn-1remains same; Rn-2receives input from Rn-1and so on.
This circuit provides 8 arithmetic operations, 4 logic operations and 2 shift operations. Each
operation is elected with ive variables s3, s2, s1, s0 and cin. The input carry cin is used
for arithmetic operations only.
Table below lists the 14 operations of the ALU.