0% found this document useful (0 votes)
2 views

COA_Unit-1 Notes

The document provides lecture notes on Computer Organization and Architecture, covering fundamental concepts such as the basic parts of a computer, the roles of the CPU, memory, and input/output subsystems. It explains the importance of studying computer organization and architecture for optimizing program behavior and understanding hardware components. Additionally, it discusses number systems, data representation, and the stored-program concept introduced by Von Neumann.

Uploaded by

pardhukoneru123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

COA_Unit-1 Notes

The document provides lecture notes on Computer Organization and Architecture, covering fundamental concepts such as the basic parts of a computer, the roles of the CPU, memory, and input/output subsystems. It explains the importance of studying computer organization and architecture for optimizing program behavior and understanding hardware components. Additionally, it discusses number systems, data representation, and the stored-program concept introduced by Von Neumann.

Uploaded by

pardhukoneru123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Department of Computer Science and Engineering

RGUKT – SRIKAKULAM

COMPUTER ORGANIZATION AND ARCHITECTURE


LECTURE NOTES

Prepared by
Mr. Dileep Kumar Koda M. Tech., (Ph. D)
Asst. Professor
Computer Science & Engineering

Rajiv Gandhi University of Knowledge Technologies


Srikakulam
Catering to the Educational Needs of Gifted Rural Youth of Andhra Pradesh
(Established by the Govt. of Andhra Pradesh and recognized as per Section 2(f) of UGC Act, 1956)

S.M. Puram (Vi), Etcherla (M), Srikakulam Dist., A.P -532402.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
UNIT - I
Module – 1: Functional Blocks
● CPU
● Memory
● Input-Output Subsystems
● Control Unit
● Data Representation
Module – 2: Number Systems
● Signed Number representations
● Fixed and Floating Point Representations
● Character Representation

COMPUTER
What is a computer?

A computer is an electronic device that manipulates information, or data. It has the ability to store,
retrieve and process data.
(or)
A computer is an electronic device for storing and processing data, typically in binary form, according
to instructions given to it in a variable program

What are the Basic Parts of a Computer?


Every computer comprises 5 basic parts, namely, a motherboard, a central processing unit, a graphics
processing unit, a random access memory, and a hard disk or solid-state drive.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
Computer Organization and Architecture (COA):

 In the early part of the computer evolution, there were no stored-program computer
 The computational power was less and on the top of it the size of the computational was a
very huge one.
 The task that the computer designer handles is a complex one:
◦ Determine what attributes are important for a new machine
◦ Design a machine to maximize performance while staying within cost constraints
◦ Including instruction set design, functional organization, logic design, an implementation.
 While looking for the task for computer design, both the terms computer organization and
architecture
Why we need to study Computer Organization and Architecture (COA)?
 Without computers, the field of computer science does not exist.
 Its helps to design better programs, including system software such as compilers,
operating systems, and device drivers. –Optimize program behaviour.
 The main objective of the computer organizations is to understand the various computer
hardware components and the interaction between these components.
 Computer Architecture helps us to understand functionalities of a system.
 Computer Organization tells us how exactly all the units in the system are arranged and
interconnected.

Computer Architecture:
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 for represent
different data types, I/O Mechanisms, Techniques for addressing Memory.

Computer organization:
Computer organization refers to the operational units and their interconnections that realize the
architectural specifications.
Examples of organizational attributes include the hardware details transparent to the programmer
such as control signals, Interface between the computer and peripherals the memory technology used.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
Basic Computer Model & Basic functional blocks of a Computer:

The models of a computer can be described by four basic units in the high level of abstraction
and they are as follows.

1. Central Processor Unit


2. Input unit
3. Output unit
4. Memory unit

Units of a computer:

(Functional blocks of a basic Computer)

1. Central Processing Unit (CPU): A typical CPU has three major components:
A. Control Unit (CU)
B. Execution unit or Data Processing unit
A. Control Unit:
 Control Unit is the part of the computer central processing unit (cpu), which directs the
operations of the processor.
 It is the responsibility of the Control Unit to tell the computer’s memory, arithmetic/logic
