SlideShare a Scribd company logo
1
Unit-2
Data Processing and
Processor Organization
By
Siddhasen R Patil
G H Raisoni College of Engineering & Management, Wagholi, Pune
An Empowered Autonomous Institute Affiliated to Savitribai Phule Pune University
2
Syllabus
•Fixed and Floating Point arithmetic
•Booths multiplication
•Division algorithm: restoring and non-restoring division
•Data representation method:
– IEEE standard single and
– double precision format and examples
•Assembly language programming
•Instruction: elements of machine instruction
3
Syllabus
•Instruction format
•Instruction types
•Addressing modes and formats
•Processor Structure and Function - Processor Organization
•Register Organization.
•Single cycle processor
•Multi-cycle processor
•Instruction-Level Parallelism: Concepts and Challenges
Fixed point Addition, Subtraction, Multiplication
and Division
• Addition:
– Binary Addition
0 0 1 1
+ 0 1 0 1
0 1 1 1 0
– Four bit adder
1100 12
+ 0101 + 05
1 0001 17
Fixed point Addition, Subtraction, Multiplication
and Division
• Subtraction:
– Binary Subtraction
0 1 1 0
- 0 1 0 1
0 0 1 1 1
– Four bit Subtractor
1100 12
- 0101 - 05
0111 07
Fixed point Addition, Subtraction, Multiplication and
Division
• Multiplication:
– Four bit Multiplication
IEEE Standard Single & Double Precision
Format & Examples
• The IEEE-754 floating-point formats is used to store
a real number or floating point.
• There are two formats.
– One is a Single-precision format
• It consumes 32 bits to store all this information such as
Significand, Exponent, and the Sign.
– Second is a Double-precision format
• It consumes 64 bits to store all this information such as
Significand, Exponent, and the Sign.
Single Precision Format
• IEEE-754 Single Precision Format
– 32-bit format
– 23-bits are given to store the significand
– 8-bits are used to store the Exponent
– 1-bit is used to store the Sign
Single Precision Format
• IEEE-754 Single Precision Format
– Example: Given number 15.6875
– Convert 15 to Binary
• 1111
– Convert 0.6875 to Binary
• 0.1011
– Combine 15 and 0.6875
• 1111.1011 => (1111.1011 X 20
)
– Shift the point towards left by 3-bit (i.e. after first 1)
• 1.1111011 X 23
– So the significant = 111101100………0 (total 23-bits),
– Sign bit is 0 (Since the number is positive), and
– Exponent is 130 (i.e. 3+127) => 1000 0010.
– Final Answer: 0 10000010 11110110000……….0
Single Precision Format
• IEEE-754 Single Precision Format
– Example: Given number -2015.4375
– Convert 2015 to Binary
• 11111011111
– Convert 0.4375 to Binary
• 0.0111
– Combine 2015 and 0.4375
• 11111011111.0111 => (11111011111.0111 X 20
)
– Shift the point towards left by 10-bit (i.e. after first 1)
• 1.11110111110111 X 210
– So the significant = 111101111101110……0(total 23-bits),
– Sign bit is 1 (Since the number is negative), and
– Exponent is 137 (i.e. 10+127) => 1000 1001.
– Final Answer: 1 10001001 111101111101110……0
Double Precision Format
• IEEE-754 Double Precision Format
– 64-bit format
– 52-bits are given to store the significand
– 11-bits are used to store the Exponent
– 1-bit is used to store the Sign
Double Precision Format
• IEEE-754 Double Precision Format
– Example: Given number 25.625
– Convert 25 to Binary
• 11001
– Convert 0.625 to Binary
• 0.101
– Combine 25 and 0.625
• 11001.101 => (11001.101 X 20
)
– Shift the point towards left by 4-bit
• 1.1001101 X 24
– So the significant = 1001101000………0 (total 52-bits),
– Sign bit is 0 (Since number is positive), and
– Exponent is 1027 (i.e. 4+1023) => 10000000011.
– Final Answer: 0 100000000011 1001101000……….0
Floating Point Arithmetic
• Floating Numbers Addition
– Step 1: Compare the exponents of two numbers and calculate the
absolute value of difference between the two exponents. Take the
larger exponent as the tentative exponent of the result.
– Step 2: Shift the significand of the number with the smaller exponent,
right through a number of bit positions that is equal to the exponent
difference.
– Step 3 Add the two signed-magnitude significands.
– Step 4 Check SUM for carry out (Cout) from the MSB position during
addition. Shift SUM right by one bit position if a carry out is detected
and increment the tentative exponent by 1.
Floating Point Arithmetic
• Floating Numbers Addition
• Example:
A + B = C
2 + 3 = 5
A = 0 1000 0000 0000 0000 0000 0000 0000 000
B = 0 1000 0000 1000 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0
B 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1
C
0 1+1 = 2 => 22
= 4 0.10 + 0.11 = 1.01 = 1.25
0 4 X 1.25 = 5
Floating Point Arithmetic
• Floating Number Subtraction
– Step 1: Compare the exponents of two numbers and calculate the
absolute value of difference between the two exponents. Take the
larger exponent as the tentative exponent of the result.
– Step 2: Shift the significand of the number with the smaller exponent,
right through a number of bit positions that is equal to the exponent
difference.
– Step 3 Subtract the two signed-magnitude significands. Let the result
of this is Subtraction.
– Step 4 : During subtraction, check SUM for leading zeros. Shift SUM
left until the MSB of the shifted result is a 1. Subtract the leading zero
count from tentative exponent.
Floating Point Arithmetic
• Floating Number Subtraction
• Example:
A - B = C
3 - 3.5 = - 0.5
A = 0 1000 0000 1000 0000 0000 0000 0000 000
B = 1 1000 0000 1100 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1
B 1 1000 0000 = 128 – 127 = 1 1100 0000 0000 0000 0000 000 = 1.11
C
1 1 - 3 = -2 => 2-2
= 0.25 0.11 – 0.111 = 0.001 << 1.0
1 0.25 X 2 = - 0.5
Floating Point Arithmetic
• Floating Numbers Multiplication
– Step 1: Calculate the tentative exponent of the product by
adding the biased exponents of the two numbers,
subtracting the bias i.e. 127.
– Step 2: If the sign of two floating point numbers are the
same, set the sign of product to ‘+’, else set it to ‘-’.
– Step 3: Multiply the two significands. For 24-bit
significand the product is 48-bits wide (including the
leading hidden bit (1)).
Floating Point Arithmetic
• Floating Numbers Multiplication
– Step 4: Normalize the product if MSB of the product is 1,
by shifting the product right by 1 bit position and
incrementing the tentative exponent.
Floating Point Arithmetic
• Floating Numbers Multiplication
• Example:
A X B = C
3 X -3.5 = -10.5
A = 0 1000 0000 1000 0000 0000 0000 0000 000
B = 1 1000 0000 1100 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1
B 1 1000 0000 = 128 – 127 = 1 1100 0000 0000 0000 0000 000 = 1.11
C
1 1+1 = 2 => 3 => 23
= 8 1.1 X 1.11 = 10.101 = 1.0101 = 1.3125
1 8 X 1.3125 = 10.5 => - 10.5
Floating Point Arithmetic
• Floating Numbers Multiplication
• Example:
A X B = C
2 X 3 = 6
A = 0 1000 0000 0000 0000 0000 0000 0000 000
B = 0 1000 0000 1000 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0
B 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1
C
0 1+1 = 2 => 22
= 4 1.0 X 1.1 = 1.10 = 1.5
0 4 X 1.5 = 6
Floating Point Arithmetic
• Floating Numbers Division
– Step 1: Calculate the tentative exponent of the product by
adding the biased exponents of the two numbers,
subtracting the bias i.e. 127.
– Step 2: If the sign of two floating point numbers are the
same, set the sign of product to ‘+’, else set it to ‘-’.
– Step 3: Multiply the two significands. For 24-bit
significand the product is 48-bits wide (including the
leading hidden bit (1)).
Floating Point Arithmetic
• Floating Numbers Division
– Step 4: Normalize the product if MSB of the product is 1,
by shifting the product right by 1 bit position and
incrementing the tentative exponent.
Floating Point Arithmetic
• Floating Numbers Division
• Example:
A / B = C
3 / 2 = 1.5
A = 0 1000 0000 1000 0000 0000 0000 0000 000
B = 0 1000 0000 0000 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1
B 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0
C
0 1-1 = 0 => 20
= 1 1.1 / 1.0 = 1.1
0 1 X 1.1 = 1.5
Floating Point Arithmetic
• Floating Numbers Division
• Example:
A / B = C
3.5 / 2 = 1.5
A = 0 1000 0000 1100 0000 0000 0000 0000 000
B = 0 1000 0000 0000 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 128 – 127 = 1 1100 0000 0000 0000 0000 000 = 1.11
B 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0
C
0 1-1 = 0 => 20
= 1 1.11 / 1.0 = 1.11
0 1 X 1.11 = 1.75
Floating Point Arithmetic
• Floating Numbers Division
• Example:
A / B = C
15 / 4 = 3.75
A = 0 1000 0010 1110 0000 0000 0000 0000 000
B = 0 1000 0001 0000 0000 0000 0000 0000 000
Sign Exponent Mantissa
A 0 1000 0000 = 130 – 127 = 3 1110 0000 0000 0000 0000 000 = 1.111
B 0 1000 0000 = 129 – 127 = 2 0000 0000 0000 0000 0000 000 = 1.0
C
0 3-2 = 1 => 21
= 2 1.111 / 1.0 = 1.111
0 2 X 1.111 = 3.75
Booth’s Multiplication
• The booth algorithm is a multiplication algorithm that allows
us to multiply the two signed binary integers.
• It is also used to speed up the performance of the
multiplication process.
• It is very efficient too.
• Booth algorithm works equally well for both negative and
positive multipliers.
• In Booth algorithm, the Multiplier recoded before
multiplication.
Booth’s Multiplication
• For example:
– If the Multiplier is 0110 (6), then add one zero at right side of
multiplier: 01100
– Then scan the multiplier from right to left 01100
– During scanning of multiplier, we have to follow rule given in below
table.
Bit i Bit i+1 Recoded Value
0 0 0
0 1 -1
1 0 +1
1 1 0
Booth’s Multiplication
• 0 1 1 0 0 +1 0 -1 0
• Now if our multiplicand is 0101 then the multiplication of
0101 (5) and 0110 (6) is :
0 1 0 1
X +1 0 -1 0
0 0 0 0 0 0 0 0 0101 X 0
1 1 1 1 0 1 1 x 0101 X -1
0 0 0 0 0 0 x x 0101 X 0
0 0 1 0 1 x x x 0101 X +1
0 0 0 1 1 1 1 0 30
Booth’s Multiplication
• Flow-Chart of Multiplication using Booth’s algorithm
6 X 5 =30
6 => 0110, 5 => 0101
Count A Q Q-1 Operation
4 0000 0101 0
4 A = A - M
0000
- 1010
1010
1101
0101
0101
0010
0
0
1
Right Shift
3 A = A + M
1101
+ 0110
0011
0001
0010
0010
1001
1
1
0
Right Shift
Booth’s Multiplication
• Flow-Chart of Multiplication using Booth’s algorithm
6 X 5 =30
6 => 0110, 5 => 0101
Count A Q Q-1 Operation
2 A = A - M
0001
- 1010
1011
1101
1001
1001
1100
0
0
1
Right Shift
1 A = A + M
1101
+ 0110
0011
0001
1100
1100
1110
1
1
0
Right Shift
0 11110 => 30
Booth’s Multiplication
• Flow-Chart of Multiplication using Booth’s algorithm
-5 X -4 = 20
-5 => 1011, -4 => 1100
Count A Q Q-1 Operation
4 0000 1100 0
4 0 to 0 means Right Shift
0000 0110 0 Right Shift
3 0 to 0 means Right Shift
0000 0011 0 Right Shift
2 1 to 0 means A = A - M
0000
0101
0101
0010
0011
0011
1001
0
0
1
Right Shift
1 1 to 1 means Shift Right
0001 0100 1 Right Shift
0 00010100 => +20
Division
Division
• Division: 7/3
34
Assembly Language Programming
• An assembly language is a type of programming language that
translates high-level languages into machine language.
• It is a necessary bridge between software programs and their
underlying hardware platforms.
• Assembly language relies on language syntax, labels,
operators, and directives to convert code into usable machine
instruction.
35
Instruction
• Elements of machine instruction
– The typical elements of a machine instruction are
• Operation code
• Source Operand Reference
• Result Operand reference
• Next Instruction Reference
• Example:
– MOV A, B
– JMP 2000H
36
Instruction format
• An assembly language statement consists of four possible
fields:
– Label field
– Mnemonic field
– Operand field
– Comment file.
• The lable and comment fields are always optional.
37
Instruction Types
• Data Transfer Instruction
– MOV A,B
• Arithmetic Instruction
– ADD A,B
• Logical Instruction
– ANL A,B
• Branch Instruction
– JNZ UP
38
Addressing Modes and Formats
39
Processor Structure and Function
40
Processor Organization
41
Register Organization
• General Register Organization is the processor
architecture that stores and manipulates data for
computations.
• The main components of a register organization
include registers, memory, and instructions.
• The registers act as memory within the processor and
are used to process instructions as they are executed.
42
Register Organization
43
Single Cycle and Multi Cycle Processor
• Single cycle processor is a processor in which the instructions
are fetched from the memory, and then executed, and the
results are further stored in a single cycle
• Multicycle implementation, each i.e. fetch, decode, execute
and write back, all are required one clock cycle to execute.
Instruction-Level Parallelism: Concepts and Challenges
• Instruction-Level Parallelism
– Multiple operations can be performed parallelly
44
Sequential execution of operations
Instruction Level Parallelism

