CSA Notes Unit 2
CSA Notes Unit 2
Computer Types
The different types of computers are
1. Personal computers: - This is the most common type found in homes, schools, Business
offices etc., It is the most common type of desk top computers with processing and storage units
along with various input and output devices.
2. Note book computers: - These are compact and portable versions of PC
3. Work stations: - workstation, a high-performance computer system that is basically designed
for a single user and has advanced graphics capabilities, large storage capacity, and a powerful
central processing unit. A workstation is more capable than a personal computer (PC) but is less
advanced than a server. These are used in engineering applications of interactive design work.
4. Enterprise systems: - These are used for business data processing in medium to large
corporations that require much more computing power and storage capacity than work stations.
Internet associated with servers have become a dominant worldwide source of all types of
information.
5. Super computers: - A supercomputer is a computer with a high level of performance as
compared to a general-purpose computer. The performance of a supercomputer is commonly
measured in floating-point operations per second instead of million instructions per second.
These are used for large scale numerical calculations required in the applications like weather
forecasting etc.
Basic Computer Model and Functional Units of a Computer
The model of a computer can be described by four basic units in high level abstraction. These
basic units are:
• Central Processor Unit
• Input Unit
• Output Unit
• Memory Unit
Most of the computer operators are executed in ALU of the processor like addition, subtraction,
division, multiplication, etc. the operands are brought into the ALU from memory and stored in
high speed storage elements called register. The control and the ALU are many times faster than
other devices connected to a computer system. This enables a single processor to control a
number of external devices such as key boards, displays, magnetic and optical disks, sensors and
other mechanical controllers.
Control unit: It effectively is the nerve center that sends signals to other units and senses their
states. The actual timing signals that govern the transfer of data between input unit, processor,
memory and output unit are generated by the control unit.
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.
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.
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.
This instruction adds the operand at memory location LOCA, to operand in register R0 & places
the sum into register. This instruction requires the performance of several steps,
1. First the instruction is fetched from the memory into the processor.
2. The operand at LOCA is fetched and added to the contents of R0
3. Finally the resulting sum is stored in the register R0
The preceding add instruction combines a memory access operation with an ALU Operations. In
some other type of computers, these two types of operations are performed by separate
instructions for performance reasons.
Load LOCA, R1
Add R1, R0
Transfers between the memory and the processor are started by sending the address of the
memory location to be accessed to the memory unit and issuing the appropriate control signals.
The data are then transferred to or from the memory.
Von-Neumann Architecture (Model)
• Von-Neumann proposed his computer architecture design in 1945 which was later known
as Von-Neumann Architecture.
• It consisted of a Control Unit, Arithmetic, and Logical Memory Unit (ALU), Registers
and Inputs/Outputs.
• Von Neumann architecture is based on the stored-program computer concept, where
instruction data and program data are stored in the same memory.This design is still
used in most computers produced today.
• A Von Neumann-based computer:
Uses a single processor
Uses one memory for both instructions and data.
Executes programs following the fetch-decode-execute cycle
The part of the Computer that performs the bulk of data processing operations is called
the Central Processing Unit and is referred to as the CPU.
The Central Processing Unit can also be defined as an electric circuit responsible for
executing the instructions of a computer program.
The CPU performs a variety of functions dictated by the type of instructions that are
incorporated in the computer.
The major components of CPU are Arithmetic and Logic Unit (ALU), Control Unit
(CU) and a variety of registers.
Control Unit
The Control Unit of a computer system controls the operations of components like ALU,
memory and input/output devices.
The Control Unit consists of a program counter that contains the address of the
instructions to be fetched and an instruction register into which instructions are fetched
from memory for execution.
Registers
Registers refer to high-speed storage areas in the CPU. The data processed by the CPU
are fetched from the registers.
Following is the list of registers that plays a crucial role in data processing.
Buses
Buses are the means by which information is shared between the registers in a multiple-
register configuration system.
A bus structure consists of a set of common lines, one for each bit of a register, through
which binary information is transferred one at a time. Control signals determine which
register is selected by the bus during each particular register transfer.
Von-Neumann Architecture comprised of three major bus systems for data transfer.
Memory Unit
A memory unit is a collection of storage cells together with associated circuits needed to
transfer information in and out of the storage.
The memory stores binary information in groups of bits called words.
The internal structure of a memory unit is specified by the number of words it contains
and the number of bits in each word.
Bus Structure
The simplest and most common way of interconnecting various parts of the computer.
To achieve a reasonable speed of operation, a computer must be organized so that all its
units can handle one full word of data at a given time.
A group of lines that serve as a connecting port for several devices is called a bus. In
addition to the lines that carry the data, the bus must have lines for address and control
purpose. Simplest way to interconnect is to use the single bus as shown below.
• Since the bus can be used for only one transfer at a time, only two units can actively use
the bus at any given time. Bus control lines are used to arbitrate multiple requests for use
of one bus.
• Single bus structure is
Low cost
Very flexible for attaching peripheral devices
• Multiple bus structure certainly increases, the performance but also increases the cost
significantly.
All the interconnected devices are not of same speed & time, leads to a bit of a problem. This is
solved by using cache registers (i.e. buffer registers). These buffers are electronic registers of
small capacity when compared to the main memory but of comparable speed. The instructions
from the processor at once are loaded into these buffers and then the complete transfer of data at
a fast rate will take place.
Software
• Software is a set of programs, which is designed to perform a well-defined function.
A program is a sequence of instructions written to solve a particular problem.
• There are two types of software −
System Software
Application Software
System Software
• The system software is a collection of programs designed to operate, control, and
extend the processing capabilities of the computer itself.
• System software is generally prepared by the computer manufacturers.
• These software products comprise of programs written in low-level languages, which
interact with the hardware at a very basic level.
• System software serves as the interface between the hardware and the end users.
• Some examples of system software are Operating System, Compilers, Interpreter,
Assemblers, etc.
Here is a list of some of the most prominent features of a system software −
• Close to the system
• Fast in speed
• Difficult to design
• Difficult to understand
• Less interactive
• Smaller in size
• Difficult to manipulate
• Generally written in low-level language
Application Software
Performance
The most important measure of the performance of a computer is how quickly it can
execute programs.
The speed with which a computer executes program is affected by the design of its
hardware.
Three factors affect performance:
o Hardware design
o Instruction set
o Compiler
The total time required to execute the program is elapsed time is a measure of the
performance of the entire computer system. It is affected by the speed of the processor,
the disk and the printer.
The time needed to execute an instruction is called the processor time. Just as the elapsed
time for the execution of a program depends on all units in a computer system, the
processor time depends on the hardware involved in the execution of individual machine
instructions. This hardware comprises the processor and the memory which are usually
connected by the bus.
Let us examine the flow of program instructions and data between the memory and the
processor. At the start of execution, all program instructions and the required data are stored in
the main memory. As the execution proceeds, instructions are fetched one by one over the bus
into the processor, and a copy is placed in the cache later if the same instruction or data item is
needed a second time, it is read directly from the cache. The processor and relatively small cache
memory can be fabricated on a single IC chip. A program will be executed faster if the
movement of instructions and data between the main memory and the processor is minimized,
which is achieved by using the cache.
For example: Suppose a number of instructions are executed repeatedly over a short period of
time as happens in a program loop. If these instructions are available in the cache, they can be
fetched quickly during the period of repeated use. The same applies to the data that are used
repeatedly.
Processor clock
Processor circuits are controlled by a timing signal called clock. The clock designer the regular
time intervals called clock cycles. To execute a machine instruction the processor divides the
action to be performed into a sequence of basic steps that each step can be completed in one
clock cycle. Processor used in today’s personal computer and work station have a clock rates that
range from a few hundred million to over a billion cycles per second.
T –processor time required to execute a program that has been prepared in high-level language
N –number of actual machine language instructions needed to complete the execution (note:
loop)
S –average number of basic steps needed to execute one machine instruction. Each step
completes in one clock cycle
R –clock rate
Performancemeasurements
It is very important to be able to access the performance of a computer, computer
designers use performance estimates to evaluate the effectiveness of new features.
Hence measurement of computer performance using bench mark programs is done to
make comparisons possible, standardized programs must be used. The performance
measure is the time taken by the computer to execute a given bench mark.
A non-profit organization called SPEC- system performance Evaluation Corporation
selects and publishes bench marks. The program selected range from game playing,
compiler, and data base applications to numerically intensive programs in astrophysics
and quantum chemistry.
The ‘SPEC’ rating is computed as follows.
If the SPEC rating = 50, means that the computer under test is 50 times as fast as bench
mark one.
The overall SPEC rating for the computer is given by
where ‘n’ = number of programs in suite.
Multiprocessor computer
Large computers that contain a number of processor units are called multiprocessor
system.
A multiprocessor system is simply acomputer that has more than one CPU on
itsmotherboard
Execute a number of different application tasks in parallel
Execute subtasks of a single large task in parallel
All processors have access to all of the memory –shared-memory multiprocessor
Cost –processors, memory units, complex interconnection networks
Multicomputers
A computer made up of severalcomputers. similar to parallelcomputing
Each computer only have access to its own memory
Exchange message via a communication network –message-passing multicomputers.
Data Representation
Representations of negative numbers using 1’s and 2’s complement and range
1s complement and 2s complement are way of representing the signed binary numbers.
In general, the binary number can be represented in two ways.
1. Unsigned Binary Numbers
2. Signed Binary Numbers
Since the magnitude of both numbers is the same, the first 7 bits in the representation are the
same for both numbers. For +34, the MSB is 0, and for -34,
34, the MSB or sign bit is 1.
In sign magnitude representations, there are two different representations for 0.
Using n-bits,
bits, the range of numbers that can be represented in Sign Magnitude Representation is
from – (2n-1 – 1) to (2n -1 – 1).
But the representation of the negative number is different. For example, if we want to represent -
34 in 2’s complement form then
1. Write the number
mber corresponding to +34.
2. Starting from Least Significant Bit (LSB), just copy all the bits until the first 1 is
encountered in the number.
3. After the first ‘1’ is encountered, invert all the 1s in the number with 0s and 0s in the
number with 1s (including the sign bit)
4. The resultant number is 2’s complement representation of the number -34.34.
The same is shown below.
The second way of representing --34 in 2’s complement form is
1. Write the number corresponding to +34.
2. Find 1’s complement of +34
3. Add ‘1’ to the 1’s complement number
4. The resultant is 2’s complement representation of -34
The same is shown below.
bit number N, its 2’s complement is (2n – N). For example, the 2’s complement of +34 in
For n-bit
8-bit form is (28 – 34). In binary, it is 100000000 – 00100010
0010 = 11011110. That is a third way of
finding the 2’s complement.
Here is the representation of -6060 in sign
sign-magnitude
magnitude form, 1’s complement, and 2’s complement
form.
Using n-bits,
bits, the range of number which can be represented in 2’s complement form is from
fr –
n-1 n-1
(2 ) to 2 – 1. For example, using 44-bits,
bits, it is possible to represent numbers from -8 to +7.
Unlike 1’s complement and sign magnitude form, there is a unique way of representing 0 in this
2’s complement form.
Fixed-point
point representation
Binary representation of 41.6875 is 101001.1011
To store this number, we have to store two information,
-- the part before decimal point and
-- the part after decimal point.
This is known as fixed-point
point representation where the position of decimal point is fixed and
number of bits before and after decimal point are also predefined.
If we use 16 bits before decimal point and 8 bits after decimal point, in signed magnitude form,
form
One bit is required for sign information, so the total size of the number is 25 bits
( 1(sign) + 16(before decimal point) + 8(after decimal point) ).
Floating-point
point representation
In this representation, numbers are represented by a mantissa comprisi
comprising
ng the significant digits
and an exponent part of Radix R. The format is:
Numbers are often normalized, such that the decimal point is placed to the right of the first non-
non
zero digit. For example, the decimal number, 5236 is equivalent to
To store this number in floating point representation, we store 5236 in mantissa part and 3 in
exponent part.
Even parity -- Even parity means the number of 1's in the given word including the parity bit should be
even (2,4,6,....).
Odd parity -- Odd parity means the number of 1's in the given word including the parity bit should be
odd (1,3,5,....).
Use of Parity Bit
The parity bit can be set to 0 and 1 depending on the type of the parity required.
• For even parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire word is even.
Shown in fig. (a).
• For odd parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire word is odd.
Shown in fig. (b).
• The basic symbols of the register transfer notation are listed in Table. Registers are
denoted by capital letters, and numerals may follow the letters. Parentheses are used to
denote a part of a register by specifying the range of bits or by giving a symbol name to a
portion of a register. The arrow denotes a transfer of information and the direction of
transfer. A comma is used to separate two or more operations that are executed at the
same time.
• Information transfer from one register to another is designated in symbolic form by
means of a replacement operator.
• The statement R2← R1 denotes a transfer of the content of register R1 into register R2. It
designates a replacement of the content of R2 by the content of R1. By definition, the
content of the source register R 1 does not change after the transfer.
• If we want the transfer to occur only under a predetermined control condition then it can
be shown by an if-then statement. if (P=1) then R2← R1
Where P is the control signal generated by a control section.
• Figure shows the block diagram that depicts the transfer from R1 to R2
The multiplexers select the source register whose binary information is then placed
on the bus. The construction of a bus system for four registers is shown in below figure.
The bus consists of four 4 x 1 multiplexers each having four data inputs, 0 through 3,
and two selection inputs, S1 and S0.
For example, output 1 of register A is connected to input 0 of MUX 1 because this
input is labelled A1.
• The diagram shows that the bits in the same significant position in each register are
connected to the data inputs of one multiplexer to form one line of the bus.
• Thus MUX 0 multiplexes the four 0 bits of the registers, MUX 1 multiplexes the four 1
bits of the registers, and similarly for the other two bits.
• The two selection lines S1 and S0 are connected to the selection inputs of all four
multiplexers.
• The selection lines choose the four bits of one register and transfer them into the four-line
common bus.
• When S1S0 = 00, register A is selected. This causes the bus lines to receive the
content of register A since the outputs of this register are connected to the 0 data inputs
of the multiplexers.
• Similarly, register B is selected if S1S0 = 01, and so on.
• Table 4-2 shows the register that is selected by the bus for each of the four possible
binary value of the selection lines.
• The symbolic statement for a bus transfer may mention the bus or its presence may be
implied in the statement.
Consider, BUS C, R1 BUS
• The content of register C is placed on the bus, and the content of the bus is loaded into
register R1 by activating its load control input. If the bus is known to exist in the system,
it may be convenient just to show the direct transfer.
R1 C
Three-State Bus Buffers:
A bus system can be constructed with three-state gates instead of multiplexers.
A three-state gate is a digital circuit that exhibits three states. Two of the states are
signals equivalent to logic 1 and 0 as in a conventional gate. The third state is a high-
impedance state.
The high-impedance state behaves like an open circuit, which means that the
output is disconnected and does not have logic significance.
Because of this feature, a large number of three-state gate outputs can be connected
with wires to form a common bus line without endangering loading effects.
The graphic symbol of a three-state buffer gate is shown in Fig.
The control input determines the output state. When the control input is equal to 1, the
output is enabled and the gate behaves like any conventional buffer, with the output equal to
the normal input.
When the control input is 0, the output is disabled and the gate goes to a high-impedance state,
regardless of the value in the normal input.
The construction of a bus system with three-state buffers is shown in Fig. 4
• Decoder is a digital circuit that has ‘n’ input lines and maximum of 2n output lines.
One of these outputs will be active High based on the combination of inputs present,
when the decoder is enabled. Fig shows 2 to 4 decoder and its truth table.
The outputs of four buffers are connected together to form a single bus line.
The control inputs to the buffers determine which of the four normal inputs will
communicate with the bus line.
No more than one buffer may be in the active state at any given time. The connected buffers
must be controlled so that only one three-state buffer has access to the bus line while all
other buffers are maintained in a high impedance state.
When the enable input of the decoder is 0, all of its four outputs are 0, and the bus line is in a
high-impedance state because all four buffers are disabled.
When the enable input is active, one of the three-state buffers will be active, depending on the
binary value in the select inputs of the decoder.
Memory Transfer
The transfer of information from a memory word to the outside environment is called a
read operation.
The transfer of new information to be stored into the memory is called a write operation.
The particular memory word or data (M) among the many available is selected by the
memory address during the transfer.
It is necessary to specify the address of M when writing memory transfer operations.
This will be done by enclosing the address in square brackets following the letter M.
Consider a memory unit that receives the address from a register, called the address
register (AR).
The data are transferred to another register, called the data register (DR).
The read operation can be stated as follows:
Read: DR<- M [AR]
This causes a transfer of information into DR from the memory word M selected by the
address in AR.
The write operation transfers the content of a data register to a memory word M selected
by the address. Assume that the input data are in register R1 and the address is in AR.
The write operation can be stated as follows:
Write: M [AR] <- R1
Types of Micro-operations:
Register Transfer Micro-operations: Transfer binary information from one register to
another.
Arithmetic Micro-operations: Perform arithmetic operation on numeric data stored in
registers.
•
• The other two data inputs are connected to logic-0 and logic-1.
• The four multiplexers are controlled by two selection inputs S1 and S0. The input
carry Cin, goes to the carry input of the FA in the least significant position. The other
carries are connected from one stage to the next.
• The output of the binary adder is calculated from the following arithmetic sum:
D = A + Y + Cin
where A is the 4-bit binary number at the X inputs and
Y is the 4-bit binary number at the Y inputs of the binary adder.
Cin is the input carry, which can be equal to 0 or 1.
Note that the symbol + in the equation above denotes an arithmetic plus. By controlling
the value of Y with the two selection inputs S1 and S0 and making Cin equal to 0 or 1, it
is possible to generate the eight arithmetic microoperations listed in Table.
Addition:
When S1S0= 00, the value of B is applied to the Y inputs of the adder.
If Cin, = 0, the output D =A+B.
If Cin = 1, output D=A+B + 1.
Both cases perform the add microoperation with or without adding the input carry.
Subtraction:
When S1S0 = 01, the complement of B is applied to the Y inputs of the adder.
If Cin = 1, then D = A + B + 1. This produces A plus the 2's complement of B, which
is equivalent to a subtraction of A -B.
When Cin = 0 then D = A + B. This is equivalent to a subtract with borrow, that is,
A-B-1.
Increment:
When S1S0 = 10, the inputs from B are neglected, and instead, all 0's are inserted into
the Y inputs. The output becomes D = A + 0 + Cin. This gives D = A when Cin = 0 and
D = A + 1 when Cin = 1.
In the first case we have a direct transfer from input A to output D.
In the second case, the value of A is incremented by 1.
Decrement:
When S1S0= 11, all l's are inserted into the Y inputs of the adder to produce the
decrement operation D = A -1 when Cin = 0.
This is because a number with all 1's is equal to the 2's complement of 1 (the 2's
complement of binary 0001 is 1111). Adding a number A to the 2's complement of 1
produces F = A + 2's complement of 1 = A — 1. When Cin = 1, then D = A -1 + 1=A,
which causes a direct transfer from input A to output D.
Logic Micro-operations:
Logic microoperations specify binary operations for strings of bits stored in registers. These
operations consider each bit of the register separately and treat them as binary variables.
For example, the exclusive-OR microoperation with the contents of two registers RI and R2
is symbolized by the statement
• There are 16 different logic operations that can be performed with two binary variables.
They can be determined from all possible truth tables obtained with two binary variables
as shown in Table. In this table, each of the 16 columns F0 through F15 represents a truth
table of one possible Boolean function for the two variables x and y.
•
•
Hardware Implementation
• The hardware implementation of logic microoperations requires that logic gates for each
bit or pair of bits in the registers to perform the required logic function. Although there
are 16 logic microoperations, most computers use only four — AND, OR, XOR
(exclusive-OR), and complement from which all others can be derived. Figure shows one
stage of a circuit that generates the four basic logic microoperations. It consists of four
gates and a multiplexer. Each of the four logic operations is generated through a gate that
performs the required logic. The outputs of the gates are applied to the data inputs of the
multiplexer. The two selection inputs S1 and S0 choose one of the data inputs of the
multiplexer and direct its value to the output.
Shift Microoperations:
Shift microoperations are used for serial transfer of data.
The contents of a register can be shifted to the left or the right.
During a shift-left operation the serial input transfers a bit into the rightmost position.
During a shift-right operation the serial input transfers a bit into the leftmost position.
There are three types of shifts: logical, circular, and arithmetic.
The symbolic notation for the shift microoperations is shown in Table.
.
Logical Shift
A logical shift is one that transfers 0 through the serial input.
Circular Shift
A circular shift (also known as a rotate operation) circulates the bits of the register around the
two ends without loss of information.
This is accomplished by connecting the serial output of the shift register to its serial input.
Arithmetic Shift
An arithmetic shift is a micro-operation that shifts a signed binary number to the left orright.
An arithmetic shift-left multiplies a signed binary number by2.
An arithmetic shift-right divides the number by2.
Hardware Implementation:
A combinational circuit shifter can be constructed with multiplexers as shown in Fig.
The 4-bit shifter has four data inputs, A0 through A3, and four data outputs, H0 through
H3.
There are two serial inputs, one for shift left (IL) and the other for shift right (IR).
When the selection input S=0 the input data are shifted right (down in the diagram).
When S = 1, the input data are shifted left (up in the diagram).
The function table in shows which input goes to each output after the shift.
A shifter with n data inputs and outputs requires n multiplexers.
The two serial inputs can be controlled by another multiplexer to provide the three
possible types of shifts.
Arithmetic Logic Shift Unit (ALU):
Instead of having individual registers performing the microoperations directly, computer
systems employ a number of storage registers connected to a common operational unit called
an arithmetic logic unit, abbreviated ALU.
The ALU is a combinational circuit so that the entire register transfer operation from the
source registers through the ALU and into the destination register can be performed during one
clock pulse period.
The shift microoperations are often performed in a separate unit, but sometimes the shift
unit is made part of the overall ALU.
The arithmetic, logic, and shift circuits introduced in previous sections can be combined
into one ALU with common selection variables. One stage of an arithmetic logic shift unit is
shown in Fig.
Table lists the 14 operations of the ALU. The first eight are arithmetic operations and are selected
with S3S2 = 00.
The next four are logic and are selected with S3S2 = 01.
The input carry has no effect during the logic operations and is marked with don't-care x’s.
The last two operations are shift operations and are selected with S3S2= 10 and 11.
The other three selection inputs have no effect on the shift.
Best Wishes