unit and input and output devices how to respond to the instructions that have been sent
to the processor.
 Control unit has a set of registers and control circuit to generate control signals.
Note : Control Unit is a hardware part.
Note : Execution Unit is a software part.

Register set:
 Generally, register consists of a group of flip-flops and gates that effect their transition.
The flip-flops hold the binary information and the gates control when and how new
information is transferred into the register.
 Registers are extremely fast memory locations within the CPU that are used to create
and store the results of CPU operations and other calculations as a temporary data.
 Different computers have different register sets. They differ in the number of registers,
register types, and the length of each register.
 Eg.: Data Register(DR), Instruction Register (IR), etc..

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
B. Execution unit (or) Data processing unit:
 An execution unit performs the operations and calculations as instructed by the computer
program.
 It may have some registers and other internal units such as Arithmetic and Logic Unit (ALU).

Arithmetic and Logic Unit (ALU):


 It carries arithmetic and logic operations on the operands by the computer instruction.
2. 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.
 Ex: Keyboard, Mouse, Hard disk, Floppy disk, CD-ROM drive etc.

3. 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.
 Ex: Printer, Monitor, Plotter, Hard Disk, Floppy Disk etc.

4. Memory Unit
 Memory is basically a device that has the capacity to store information. A memory unit is the
amount of data that the memory can hold.
 It 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.
Primary Memory /Volatile Memory:

 It is the one that is responsible for operating the data that is available by the storage medium.
 The main memory handles each instruction of a computer machine.
 The memory can store gigabytes of data on a system but is small enough to carry the entire
database.
 The main memory loses the whole content if the system shuts down because of power failure
or other reasons.
Secondary Memory /Non-Volatile 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.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
Block diagram of Storage Device Hierarchy:

Memory Organization: Stored Program Concept


 The present digital computers are based on stored-program concept introduced by Von
Neumann. In this stored-program concept, programs and data are stored in separate storage
unit called memories.
 Central Processing Unit, the main component of computer can work with the information
stored in storage unit only.
 In 1946, Von Neumann and his colleagues began the design of a stored-program computer
at the Institute for Advanced Studies in Princeton. This computer is referred as the IAS
computer.
Central Processing Unit:
 This is the main unit of computer, which is responsible to perform all the operations. The CPU
of the IAS computer consists of a data processing unit and a program control unit.
 The data processing unit contains a high speed registers intended for temporary storage of
instructions, memory addresses and data. The main action specified by instructions are
performed by the arithmetic-logic circuits of the data processing unit.
 The control circuits in the program control unit are responsible for fetching instructions,
decoding opcodes, controlling the information movements correctly through the system, and
providing proper control signals for all CPU actions.

The Main Memory Unit:


 It is used for storing programs and data. The memory locations of memory unit is uniquely
specified by the memory address of the location. M(X) is used to indicate the location of the
memory unit M with address X.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
 The data transfer between memory unit and CPU takes place with the help of data register
DR. When CPU wants to read some information from memory unit, the information first
brings to DR, and after that it goes to appropriate position. Similarly, data to be stored to
memory must put into DR first, and then it is stored to appropriate location in the memory
unit.
 The address of the memory location that is used during memory read and memory write
operations are stored in the memory register AR.
 The information fetched from the memory is an operand of an instruction, then it is moved
from DR to data processing unit (either to AC or MQ). If it is an operand, then it is moved to
program control unit (either to IR or IBR).
 Two additional registers for the temporary storage of operands and results are included in data
processing units: the accumulator AC and the multiplier-quotient register MQ.
 Two instructions are fetch simultaneously from M and transferred to the program control unit.
The instruction that is not to be executed immediately is placed in the instruction buffer
register IBR. The opcode of the other instruction is placed in the instruction register IR where
it is decoded.
 In the decoding phase, the control circuits generate the required control signals to perform the
specified operation in the instruction.
 The program counter PC is used to store the address of the next instruction to be fetched from
memory.
Input Output Device:
 Input devise are used to put the information into computer. With the help of input devices, we
can store information in memory so that CPU can use it. Program or data is read into main
memory from input device or secondary storage under the control of CPU input instruction.
 Output devices are used to output the information from computer. If some results are evaluated