More Related Content

PPTX
CA UNIT II.pptx
ssuser9dbd7e
 
PPT
Counit2
Himanshu Dua
 
PPT
09 arithmetic
argiaggi
 
PDF
Computer Architecture: ARITHMETIC FOR COMPUTERS
Gunasundari Selvaraj
 
PPT
09 arithmetic 2
Sher Shah Merkhel
 
PPT
09 arithmetic
Sher Shah Merkhel
 
PPTX
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
 
PPTX
CA Unit ii
AmirthavalliR
 
CA UNIT II.pptx
ssuser9dbd7e
 
Counit2
Himanshu Dua
 
09 arithmetic
argiaggi
 
Computer Architecture: ARITHMETIC FOR COMPUTERS
Gunasundari Selvaraj
 
09 arithmetic 2
Sher Shah Merkhel
 
09 arithmetic
Sher Shah Merkhel
 
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
 
CA Unit ii
AmirthavalliR
 

Similar to Data processing and processor organisation (20)

PPTX
Computer Organization - Arithmetic & Logic Unit.pptx
AnanyaMalik7
 
PDF
Ch_10.pptx.pdf
SujanTimalsina5
 
PPT
arithmetic
SaifullahSiddiqui7
 
PPTX
Computer Architecture
Ravi Kumar
 
