UNIT-1 DATA REPRESENTATION
UNIT-1 DATA REPRESENTATION
UNIT - I
Data representation: Data types – Complements- fixed point and floating point representation other binary
codes. Register Transfer and Micro operations: Register transfer language- Register transfer- Bus and
Memory transfers – Arithmetic, logic and shift micro operations.
UNIT - II
Central processing unit: General register and stack organizations- instruction formats - Addressing modes-
Data transfer and manipulation - program control- RISC - Pipelining - Arithmetic and instruction- RISC
pipeline - Vector processing and Array processors.
UNIT - III
Microprocessor Architecture and its Operations - 8085 MPU - 8085 Instruction Set and Classifications.
Programming in 8085: Code conversion - BCD to Binary and Binary to BCD conversions - ASCII to BCD
and BCD to ASCII conversions - Binary to ASCII and ASCII to Binary conversions.
UNIT - IV
Programming in 8085:BCD Arithmetic - BCD addition and Subtraction – Multi byte Addition and
Subtraction - Multiplication and Division. Interrupts: The 8085 Interrupt – 8085 Vectored Interrupts –
UNIT - V
Direct Memory Access (DMA)and 8257 DMA controller - 8255A Programmable Peripheral Interface.
Basic features of Advanced Microprocessors - Pentium - I3 , I5 and I7.
TEXT BOOKS:
1. M.M. Mano, “Computer System architecture”. Pearson, Third Edition, 2007
2. R. S. Gaonkar- "Microprocessor Architecture- Programming and Applications with 8085"- 5th Edition-
Penram- 2009.
3. Tripti Dodiya & Zakiya Malek, “Computer Organization and Advanced Microprocessors”, Cengage
Learning, 2012.
REFERENCE BOOKS:
1. Mathur- “Introduction to Microprocessor”- 3rd Edition- Tata McGraw-Hill-1993.
2. P. K. Ghosh and P. R. Sridhar- “0000 to 8085: Introduction to Microprocessors for Engineers and
Scientists”- 2nd Edition- PHI- 1995.
3. NagoorKani- “Microprocessor (8085) and its Applications”- 2nd Edition- RBA Publications- 2006.
4. V. Vijayendran- “Fundamentals of Microprocessors – 8085”- S. Viswanathan Pvt. Ltd.- 2008.
WEB REFERENCES:
NPTEL & MOOC courses titled Computer organization
https://nptel.ac.in/courses/106105163/
https://nptel.ac.in/courses/106103068/
Page 1
COMPUTER ORGANIZATION I BSC CS I UNIT
COMPUTER ORGANIZATION
UNIT-1
Introduction
(1) Data representation
Data refer to the symbol that represents people, events, things and ideas
Data representation refers to the form in which data is stored, processed and
transmitted.
Digitization is the process of converting information to digital data
The 0’s and 1’s are used to represent digital data and referred to as binary digit
Representing Number
Number data consists of number that can be used in arithmetic operation
Representing text
Character data is composed of letter and numbers that are not used in calculations
Ex: name, address
Character data is referred to as text
Page 2
COMPUTER ORGANIZATION I BSC CS I UNIT
Byte 8bits
Kilobit 1024 or 210 bits
Kilo byte 1025 or 210 bytes
Mega bit 1048,576 or 220 bits
Mega byte 1048,576 or 22 bytes
Giga bit 230 bits
Giga byte 230bytes
Tera byte 240bytes
Peta byte 250bytes
Exa byte 260bytes
bit is used to represent internet connection speeds and movie download speed
bytes is used to represent file size and stored capacities
(2)Data types
Binary information in digital computers is stored in memory or processor registers
Register contain either data or control information
ta types in the register of digital computer are classified into
Dat
1. Number used in arithmetic computation
2. Letter used in data processing
3. Other discrete symbols used for specific purposes
mber systems
(I)Num
Decimal number system
Binary number system
Octal number system
Hexadecimal number system
Page 3
COMPUTER ORGANIZATION II BSC CS I UNIT
11x161+6x160
176+6
(182)10
(3) Complements
Complements are used to simplify the subtraction
2 types of complements
Complements
Page 5
COMPUTER ORGANIZATION II BSC CS I UNIT
Ex :( 1011)2
1’s complement of 1011 is 0100
Add 1 1
2’s complements of 1011 is (0101)2
Page 6
COMPUTER ORGANIZATION I BSC CS I UNIT
Page 7
COMPUTER ORGANIZATION I BSC CS I UNIT
Binary BCD
Ex: Ex:
0’s & 1’s 8421, 2421,5211
Page 8
COMPUTER ORGANIZATION I BSC CS I UNIT
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0101
7 0111
8 1000
9 1001
10 0001 0000
Page 9
COMPUTER ORGANIZATION I BSC CS I UNIT
Page 10
COMPUTER ORGANIZATION I BSC CS I UNIT
19
1 9
3 3
4 12
0100 1100 Ans
0100
0100
4
-3
1
0100 Ans
(ii) Gray code
It is unweighted code and it is called as reflected or cycle code
This code is not suitable for arithmetic operation
Decimal Binary code Gray code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
Page 11
COMPUTER ORGANIZATION I BSC CS I UNIT
9 1001 1101
10 1010 1111
11 1100 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
1 1 1 1 gray code
Gray to Binary converter
1 1 1 1
xor xor xor
1 0 1 0
The MSB of the binary code will be same a first bit of given number
The second bit of the code will be XOR of first of binary and second of gray and
soon.
Page 12
COMPUTER ORGANIZATION I BSC CS I UNIT
Ex: 7
9-7= 2
In 2421 decimal 7 is represent 1101
Page 13
COMPUTER ORGANIZATION I BSC CS I UNIT
9
-7
2
By interchanging 1’s and 0’s we get 0010 which represent 2 in 2421 code
(IV)Sequential code
In sequential codes, each succeeding code is one binary number greater than is preceding
code
Ex: 8421 and Excess-3 code
(V)Error detection and correcting codes
Any external noise introduced into a physical communication medium changes bit value
from 0 to 1 or 1 to 0
An error detection code can be used to detect error during transmission
A parity bit is an extra bit included with a message to make the total number of 1’s either
odd or even.
In the receiving end, all the incoming bits are applied to a parity check
Page 14
COMPUTER ORGANIZATION I BSC CS I UNIT
(7)Integer arithmetic
(i)Binary addition
1010 0+0=0
1101 0+1=1
1+0=1
10111 1 + 1 =10
(ii)Binary subtraction
1101 0- 0=0
0100 0-1= 1
1001 1-0= 1
1-1= 0
(iii)Binary multiplication
1101x1101 1101x1101
1101
0000
11 01
110 1
10101001 Ans 10101001
Page 15
COMPUTER ORGANIZATION I BSC CS I UNIT
(8) Complements
1. r’s complement subtraction
2.(r-1)’s complements subtraction
(I) (i) 1’s complement subtraction
1010 1111
(Subtrahend) (Minuend)
1’s complement of 1111 0000
Add 1010 1010
1010
No carry so complement again and put the -ve sign
1010 - 0101 ans
1111 1010
1’s complement of 1010 0101
Add 1111 1111
10100
Add the carry 0100
1
0101 ans
(ii) 9’s complement subtraction
22-32 99
32
9’s complement of 32 67
Add 22 22
89
No carry so again complement and put the –ve sign
99
89
-10 ans
Page 16
COMPUTER ORGANIZATION IBSC CS I UNIT
32-22 99
22
9’s complement of 22 77
Add 32 32
109
Add the carry 09
1
10 ans
(II)(i)2’s complement subtraction
1010 1111
1’s complement of 111 1 0000
Add 1 1
0001
Add 1010 1010
1011
No carry so again complement and put the -ve sign
Complement of 1011 0100
Add 1 1
0101
- 0101 ans
1111 1010
1’s complement of 1010 0101
Add 1 1
0110
Add 1111 1111
10101
Ignore the carry 0101 ans
Page 17
COMPUTER ORGANIZATION IBSC CS I UNIT
(ii)10’s complement subtraction
22-32 99
32
9’s complement of 32 67
Add 1 1
68
Add 22 22
89
No carry so again complement put -ve sign
99
89
-10 Ans
32-22
99
22
9’s complement of 22 77
Add 1 1
78
Add 32 32
110
Ignore the carry 10 ans
(9) Register transfer and Micro operations
(i) Registers
A register is a group of binary cells
A register with n cells can store n bits
Ex:
1 0 1 1 0 1 0 1
7 6 5 4 3 2 1 0
8 bit register
Page 18
COMPUTER ORGANIZATION IBSC CS I UNIT
Page 19
COMPUTER ORGANIZATION IBSC CS I UNIT
15 0 15 8 7 0
R2 PCH PCL
Page 20
COMPUTER ORGANIZATION IBSC CS I UNIT
Types of bus
Bus types
Internal External
Page 21
COMPUTER ORGANIZATION IBSC CS I UNIT
s1
s0
D2 C2 B2 A2 D1 C1 B1A1 D0 C0 B0 A0
3210 3 2 1 0 3 2 1 0 3 2 1 0
Page 22
COMPUTER ORGANIZATION IBSC CS I UNIT
S1 S2 Register selected
0 0 A
0 1 B
1 0 C
1 1 D
Page 23
COMPUTER ORGANIZATION IBSC CS I UNIT
A0
B0
C0
D0
S1 0
S0 2x4 1
Bus line with 32st
E decode
enable input of the decode is 0, all of it 4 outputs are 0, the bus lines are in high
impedance state
When the enable input is active, one of the 3 state buffers will be active, depending on the
binary value in the select input of the decoder
(11)Memory transfer
A memory is a collection of storage cells with associated circuits to transfer information in
and out of storage
Memory read
Memory write
2 operations are used
(i)Memory read
Transfer the information from memory to outside world is called memory read
Page 24
COMPUTER ORGANIZATION IBSC CS I UNIT
DR M [AR]
DR data register
AR address register
M [AR] memory location of AR
The content of memory location specified by the address of AR to the data registers
DR
(ii) Memory write
To store the information into the memory is called write operation
M [AR] R1
Then content of register R1 is stored into memory location whose address is specified
in the address register AR
(12) Micro-operations
Register transfer micro operations
Arithmetic micro operations
Logical micro operations
Shift micro operations
(I) Register transfer microoperations
Transfer the binary information from one register to another
Register transfer micro operation does not change the information ,moves from source
register to destination register
(II) Arithmetic micro operations
It includes Add, sub, increment and decrement operations
(i) Add micro operation
R3 R1+R2
R1 content and register R2 content are added and the sum is transferred to
register R3
Page 25
COMPUTER ORGANIZATION IBSC CS I UNIT
Page 26
COMPUTER ORGANIZATION IBSC CS I UNIT
1010 A before
1100 B
1110 A after
(ii) Selection complement
Complement bits in A where the corresponding 1’s in B (XOR)
1110 A before
1010 B
0100 A after
(iii) Selecting clear
Clear to 0 in A only where there are corresponding 1’s in B
1110 A before
1010 B
0100 A after
(iv) Mask
The bits of A are cleared only where there are corresponding 0’s in B (AND)
1110 1011 Before A
1111 0000 B
1110 0000 After A
(v) Insert operation
Insert a new value into group of bits (first mask and then OR operating)
A ------------- 01101010 (Replace left most 4 bit 1001)
0110 1010 A Before
0000 1111 B mask
0000 1010 A after
Insert the new value
Page 27
COMPUTER ORGANIZATION IBSC CS I UNIT
0000 1010 A
1001 0000 B (insert)
1001 1010 A after
(vi)Clear
Two numbers are equal means result is zero (X-OR)
1010 A
1010 B
0000
(IV) Shift microoperations
Shift micro operations are used for serial transfer of information
3 types of shift micro operations
Logical shift
Circuit shift
Arithmetic shift
(I) Logical shift
(i) Right logical shift
Shift 1 bit to the right of the content of R
R shr R
0 1 1 0 1 1 0 1
8 bit register
0 0 1 1 0 1 1 0
Page 28
COMPUTER ORGANIZATION IBSC CS I UNIT
1 1 0 1 1 0 1 0
Circulation the bits of the register around the two end without Loss of information
0 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0
0 1 1 0 1 1 0 1
1 1 0 1 1 0 1 0
(III)Arithmetic shift
An arithmetic shift is a micro operation shift a signed binary number to the left or right
An arithmetic shift left multiplies a signed number by 2
Shift right divides the number by 2
Left most bit is a sign bit
Page 29
COMPUTER ORGANIZATION IBSC CS I UNIT
If the sign reversal occurs, if means then is an over flow. if the sign bit remain the same
LSB 0
1 0 1 0 0 1 1 1
0 1 0 0 1 1 1 0
The arithmetic shift right leaves the sign bit unchanged and shift the number include
the sign bit to the right
1 0 1 0 0 1 1 1
1 1 0 1 0 0 1 1
******************************************************************
Page 30