by computer and it is stored in computer, then with the help of output devices, we can present
it to the user. Output data from the main memory go to output device under the control of CPU
output instruction.
Registers & their functionalities
1. DR: The Data Register which hold the operand read from the memory location and Data
transfer between memory unit and CPU takes place with the help of data register.
2. PC: The Program Counter (PC) which hold the address of the next instruction to be read from
memory after the current instruction is executed.
3. AC: The Accumulator (AC) register is a general purpose processing register.
4. IR: The instruction read from memory is placed in the Instruction register (IR).
5. MQ: Multiplier quotient (MQ), Employed to hold temporarily operands and results of ALU
operations.
6. IBR: The instruction that is not to be executed immediately is placed in the instruction buffer
register
7. AR: The address of the memory location that is used during memory read and memory write
operations are stored in the memory register AR.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
Number System

Depending on the base or radix, number systems can be classified into the following four major types

1. Decimal Number System (radix/base=10)
2. Binary Number System (radix/base =2)
3. Octal Number System (radix/base=8)
4. Hexadecimal Number System (radix/base=16)

1. Decimal Number System:


The system of numbers which has base or radix 10, i.e. uses total 10 symbols
to represent numbers of the system is called decimal number system. The symbols used in the decimal
number system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; where each of these symbols assigned a specific value.

Eg:
(1×1000) + (2×1000) + (3×1000) + (4×1)
1000+200+30+4=1234

2. Binary Number system:


A number system with base or radix 2 is called binary number system. The
binary number system uses only 2 symbols (0 and 1) to represent binary numbers. All modern digital
devices like computers, combinational circuits, sequential circuits, etc. use the binary number system
to operate.

 In computer to represent any information we have to take values with the help of two signals.
 These two signals will correspond to the two level of signals.
 DEFINITION: It uses two digits and coefficients are multiplied by the power of 2.
 For an n-bit number the coefficient is aj multiplied by 2j
where, (0<=j<n)
Eg:
Let a binary number 1101 and we have to convert it into an equivalent decimal number, then
(1×23) + (1×22) + (0×21) + (1×20)
8+4+0+1= 13
∴ (1101)2 = (13)10

3. Octal Number System:

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
A number system which has base 8 is called an octal number system. Therefore, the octal number
system uses 8 symbols, (0, 1, 2, 3, 4, 5, 6, 7) to represent the number.

EX: An octal number can be converted into an equivalent decimal number as follows. Let an octal
number 124 and we need to find its equivalent in decimal, then
(1×82) + (2×81) + (4×80)
64+16+4=84
∴ (124)8 = (84)10
Hexa Decimal Number System:
The number system with base or radix 16 is called as hexadecimal number system. Thus, the
hexadecimal number system uses 16 symbol to represent numbers. These symbols are 0, 1, 2, 3, 4, 5,
6, 7, 8, 9, A, B, C, D, E, F. Where, A = 10; B = 11; C = 12; D = 13; E = 14; F = 15.
Eg.: Let 1AF is a hexadecimal number, we can convert it into the equivalent decimal number as
follows −
(1×162) + (A×161) + (F×160)
(1×162) + (10×161) + (15×160)
256+160+15=431
∴(1AF)16 = (431)10
∴(1AF)16 = (431)10

DATA REPRESENTATION

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
Representation of Unsigned Integers:
 Any integer can be stored in computer in binary form.
 For example: The binary equivalent of integer 107 is 1101011, so 1101011 are stored to
represent 107.
 These are binary numbers that are always assumed to be positive.
E.g.: Roll Numbers, Memory addresses etc.

What is the size of Integer that can be stored in a Computer?


 It depends on the word size of the computer. If we are working with 8-bit computer, then we
can use only 8 bits to represent the number. The eight-bit computer means the storage
organization for data is 8 bits.
 In case of 8-bit numbers, the minimum number that can be stored in computer is 00000000
(0) and maximum number is 11111111 (255) (if we are working with natural numbers).
 So, the domain of number is restricted by the storage capacity of the computer. Also it is