PPTX
Computer Architecture
Ravi Kumar
 
PPTX
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
Abhishek Rajpoot
 
PDF
IN 1300 LEC_D02(B15) Basic electronic 2.pdf
EngHarshanaGunasekar1
 
PPT
09 arithmetic
dilip kumar
 
PPT
3810-08.ppt
SrinivasanCSE
 
PPT
Comp Arithmetic Basic.ppt
skatiarrahaman
 
PPT
Arithmetic unit.ppt
MSMinuSanjudharan
 
PPT
3810-08.ppttttttttttttttttptptptpttptppttptp
dynamoe1804
 
PPT
Single Precision Floating Point Format.ppt
AhmedJaha
 
PPT
11Introduction_Floating_Point_Arithmetic.ppt
AhmedJaha
 
PPTX
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
MtikuTadesse
 
PPT
CSe_Cumilla Bangladeshrr_Country CSE CSE213_5.ppt
roy5th6th
 
PPT
Data representation and Arithmetic Algorithms
Mumthas Shaikh
 
PPT
Integer Representation
gavhays
 
PPT
Number system and codes
Abhiraj Bohra
 
Computer Organization - Arithmetic & Logic Unit.pptx
AnanyaMalik7
 
Ch_10.pptx.pdf
SujanTimalsina5
 
