Professional Documents
Culture Documents
COA Unit 1
COA Unit 1
COA Unit 1
AND
ARCHITECTURE
(KCS 302)
Topic: UNIT 1
Jyoti Guglani
Department of Computer Science & Engineering
IMS ENGINEERING COLLEGE
Dr. A.P.J. Abdul Kalam Technical University,
Lucknow
NUMBER SYSTEM
Similarly
5239.6518= 5*103 +2*102 +3*101 +9*100 +6*10-1+5*10-2+1*10-3+8*10-4
Each digit in a number system can be determined as Integer part and
fractional part.
• In Non-positional number system, a digit of a number does not
indicate any significance in position and weight, zero is absent in
these type of systems and these are roman numerical System.
NUMBER SYSTEM
•Binary number system:- This System has 2 base value, digits are (0,1) and each
digit represents a position or a weight value so it is called positional weight
number system.
For example :- 111.111
1*22 +1*21 +1*20 +1*2-1+1*2-2+1*2-3
• Octal Number System:- This System has 8 base value, digits between (0-7) and
each digit represents a position or a weight value so it is called positional weight
number system.
For example :- 456.345
4*82 +5*81 +6*80 +3*8-1+4*8-2+5*8-3
NUMBER SYSTEM
•Hexadecimal number system:- This System has 16 base value, digits between
(0-15) and each digit represents a position or a weight value so it is called
positional weight number system.
For example :- 879.ABC
8*162 +7*161 +9*160 +A*16-1+B*16-2+C*16-3
CONVERSIONS:-
•Any Base to Decimal
•Decimal to Any Base
•Octal to Binary
•Octal to Hexadecimal
•Binary to Octal
•Binary to Hexadecimal
•Hexadecimal to Binary
•Hexadecimal to Octal
NUMBER SYSTEM
•
NUMBER SYSTEM
2 15 1 LSB
2 7 1
2 3 1
2 1 1 MSB
NUMBER SYSTEM
8 214 6 LSB
8 26 2
8 3 3
MSB
• (.640625)10 ( )8 =
.640625 * 8=5.125 5
.125 * 8=1.0 1 =( 326.51)8
NUMBER SYSTEM
• (54)10 ( ) 4
Octal to Binary
• (634)8 ( )2
823 ,we can use 3 digit for conversion as binary from decimal.
6 110 , 3011 , 4100 =(110 011 100)2
• (546)8 ( )2
NUMBER SYSTEM
Hexadecimal to Binary
• (3FD)16 ( )2
1624 ,we can use 4 digit for conversion as binary from decimal.
3 0011 , F1111 , D1101 =(0011 1111 1101)2
• (28F)16 ( )2
NUMBER SYSTEM
Binary to Octal
• (100010011011)2 ( )8
823 ,we can use 3 digit for conversion as decimal from binary & start from LSB
to MSB.
01010011011= 001 010 011 011 =(1233)8
1 2 3 3
• (0011111100)2 ( )8
NUMBER SYSTEM
Binary to Hexadecimal
• (100010011011)2 ( )16
1624 ,we can use 4 digit for conversion as decimal from binary & start from LSB
to MSB.
100010011011= 1000 1001 1011 =(89B)16
8 9 B
• (10011111100)2 ( )16
NUMBER SYSTEM
Octal to Hexadecimal
• (615)8 ( )16
1. First convert in to binary
2. After converting in binary, convert it in to Hexadecimal.
(615)8 ( )2 ( )16 =(615)8 (110 001 101)2
(110 001 101)2 = (0001 1000 1101)
1 8 D
• (567)8 ( )16
NUMBER SYSTEM
Hexadecimal to Octal
• (25B)16 ( )8
1. First convert in to binary
2. After converting in binary, convert it in to Octal.
(615)16 ( )2 ( )8 =(615)16(0110 0001 0101)2
(0110 0001 0101)2 = (011 000 010 101)=(3025)8
3 0 2 5
• (567B)16 ( )8
Assignment
Convert the Following:-
Q1:- (1111.10)2 ( )10
Q2:- (564.66)8 ( )10
Q3:- (54.50)10 ( )2
Q4:- (67AB.AA)16( )8
Q5:- (321.30)5 ( )10
Q6:- (675)10( )4
Arithmetic Binary System
To find 1’s compliment of binary number convert all 1’s into 0’s. And all 0’s into
1’s.
To find the 2’s compliment of binary number find find the 1’s complement and
add 1 to right most bit.
or start from right most bit write number as it is till first 1 arrives and than
take 1’s compliment of remaining bits.
Subtraction using 1’s compliment method
• Write first number as it is. Take 1’s complement of second number.
Add the numbers to get resultant.
• If carry is genetated, add the carry to right most bit and get the final
result.
• If NO carry is generated , than take 1’s compliment of resultant and
put negative sign in front of it to get the final result.
Subtraction using 2’s compliment method
• Write first number as it is. Take 2’s complement of second number.
Add the numbers to get resultant.
• If carry is genetated, discard the carry to get the final result.
• If NO carry is generated , than take 2’s compliment of resultant and
put negative sign in front of it to get the final result.
Examples
Q.1: Perform the following substation using 1’s compliment method:
1100 – 1010
Sol.: 1100 1100
- 1010 0101
1 0001
Since carry is generated add carry to right most bit of resultant
0001
+ 1
Answer: 0010
Examples
Q.2: Perform the following substation using 1’s compliment method:
1010 – 1100
Sol.: 1010 1010
- 1100 0011
1101
Since NO carry is generated take 1’s compliment of resultant with
negative sign
Answer is - 0010
Examples
Q.3: Perform the following substation using 2’s compliment method:
1100 – 1010
Sol.: 1100 1100
- 1010 0110
10010
Since carry is generated discard the carry to get the result
Answer is 0010
Examples
Q.4: Perform the following substation using 2’s compliment method:
1010 – 1100
Sol.: 1010 1010
- 1100 0100
1110
Since NO carry is generated take 2’s compliment of resultant with
negative sign
Answer is - 0010
Arithmetic Binary System
Sign Magnitude:- In Signed numbers 1 bit use for sign bit(MSB) and other bits
represent magnitude. Sign bit further divided in two forms:-
1. Positive sign number :- it is represented by 0
2. Negative sign Number:- it is represented by 1
For Example:- +(8) = 0 1000 Magnitude -(8)= 1 1000 Magnitude
Sign Bit Sign Bit
Arithmetic Binary System
Ques:- Represent (+48) and (-13) in 8 bit Signed 1’s compliment representation.
a) +(48)= 0 0110000 similar as Signed Magnitude Representation.
a b c
Multiple devices connect to the bus, and a signal transmitted by any
one device is available for reception by all other devices attached to
the bus. so that create garble(destroyed),so for that solution we use
arbitration.
A bus is a subsystem that is used to connect computer components
and transfer data between them. For example, an internal bus
connects computer internals to the motherboard.
A bus may be parallel or serial. Parallel buses transmit data across
multiple wires. Serial buses transmit data in bit-serial format.
Data is transmitted from one part of a computer to another,
connecting all major internal components to the CPU and memory,
by the means of Buses.
Types of Buses
System bus:- a bus consists of multiple communication pathways, or lines. Each line is
capable of transmitting signals representing binary 1 and binary 0. An 8-bit unit of data can be
transmitted over eight bus lines. A bus that connects major computer components (processor,
memory, I/O) is called a system bus
•Data Bus: It carries data among the memory unit, the I/O devices, and the processor. the
number of lines in data bus is known as width of data bus for ex :- 16,32,64 that means 16 bits
data transfer at a time. each line carries one bit at a time parallel.
• Address Bus: It carries the address of data (not the actual data) between memory and
processor. The address lines are used to designate the source or destination of the data on
the data bus.
For example, on an 8-bit address bus, address 01111111 and below might reference
locations in a memory module (module 0) with 128 words of memory,
For example:- 23 = 8 i.e. 3 address line is required to select 8 location,
2x = n
In general where x number of address lines (address bit) and n is number of location
Types of Buses
• Control Bus: It carries control commands from
the CPU (and status signals from other devices)
in order to control and coordinate all the
activities within the computer.
BUS INTERCONNECTION STRUCTURE
The operation of the bus is as follows. If one module wishes to send data to
another, it must do two things:
(1) obtain the use of the bus, and (2) transfer data via the bus.
If one module wishes to request data from another module, it must (1) obtain the
use of the bus, and (2) transfer a request to the other module over the
appropriate control and address lines. It must then wait for that second module
to send the data.
Bus & Memory Transfer
•.
VON NEUMANN ARCHITECHURE
• Von Neumann architecture was first published by John von
Neumann in 1945. Von Neumann architecture is based on the
stored-program computer concept, where instruction data and
program data are stored in the same memory.
VON NEUMANN ARCHITECHURE
MAIN MEMORY
Program
Data
or
A=10;
instructio
B=5
n
C=A+B
COMPUTER ORGANISATION AND ARCHITECTURE
• The components from which computers are built,
i.e., computer organization.
• In contrast, computer architecture is the science of
integrating those components to achieve a level of
functionality and performance.
• It is as if computer organization examines the
lumber, bricks, nails, and other building material
• While computer architecture looks at the design of
the house.
Computer organization
• It is concerned with the way hardware
components operate and the way they are
connected to form a computer system.
• The various components are assumed to be in
place and the task is to investigate the
organizational structure to verify that the
computer parts operated as intended.
• Computer Organization refers to the level of
abstraction above the digital logic level, but below
the operating system level.
Computer Design
• Computer design is concerned with the hardware
design of the computer.
Once the computer specifications are formulated, it is
the task of the designer to develop hardware for the
system.
Computer design is concerned with the determination
of what hardware should be used and how the parts
should be connected.
This aspect of computer hardware is sometimes
referred to as computer implementation.
Computer Architecture
Organization describes how it does it. Architecture describes what the computer does.
Computer Organization deals with structural relationship. Computer Architecture deals with functional behavior of
computer system.
Computer Organization is frequently called as micro Computer Architecture is also called as instruction set
architecture. architecture.
Computer Organization comprises physical units such as Computer Architecture consists logical functions such as
adders, decoders etc. instruction sets, registers, data types and addressing
modes
Computer Organization handles the segments of the Architecture coordinates between the hardware and
network in a system. software of the system.
FUNCTIONAL UNITS OF COMPUTER
FUNCTIONAL UNITS OF
COMPUTER
• Input Unit
• Output Unit
• ALU
• Control Unit
• Memory Unit
Input Unit: Computer accepts encoded information
through input unit. The standard input device is a keyboard.
Whenever a key is pressed, keyboard controller sends the
code to CPU/Memory. Converts the external world data to
a binary format, which can be understood by CPU.
Advantages –
•Simplicity and Scalability.
•The user can add more devices anywhere along the chain, up to a certain
maximum value.
Disadvantages –
•The value of priority assigned to a device is depends on the position of master
bus.
•Propagation delay is arises in this method.
•If one device fails then entire system will stop working.
Methods of Bus Arbitration
• Polling or Rotating Priority method –
In this method, the devices are assigned unique priorities and complete to access the bus, but the
priorities are dynamically changed to give every device an opportunity to access the bus.
Methods of Bus Arbitration
Polling or Rotating Priority method
Advantages –
•This method does not favor any particular device and processor.
•The method is also quite simple.
•If one device fails then entire system will not stop working.
Disadvantages –
•Adding bus masters is difficult as increases the number of address lines
of the circuit.
Methods of Bus Arbitration
• Fixed priority or Independent Request method –
In this method, the bus control passes from one device to another only through the centralized bus arbiter.
Methods of Bus Arbitration
Advantages –
•This method generates fast response.
Disadvantages –
•Hardware cost is high as large no. of control lines are required.
Interconnection between Processor and Memory
Registers
Registers are fast stand-alone storage locations that hold data
temporarily. Multiple registers are needed to facilitate the
operation of the CPU. Some of these registers are
•Instruction Executed.
Types of Addressing Modes
The different ways in which the location of the operand is
specified in an instruction are referred to as addressing
modes
• Immediate Addressing
• Direct Addressing
• Indirect Addressing
• Register Addressing
• Register Indirect Addressing
• Relative Addressing
• Indexed Addressing
Immediate Addressing
• Operand is given explicitly in the instruction
• Operand = Value
• e.g. ADD 5
– Add 5 to contents of accumulator
– 5 is operand
• No memory reference to fetch data
• Fast
• Limited range
Instruction
opcode
operand
Direct Addressing
• Address field contains address of operand
• Effective address (EA) = address field (A)
• e.g. ADD A
– Add contents of cell A to accumulator
– Look in memory at address A for operand
• Single memory reference to access data
• No additional calculations to work out effective address
• Limited address space
Direct Addressing Diagram
Instruction
Opcode Address A
Memory
Operand
Indirect Addressing (1)
• Memory cell pointed to by address field contains the address
of (pointer to) the operand
• EA = [A]
– Look in A, find address (A) and look there for operand
• e.g. ADD (A)
– Add contents of cell pointed to by contents of A to accumulator
Indirect Addressing (2)
• Large address space
• 2n where n = word length
• May be nested, multilevel, cascaded
– e.g. EA = (((A)))
• Draw the diagram yourself
• Multiple memory accesses to find operand
• Hence slower
Indirect Addressing Diagram
Instruction
Opcode Address A
Memory
Pointer to operand
Operand
Register Addressing (1)
• Operand is held in register named in address field
• EA = R
• Limited number of registers
• Very small address field needed
– Shorter instructions
– Faster instruction fetch
Register Addressing (2)
• No memory access
Operand
Register Indirect Addressing
• C.f. indirect addressing
• EA = [R]
• Operand is in memory cell pointed to by contents of register R
• Large address space (2n)
• One fewer memory access than indirect addressing
Register Indirect Addressing Diagram
Instruction
Opcode Register Address R
Memory
Registers
Registers
Shift operations:-
1.Logical Shift left
2.Logical shift right
3.Arithmetic shift left
4.Arithmetic shift right
5.Rotate left
6.Rotate right
7.Rotate left with carry
8.Rotate right with carry
Program Control Instructions
When CPU process the data from consecutive
memory locations so each time one instruction is
fetched from memory and the program counter is
incremented.
It has two types of instructions:-
1)Unconditional
2)Conditional
Unconditional:- An unconditional branch instruction
means control proceeds the next instruction in
sequence.
Conditional:- A conditional branch instruction means
control proceeds the next instruction when the
condition met .
Program Control Instructions
• JUMP
• SKIP
• BRANCH
• CALL
• RETURN
• COMPARE
General Purpose Register Organization
General Purpose Register Organization
Generally CPU has seven general registers. Register
organization show how registers are selected and how
data flow between register and ALU. A decoder is used
to select a particular register. The output of each
register is connected to the multiplexers to form the
two buses A and B. The selection lines in each
multiplexer select the input data for the particular bus.
The A and B buses form the two inputs of an ALU. The
operation select lines decide the micro operation to be
performed by ALU. The result of the micro operation is
available at the output bus. The output bus connected
to the inputs of all registers, thus by selecting a
destination register it is possible to store the result in it.
• STACK ORGANIZATION
• Stack Operations
Register Stack
A stack can be organized as a collection of finite number of registers that are used to store
temporary information during the execution of a program.
The stack pointer (SP) is a register that holds the address of top of element of the stack.
Memory Stack