related to number system; above range is for natural numbers.
 In general, for n-bit number, the range for natural number is from 0 to 2n – 1.
 Any arithmetic operation can be performed with the help of binary number system. Consider
the following two examples, where decimal and binary additions are shown side by side.

01101000 104
00110001 49
10011001 153
 In the above example, the result is an 8-bit number, as it can be stored in the 8-bit
computer, so we get the correct results

10000001 129
10101010 178
100101011 307

 In the above example, the result is a 9-bit number, but we can store only 8 bits, and the most
significant bit (msb) cannot be stored.
 The result of this addition will be stored as (00101011) which is 43 and it is not the desired
result. Since we cannot store the complete result of an operation, and it is known as the
overflow case.
 The smallest unit of information is known as BIT (Binary digit).
 The binary number 110011 consists of 6 bits and it represents:

 For an n-bit number the coefficient is – aj multiplied by 2j where, ( )

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
 The coefficient a(n-1) is multiplied by 2(n-1) and it is known as most significant bit (MSB).
 For our convenient, while writing in paper, we may take help of other number systems like
octal and hexadecimal. It will reduce the burden of writing long strings of 0s and 1s.
Octal Number: The octal number system is said to be of base, or radix 8, because it uses 8
digits and the coefficients are multiplied by power of 8.

Eight digits used in octal system are: 0, 1, 2, 3, 4, 5, 6 and 7.

Hexadecimal number: The hexadecimal number system is said to be of base, or radix 16,
because it uses 16 symbols and the coefficients are multiplied by power of 16.

Sixteen digits used in hexadecimal system are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F.


Consider the following addition example:
Binary Octal Hexadecimal Decimal
01101000 150 68 104
00111010 072 3A 58
--------------- ------ ------ -----
10100010 242 A2 162

Signed Integers:
● These are Signed binary numbers that can be either positive or negative.
● The MSB of the number indicates whether it is positive or negative.
 If MSB is 0 then the number is Positive.
 If MSB is 1 then the number is Negative.
● Negative numbers are always stored in signed format.

Representation of signed numbers:


 For n-bit number, the range for natural number is from 0 to 2n – 1.
 There are three different schemes to represent negative number:
A. Signed-Magnitude form.
B. 1’s complement form.
C. 2’s complement form.
Note: Negative numbers are stored in 2’s complement form due to two reasons.
1) Two’s complement gives a unique representation for zero.

 Any other system gives a separate representation for +0 and for -0. his is absurd.
 In two’s complement system, -(x) is stored as two’s complement of (x).
 Applying the same rule for 0, -(0) should be stored as two’s complement of 0. 0 is stored as
000.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
 So (0) should be stored as two’s complement of 000, which again is 000. Hence two’s
complement gives a unique representation for 0.
2) It produces an additional number on the negative side.

 As two’s complement system produces a unique combination for 0, it has a spare combination
‘100’ in the above case, and can be used to represent (4)10
3-Bit Representation of unsigned numbers:

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
4-Bit Representation of unsigned numbers:

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
Representation of a real numbers
Fixed point representation:
 Any real number can be converted to binary number system. There are two schemes to represent
real number:
o Fixed-point representation
o Floating-point representation
 Before getting into representation of real numbers first, convert the given decimal number into a
binary number.
Eg : 48.687
Step-1: successive division for integers, results 110000
Step-2: successive multiplication for decimal part results 10101111111
Result =(48.627)10c=c (110000.10101111111)2
● To store this number, we have to store two information,
i. the part before decimal point and
ii. the part after decimal point.
● This is known as fixed-point representation where the position of decimal point is fixed and
number of bits before and after decimal point are also predefined.

Floating point representation :


 Numbers are represented by a mantissa comprising the significant digits and an exponent part
of Radix R.
Exponent
The format is: Mantissa X Base ( M X B E)

(Or)
Exponent
Mantissa X Base ( M X BE )

Numbers are often normalized, such that the decimal point is placed to the right of the first non zero
digit.
Eg: the decimal number,
5236 is equivalent to 5.236 X 103

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
(To store this number in floating point representation, we store 5236 in mantissa part and 3 in
exponent part.)