arithmetic
SaifullahSiddiqui7
 
Computer Architecture
Ravi Kumar
 
Computer Architecture
Ravi Kumar
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
Abhishek Rajpoot
 
IN 1300 LEC_D02(B15) Basic electronic 2.pdf
EngHarshanaGunasekar1
 
09 arithmetic
dilip kumar
 
3810-08.ppt
SrinivasanCSE
 
Comp Arithmetic Basic.ppt
skatiarrahaman
 
Arithmetic unit.ppt
MSMinuSanjudharan
 
3810-08.ppttttttttttttttttptptptpttptppttptp
dynamoe1804
 
Single Precision Floating Point Format.ppt
AhmedJaha
 
11Introduction_Floating_Point_Arithmetic.ppt
AhmedJaha
 
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
MtikuTadesse
 
CSe_Cumilla Bangladeshrr_Country CSE CSE213_5.ppt
roy5th6th
 
Data representation and Arithmetic Algorithms
Mumthas Shaikh
 
Integer Representation
gavhays
 
Number system and codes
Abhiraj Bohra
 
Ad

Recently uploaded (20)

PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
DOCX
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PDF
JUAL EFIX C5 IMU GNSS GEODETIC PERFECT BASE OR ROVER
Budi Minds
 
Zero Carbon Building Performance standard
BassemOsman1
 
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
Inventory management chapter in automation and robotics.
atisht0104
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Ppt for engineering students application on field effect
lakshmi.ec
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
Software Testing Tools - names and explanation
shruti533256
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
JUAL EFIX C5 IMU GNSS GEODETIC PERFECT BASE OR ROVER
Budi Minds
 
Ad

Data processing and processor organisation

  • 1. 1 Unit-2 Data Processing and Processor Organization By Siddhasen R Patil G H Raisoni College of Engineering & Management, Wagholi, Pune An Empowered Autonomous Institute Affiliated to Savitribai Phule Pune University
  • 2. 2 Syllabus •Fixed and Floating Point arithmetic •Booths multiplication •Division algorithm: restoring and non-restoring division •Data representation method: – IEEE standard single and – double precision format and examples •Assembly language programming •Instruction: elements of machine instruction
  • 3. 3 Syllabus •Instruction format •Instruction types •Addressing modes and formats •Processor Structure and Function - Processor Organization •Register Organization. •Single cycle processor •Multi-cycle processor •Instruction-Level Parallelism: Concepts and Challenges
  • 4. Fixed point Addition, Subtraction, Multiplication and Division • Addition: – Binary Addition 0 0 1 1 + 0 1 0 1 0 1 1 1 0 – Four bit adder 1100 12 + 0101 + 05 1 0001 17
  • 5. Fixed point Addition, Subtraction, Multiplication and Division • Subtraction: – Binary Subtraction 0 1 1 0 - 0 1 0 1 0 0 1 1 1 – Four bit Subtractor 1100 12 - 0101 - 05 0111 07
  • 6. Fixed point Addition, Subtraction, Multiplication and Division • Multiplication: – Four bit Multiplication
  • 7. IEEE Standard Single & Double Precision Format & Examples • The IEEE-754 floating-point formats is used to store a real number or floating point. • There are two formats. – One is a Single-precision format • It consumes 32 bits to store all this information such as Significand, Exponent, and the Sign. – Second is a Double-precision format • It consumes 64 bits to store all this information such as Significand, Exponent, and the Sign.
  • 8. Single Precision Format • IEEE-754 Single Precision Format – 32-bit format – 23-bits are given to store the significand – 8-bits are used to store the Exponent – 1-bit is used to store the Sign
  • 9. Single Precision Format • IEEE-754 Single Precision Format – Example: Given number 15.6875 – Convert 15 to Binary • 1111 – Convert 0.6875 to Binary • 0.1011 – Combine 15 and 0.6875 • 1111.1011 => (1111.1011 X 20 ) – Shift the point towards left by 3-bit (i.e. after first 1) • 1.1111011 X 23 – So the significant = 111101100………0 (total 23-bits), – Sign bit is 0 (Since the number is positive), and – Exponent is 130 (i.e. 3+127) => 1000 0010. – Final Answer: 0 10000010 11110110000……….0
  • 10. Single Precision Format • IEEE-754 Single Precision Format – Example: Given number -2015.4375 – Convert 2015 to Binary • 11111011111 – Convert 0.4375 to Binary • 0.0111 – Combine 2015 and 0.4375 • 11111011111.0111 => (11111011111.0111 X 20 ) – Shift the point towards left by 10-bit (i.e. after first 1) • 1.11110111110111 X 210 – So the significant = 111101111101110……0(total 23-bits), – Sign bit is 1 (Since the number is negative), and – Exponent is 137 (i.e. 10+127) => 1000 1001. – Final Answer: 1 10001001 111101111101110……0
  • 11. Double Precision Format • IEEE-754 Double Precision Format – 64-bit format – 52-bits are given to store the significand – 11-bits are used to store the Exponent – 1-bit is used to store the Sign
  • 12. Double Precision Format • IEEE-754 Double Precision Format – Example: Given number 25.625 – Convert 25 to Binary • 11001 – Convert 0.625 to Binary • 0.101 – Combine 25 and 0.625 • 11001.101 => (11001.101 X 20 ) – Shift the point towards left by 4-bit • 1.1001101 X 24 – So the significant = 1001101000………0 (total 52-bits), – Sign bit is 0 (Since number is positive), and – Exponent is 1027 (i.e. 4+1023) => 10000000011. – Final Answer: 0 100000000011 1001101000……….0
  • 13. Floating Point Arithmetic • Floating Numbers Addition – Step 1: Compare the exponents of two numbers and calculate the absolute value of difference between the two exponents. Take the larger exponent as the tentative exponent of the result. – Step 2: Shift the significand of the number with the smaller exponent, right through a number of bit positions that is equal to the exponent difference. – Step 3 Add the two signed-magnitude significands. – Step 4 Check SUM for carry out (Cout) from the MSB position during addition. Shift SUM right by one bit position if a carry out is detected and increment the tentative exponent by 1.
  • 14. Floating Point Arithmetic • Floating Numbers Addition • Example: A + B = C 2 + 3 = 5 A = 0 1000 0000 0000 0000 0000 0000 0000 000 B = 0 1000 0000 1000 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0 B 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1 C 0 1+1 = 2 => 22 = 4 0.10 + 0.11 = 1.01 = 1.25 0 4 X 1.25 = 5
  • 15. Floating Point Arithmetic • Floating Number Subtraction – Step 1: Compare the exponents of two numbers and calculate the absolute value of difference between the two exponents. Take the larger exponent as the tentative exponent of the result. – Step 2: Shift the significand of the number with the smaller exponent, right through a number of bit positions that is equal to the exponent difference. – Step 3 Subtract the two signed-magnitude significands. Let the result of this is Subtraction. – Step 4 : During subtraction, check SUM for leading zeros. Shift SUM left until the MSB of the shifted result is a 1. Subtract the leading zero count from tentative exponent.
  • 16. Floating Point Arithmetic • Floating Number Subtraction • Example: A - B = C 3 - 3.5 = - 0.5 A = 0 1000 0000 1000 0000 0000 0000 0000 000 B = 1 1000 0000 1100 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1 B 1 1000 0000 = 128 – 127 = 1 1100 0000 0000 0000 0000 000 = 1.11 C 1 1 - 3 = -2 => 2-2 = 0.25 0.11 – 0.111 = 0.001 << 1.0 1 0.25 X 2 = - 0.5
  • 17. Floating Point Arithmetic • Floating Numbers Multiplication – Step 1: Calculate the tentative exponent of the product by adding the biased exponents of the two numbers, subtracting the bias i.e. 127. – Step 2: If the sign of two floating point numbers are the same, set the sign of product to ‘+’, else set it to ‘-’. – Step 3: Multiply the two significands. For 24-bit significand the product is 48-bits wide (including the leading hidden bit (1)).
  • 18. Floating Point Arithmetic • Floating Numbers Multiplication – Step 4: Normalize the product if MSB of the product is 1, by shifting the product right by 1 bit position and incrementing the tentative exponent.
  • 19. Floating Point Arithmetic • Floating Numbers Multiplication • Example: A X B = C 3 X -3.5 = -10.5 A = 0 1000 0000 1000 0000 0000 0000 0000 000 B = 1 1000 0000 1100 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1 B 1 1000 0000 = 128 – 127 = 1 1100 0000 0000 0000 0000 000 = 1.11 C 1 1+1 = 2 => 3 => 23 = 8 1.1 X 1.11 = 10.101 = 1.0101 = 1.3125 1 8 X 1.3125 = 10.5 => - 10.5
  • 20. Floating Point Arithmetic • Floating Numbers Multiplication • Example: A X B = C 2 X 3 = 6 A = 0 1000 0000 0000 0000 0000 0000 0000 000 B = 0 1000 0000 1000 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0 B 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1 C 0 1+1 = 2 => 22 = 4 1.0 X 1.1 = 1.10 = 1.5 0 4 X 1.5 = 6
  • 21. Floating Point Arithmetic • Floating Numbers Division – Step 1: Calculate the tentative exponent of the product by adding the biased exponents of the two numbers, subtracting the bias i.e. 127. – Step 2: If the sign of two floating point numbers are the same, set the sign of product to ‘+’, else set it to ‘-’. – Step 3: Multiply the two significands. For 24-bit significand the product is 48-bits wide (including the leading hidden bit (1)).
  • 22. Floating Point Arithmetic • Floating Numbers Division – Step 4: Normalize the product if MSB of the product is 1, by shifting the product right by 1 bit position and incrementing the tentative exponent.
  • 23. Floating Point Arithmetic • Floating Numbers Division • Example: A / B = C 3 / 2 = 1.5 A = 0 1000 0000 1000 0000 0000 0000 0000 000 B = 0 1000 0000 0000 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 128 – 127 = 1 1000 0000 0000 0000 0000 000 = 1.1 B 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0 C 0 1-1 = 0 => 20 = 1 1.1 / 1.0 = 1.1 0 1 X 1.1 = 1.5
  • 24. Floating Point Arithmetic • Floating Numbers Division • Example: A / B = C 3.5 / 2 = 1.5 A = 0 1000 0000 1100 0000 0000 0000 0000 000 B = 0 1000 0000 0000 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 128 – 127 = 1 1100 0000 0000 0000 0000 000 = 1.11 B 0 1000 0000 = 128 – 127 = 1 0000 0000 0000 0000 0000 000 = 1.0 C 0 1-1 = 0 => 20 = 1 1.11 / 1.0 = 1.11 0 1 X 1.11 = 1.75
  • 25. Floating Point Arithmetic • Floating Numbers Division • Example: A / B = C 15 / 4 = 3.75 A = 0 1000 0010 1110 0000 0000 0000 0000 000 B = 0 1000 0001 0000 0000 0000 0000 0000 000 Sign Exponent Mantissa A 0 1000 0000 = 130 – 127 = 3 1110 0000 0000 0000 0000 000 = 1.111 B 0 1000 0000 = 129 – 127 = 2 0000 0000 0000 0000 0000 000 = 1.0 C 0 3-2 = 1 => 21 = 2 1.111 / 1.0 = 1.111 0 2 X 1.111 = 3.75
  • 26. Booth’s Multiplication • The booth algorithm is a multiplication algorithm that allows us to multiply the two signed binary integers. • It is also used to speed up the performance of the multiplication process. • It is very efficient too. • Booth algorithm works equally well for both negative and positive multipliers. • In Booth algorithm, the Multiplier recoded before multiplication.
  • 27. Booth’s Multiplication • For example: – If the Multiplier is 0110 (6), then add one zero at right side of multiplier: 01100 – Then scan the multiplier from right to left 01100 – During scanning of multiplier, we have to follow rule given in below table. Bit i Bit i+1 Recoded Value 0 0 0 0 1 -1 1 0 +1 1 1 0
  • 28. Booth’s Multiplication • 0 1 1 0 0 +1 0 -1 0 • Now if our multiplicand is 0101 then the multiplication of 0101 (5) and 0110 (6) is : 0 1 0 1 X +1 0 -1 0 0 0 0 0 0 0 0 0 0101 X 0 1 1 1 1 0 1 1 x 0101 X -1 0 0 0 0 0 0 x x 0101 X 0 0 0 1 0 1 x x x 0101 X +1 0 0 0 1 1 1 1 0 30
  • 29. Booth’s Multiplication • Flow-Chart of Multiplication using Booth’s algorithm 6 X 5 =30 6 => 0110, 5 => 0101 Count A Q Q-1 Operation 4 0000 0101 0 4 A = A - M 0000 - 1010 1010 1101 0101 0101 0010 0 0 1 Right Shift 3 A = A + M 1101 + 0110 0011 0001 0010 0010 1001 1 1 0 Right Shift
  • 30. Booth’s Multiplication • Flow-Chart of Multiplication using Booth’s algorithm 6 X 5 =30 6 => 0110, 5 => 0101 Count A Q Q-1 Operation 2 A = A - M 0001 - 1010 1011 1101 1001 1001 1100 0 0 1 Right Shift 1 A = A + M 1101 + 0110 0011 0001 1100 1100 1110 1 1 0 Right Shift 0 11110 => 30
  • 31. Booth’s Multiplication • Flow-Chart of Multiplication using Booth’s algorithm -5 X -4 = 20 -5 => 1011, -4 => 1100 Count A Q Q-1 Operation 4 0000 1100 0 4 0 to 0 means Right Shift 0000 0110 0 Right Shift 3 0 to 0 means Right Shift 0000 0011 0 Right Shift 2 1 to 0 means A = A - M 0000 0101 0101 0010 0011 0011 1001 0 0 1 Right Shift 1 1 to 1 means Shift Right 0001 0100 1 Right Shift 0 00010100 => +20
  • 34. 34 Assembly Language Programming • An assembly language is a type of programming language that translates high-level languages into machine language. • It is a necessary bridge between software programs and their underlying hardware platforms. • Assembly language relies on language syntax, labels, operators, and directives to convert code into usable machine instruction.
  • 35. 35 Instruction • Elements of machine instruction – The typical elements of a machine instruction are • Operation code • Source Operand Reference • Result Operand reference • Next Instruction Reference • Example: – MOV A, B – JMP 2000H
  • 36. 36 Instruction format • An assembly language statement consists of four possible fields: – Label field – Mnemonic field – Operand field – Comment file. • The lable and comment fields are always optional.
  • 37. 37 Instruction Types • Data Transfer Instruction – MOV A,B • Arithmetic Instruction – ADD A,B • Logical Instruction – ANL A,B • Branch Instruction – JNZ UP
  • 41. 41 Register Organization • General Register Organization is the processor architecture that stores and manipulates data for computations. • The main components of a register organization include registers, memory, and instructions. • The registers act as memory within the processor and are used to process instructions as they are executed.
  • 43. 43 Single Cycle and Multi Cycle Processor • Single cycle processor is a processor in which the instructions are fetched from the memory, and then executed, and the results are further stored in a single cycle • Multicycle implementation, each i.e. fetch, decode, execute and write back, all are required one clock cycle to execute.
  • 44. Instruction-Level Parallelism: Concepts and Challenges • Instruction-Level Parallelism – Multiple operations can be performed parallelly 44 Sequential execution of operations Instruction Level Parallelism