IEEE standard floating point format:


IEEE has proposed two standards for representing floating-
point number:
A. Single precision
B. Double precision
A. Single precision:

S E M
S - 1 bit for Sign bit (0 denotes + and 1 denotes)
E - 8 bits for Exponent
M - 23 bits for mantissa

B. Double Precision:

S E M

S - 1 bit for Sign bit (0 denotes+ and 1 denotes)


E - 11 bits for Exponent
M - 52 bits for mantissa

Representation of Character:
 Since we are working with 0's and 1's only, to represent character in computer we use strings of
0's and 1's only
 To represent character, we are using some coding scheme, which is nothing but a mapping
function.
 Some of standard coding schemes are: ASCII, EBCDIC, UNICODE.

ASCII: American Standard Code for Information Interchange.


 It uses a 7-bit code. All together we have 128 combinations of 7 bits and we can represent 128
character.
For example, 65 = 1000001 represents character 'A'.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
EBCDIC: Extended Binary Coded Decimal Interchange Code.
 It uses 8-bit code and we can represent 256 character.
UNICODE: It is used to capture most of the languages of the world. It uses 16-bit
 Unicode provides a unique number for every character, no matter what the platform, no matter
what the program, no matter what the language.
 The Unicode Standard has been adopted by such industry leaders as Apple, HP, IBM, JustSystem,
Microsoft, Oracle, SAP, Sun, Sybase, Unisys and many others.
Table -1:

1 bit Fundamental unit of information ,either 0 or 1


4 bits 1 Nibble
8 bits 1 Byte
1024 Bytes 1 Kilo Byte
1024 KB 1 Mega Byte
1024 MB 1 Giga Byte

Table -2:
Difference between Program and Data

Program Data
1.Programs are collection of software 1.Data are information stored in computer hard
instructions understandable by CPU. disc.
2.It is used to provide expected output whenever 2.It is used to help organization in effectively
executed by computer. determining cause of problems that occurred.
3.Programs helps in decision making purpose. 3.Data does not help in any decision making
purpose.
4.Programs are not simple and hard to 4.Data are simple and easy to understand.
understand.
5.Different languages of program can be C, 5.Different forms of data can be images, text
C++, Java, Pascal, Python, etc. documents, audio clips, software programs,
Boolean data, etc.

Table -3:
Difference between fixed point and floating point representation:

S. No. Fixed point representation Floating point representation

1 Less computational power. More computational power.

By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam
S. No. Fixed point representation Floating point representation

Addition of two numbers does not Addition of two number, usually affect the
2
affect the precision. precision.

Rounding and truncation must be a It is not necessary to specify rounding and


3
part of program. truncation.

Overflow error occurs because the


The size of intermediate register is around 80-
4 size of intermediate register is
Bits, so overflow error does not occur.
comparatively small.

Requires less registers and less Requires large registers and more number of
5
number of input-output pins. input-output pins.

EXERCISE-1:
1. Convert the following binary numbers to decimal: 101110; 1110101;
2. Convert the following numbers with the indicated bases to decimal: (12121) 3, (4310)5 ,(50)7
3. Convert the following decimal numbers to binary: 1231,673 and 1998.
4. Convert the following decimal numbers to the bases indicated.
a. 7562 to octal
b. 1938 to hexadecimal
c.175 to binary
EXERCISE-2:
1. What is the radix of the number if the solution to quadratic equation x^2 − 10x + 31 = 0 is x = 5
and x = 8? (gate 2018)
2. Obtain the 9's complement & 10’s of the following eight-digit decimal numbers: 12349876;
00980100; 90009951; and 00000000.
3. Perform the arithmetic operations (+42) + ( - 13) and ( -42) - ( - 13) in binary using signed-2's
complement representation for negative numbers.
4. covert (293.687)10 into equivalent binary form
5. Represent the fixed point notation of unsigned binary number 1100101011 using 5-bit integer
and 5-bit fraction.
6. convert into floating point representation (181.8125)

***
By Mr. Dileep Kumar Koda || Asst. Professor of Computer Science & Engineering. || RGUKT Srikakulam

You might also like