ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
UNIT II
ARITHMETIC FOR COMPUTERS
ALU
• ALU is responsible for performing arithmetic
operations such as addition, subtraction,
multiplication, division and logical operations
such as AND, OR, NOT
• These are performed based on data types.
1.Fixed point number
2.Floating point number
• Fixed point number – positive and negative
integers
• Floating point number - contains both integer
part and fractional part
• When lower byte addresses are used for the
more significant bytes.
11 22 33 44
MSB LSB
BIG ENDIAN:
B0 B1 B2 B3
44 33 22 11
• When lower byte addresses are used the less
significant bytes.
11 22 33 44
MSB LSB
LITTLE ENDIAN:
B0 B1 B2 B3
11 22 33 44
FIXED POINT REPRESENTATION
• Unsigned – 6 , 10
• Signed integers – -15, -24
• Note: Change the Leftmost value for negative
value representation.
• Example:
6 = 0000 0110
-4 = ?
-14= ?
1’S COMPLEMENT REPRESENTATION
• Change all zeros to 1’s and 1’s to zero
• Example:
Find 1’s complement of (11010100) 2 .
Solution:
1’s complement of 11010100 is 00101011.
2’S COMPLEMENT REPRESENTATION
• Add 1 to 1’s complement.
• Example:
Find 2’s complement of (11010100)2 .
Solution:
1’s complement of 11010100 is 00101011.
……….
ADDITION AND SUBTRACTION
• Rules relating addition and subtraction
4-(-5)=4+5
6+(-5)= 6binary+ (-5binary)
(+A) - (+B) = (+A) + (-B)
(+A) – (-B) = (+A) + (+B)
(-A) – (+B) = (-A) + (-B)
(-A) – (-B) = (-A) + (+B)
BINARY ADDITION
0 + 0 = 0
1 + 0 = 1
0 + 1 = 1
1 + 1 = 1 0
1+1+1=1 1
• Example: Add (6)10 with (7) 10 in binary.
Upper significant bit (carry)
1 1 CARRY
0 1 1 0 = (6) 10
0 1 1 1 = (7) 10
1 1 0 1 = (13) 10
Lower significant
bit(sum)
HALF ADDER
• A combinational circuit which performs two
bits addition is called Half adder.
• The circuit which performs three bits addition
is called Full adder.
HALF ADDER – TRUTH TABLE
K-MAP
• A diagram consisting of rectangular array of
squares each represent a different
combination of the variables of a Boolean
function.
Example:
CONTD..
K-Map for Carry Logic diagram
for carry
Carry =
AB
CONTD..
K-Map for Sum
Input Output
A B
0 0 0
0 1 1
1 0 1
1 1 0
EX-OR:
Logic Diagram:
LOGIC DIAGRAM FOR HALF
ADDER:
A
B
• The combinational circuit which performs
three bits addition is called Full adder.
• It consist of three inputs(A,B,C in (previous
lower significant) )and two outputs.
FULL ADDER
BLOCK SCHEMATIC OF FULL
ADDER
TRUTH TABLE
K-Map for
Cout
K-Map for Sum:
LOGIC DIAGRAM FOR FULL
ADDER:
• Rules of binary subtraction are as follows:
0 - 0 = 0
1 - 0 = 1
1 - 1 = 0
0 - 1 = 1 with a borrow of 1
BINARY SUBTRACTION
• Example:
Perform (11101100)2 – (00110010)2
1 1 1 0 1 1 0 0
- 0 0 1 1 0 0 1 0
1 0 1 1 1 0 1 0
• Rules:
1. Take 1’s complement of B
2. Result = A + (1’s compl. of B)
3. Carry is generated then add it to Result and
mark it as Positive
4. Carry not generated means mark it as
Negative.
BINARY SUBTRACTION FOR 1’S
COMPLEMENT
• Example:
Perform (28)10 – (15)10 using 6 bit 1’s
complement representation.
• Example:
Perform (28)10 – (15)10 using 6 bit 1’s
complement representation.
(28)10 -011100
(15)10 - 001111
011100
110000 (+)
1001100
1 (+)
001101
• Rules:
1. Take 2’s complement of B
2. Result = A + (2’s compl. of B)
3. Carry is generated then add it to Result and
mark it as Positive, ignore the carry.
4. Carry not generated means mark it as
Negative.
BINARY SUBTRACTION FOR 2’S
COMPLEMENT
PARALLEL SUBTRACTOR
• 2’s complement is obtained for A – B then 1’s
complement is implemented with inverters to
get 2’s complement.
OVERFLOW IN INTEGER
• When both operand A and B have +sign,
when the result comes in –sign then this state
is known as Arithmetic Overflow.
• Eg. Find (7)10 + (3)10 assume 6bit, then get
2’s complement for it.
111 Carry
0111
0011 (+)
1010 Result of 2’s complement is 6.
DESIGN OF FAST ADDER
• The sum and carry outputs of any stage
cannot be produced until the input carry
occurs; this leads to a time delay in the
addition process.
0 1 0 1
0 0 1 1 +
1 0 0 0
MULTIPLICATION
Sequential Multiplication of Positive
numbers
• Multiplication process involves generation of
partial products, one for each digit in the
multiplier. These partial products are summed
to get final result.
SEQUENTIAL MULTIPLICATION
OF POSITIVE NUMBERS
CA UNIT II.pptx
SIGN MULTIPLICATION-
BOOTH’S ALGORITHM
• Booth’s algorithm scheme:
(1,1) & (0,0) -> 0
(1,0) -> 1
(0,1) -> -1
• Example :
Recode the multiplier 101100 for booth’s
multiplication.
1 0 1 1 0 0 0 implied zero
-1 1 0 -1 0 0
• Example :
Multiply 01110 (14) and 11011 (-5).
Sol:
01110 = 14 (multiplicand)
11011 = -5 (multiplier)
01-101 (Recode multiplier)
11011 X 01-101 = 1110111010 (-70)
SIGN MULTIPLICATION-BOOTH’S
ALGORITHM
BIT PAIR RECODING OF
MULTIPLIERS
• Bit Pair recoding is used to speed up Booth’s
algorithm process.
1. Multiply given 2’s complement no. using bit-
pair recoding A= 110101 multiplicand (-11)
B= 011011 multiplier (+27)
Ans : 111011010111 (-297)
2. Multiply the following pair of signed 2’s
complement numbers using bit-pair recoding of
the multipliers A= 010111 (+23), B= 101100 (-
20).
Ans : 111000110100 (-460)
DIVISION
• Division process is similar to the decimal
numbers.
Divisor = 110
Dividend = 11011011
Quotient = 1000100
Remainder = 00011
RESTORING DIVISION
ALGORITHM
• Perform the division of following no.
using restoring division algorithm:
Dividend = 1010
Divisor = 0011
Divided = 1000, Divisor = 11
CA UNIT II.pptx
FLOATING POINT
REPRESENTATION
• To accommodate large values floating point
numbers are used.
• It has three fields:
1111101.1110010
1. 1111011110010 x 25
Mantissa
{ Scaling factor
Exponent
Sign
CA UNIT II.pptx
EXCEPTIONS
• Underflow – less than -127
• Overflow – greater than +127
• Divide by Zero
• Inexact – Rounding off
• Invalid – 0/0, input
RULES FOR EXPONENT
• If exponent is +ve, to get equal value at both
side increment to the higher value.
Eg:
1.75 X 102 and 6.8 x 104 then change 1.75 x
102 to 0.0175 x 104
• If the decimal value needs to move forward
position of the floating point means then
exponent value need to increased.
Eg. 1.75 X 102 -> 0.0175 x 104
• If exponent is -ve, to get equal value at both
side decrement to the lower value.
Eg –
Subtract 1.1 x 2-1 and 1.0001 x 2-2 then change
1.0001 x 2-2 to 0.10001 x 2-1
• If the decimal value needs to move backward
position of the floating point means then
exponent value need to decrease in –ve sign.
Eg. 1.0001 x 2-2 -> 0.10001 x 2-1
FLOATING POINT ADDITION
AND SUBTRACTION
Ex: Perform addition and subtraction of single precision
floating point numbers A and B,
A = 44900000H B= 42A00000H
• Step 1: Single precision format
A=
B=
0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 . . . 0 0
sig
n
E’ Mantiss
a
0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 . . . 0 0
• Exponent for A = 1000 1001 = 137
• Actual exponent = 137-127 =10
• Exponent for B = 1000 0101= 133
• Actual exponent= 133-127 = 6
Step 2: shifted mantissa of B (4 bits)
B = 0000 01000…..0
Step 3 : add mantissas,
A = 0010000….0 , B=0000010…0
Result (A+B)= 00100100…0
A+B=
Step 4: subtract mantissas,
A = 0010000….0 , -B = 1111110000….0
Result (A-B)= 00011100…0
A-B=
0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 . . . 0 0
0 1 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 . . . . 0
• Add the numbers (0.75)10 and (-0.275)10 in
binary using the floating point addition algorithm.
Solution:
Step 1:
0.75 x 2= 1.5 -> 1 0.275 x 2 = 0.55 -> 0
0.5 x 2 = 1.0 -> 1 0.55 x 2 = 1.10 -> 1
0.1 x 2 = 0.20 -> 0
0.20 x 2 = 0.40 -> 0
0.40 x 2 = 0.8 -> 0
0.80 x 2 = 1.60 -> 1
0.60 x 2 = 1.20 -> 1
0.20 x 2 = 0.40 -> 0
(0.75)10 = (0.11)2 = 1.1 x 2-1
-(0.275)10 = -(0.01000110)2=> -(1.000110 x 2-2)
=> -(0.1000110 x 2-1)
Step 2:
1.1 x 2-1 + -0.1000110 x 2-1= 0.1111010 x 2-1
Step 3:
Normalize the result
1.111010 x 2-2
Ex 1 : (0.5) 10 and (0.4375) 10
0.5= 0.1= 1.0 x 2-1
0.4375 = 0.0111=1.110 x 2-2
Multiply (1.0 x 2-1 )X (1.110 x 2-2 ) = 1.110000x
2-3
0.001110000 = 0.21875 10
SUBWORD PARALLELISM
• Subword parallelism, multiple subwords are
packed into a word and then process whole
words.
• This is a form of SIMD(Single Instruction
Multiple Data) processing.
• For example if word size is 64bits and
subwords sizes are 8,16 and 32 bits.
GUARD BITS AND
TRUNCATION
• Extra bits added to round off calculations is
called as Guard Bits.
• 3 bit value is allowed after rounding off.
• 3 common methods namely:
1. Chopping
2. Von Neumann rounding
3. Rounding
1. CHOPPING
• Simplest method
Eg.
0.00111 to 0.001
Original number 0. b-1 b-2 b-3 b-4 b-5 b-6
Truncated number 0. b-1 b-2 b-3
2.VON NEUMANN METHOD
• If any bits to be removed are 1, then least
significant bit is retained as 1.
• Eg.
0.011000 -> 0.011
0.011010 -> 0.011
0.010010 -> 0.011
Original number 0. b-1 b-2 b-3 b-4 b-5 b-
6
With b-4 b-5 b-6 =000
0. b-1 b-2 b-3 b-4 b-5 b-6
With b-4 b-5 b-6 !=000
Truncated
number
0. b-1 b-2 b-3 0. b-1 b-2 1
3.ROUNDING
• Best method truncation
• Eg.
0.01101 -> 0.011
0.011100 -> (0.011+0.001) -> 0.100
Original number 0. b-1 b-2 b-3 b-4 b-5 b-
6
With b-4 =0
0. b-1 b-2 b-3 b-4 b-5 b-6
With b-4 =1
Truncated
number
0. b-1 b-2 b-3 0. b-1 b-2 b-3 +0.001
CA UNIT II.pptx

More Related Content

Similar to CA UNIT II.pptx (20)

Data processing and processor organisation
Data processing and processor organisationData processing and processor organisation
Data processing and processor organisation
AnsariArfat
Ìý
Counit2
Counit2Counit2
Counit2
Himanshu Dua
Ìý
Alu1
Alu1Alu1
Alu1
khizarhabibqureshi
Ìý
Computer Architecture: ARITHMETIC FOR COMPUTERS
Computer Architecture: ARITHMETIC FOR COMPUTERSComputer Architecture: ARITHMETIC FOR COMPUTERS
Computer Architecture: ARITHMETIC FOR COMPUTERS
Gunasundari Selvaraj
Ìý
Binary-Arithmeticcccccccccccccccccc.pptx
Binary-Arithmeticcccccccccccccccccc.pptxBinary-Arithmeticcccccccccccccccccc.pptx
Binary-Arithmeticcccccccccccccccccc.pptx
DynamoFFofficial
Ìý
Ch_10.pptx.pdf
Ch_10.pptx.pdfCh_10.pptx.pdf
Ch_10.pptx.pdf
SujanTimalsina5
Ìý
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
Abhishek Rajpoot
Ìý
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
amudhak10
Ìý
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
amudhak10
Ìý
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
skatiarrahaman
Ìý
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
argiaggi
Ìý
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
Ìý
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
Ìý
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
Sher Shah Merkhel
Ìý
09 arithmetic 2
09 arithmetic 209 arithmetic 2
09 arithmetic 2
Sher Shah Merkhel
Ìý
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
Ìý
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
AmirthavalliR
Ìý
Floating_point_representation.pdf
Floating_point_representation.pdfFloating_point_representation.pdf
Floating_point_representation.pdf
RameshK531901
Ìý
De boolean algebra
De boolean algebraDe boolean algebra
De boolean algebra
VinodKataria5
Ìý
L3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxL3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptx
Harish257692
Ìý
Data processing and processor organisation
Data processing and processor organisationData processing and processor organisation
Data processing and processor organisation
AnsariArfat
Ìý
Computer Architecture: ARITHMETIC FOR COMPUTERS
Computer Architecture: ARITHMETIC FOR COMPUTERSComputer Architecture: ARITHMETIC FOR COMPUTERS
Computer Architecture: ARITHMETIC FOR COMPUTERS
Gunasundari Selvaraj
Ìý
Binary-Arithmeticcccccccccccccccccc.pptx
Binary-Arithmeticcccccccccccccccccc.pptxBinary-Arithmeticcccccccccccccccccc.pptx
Binary-Arithmeticcccccccccccccccccc.pptx
DynamoFFofficial
Ìý
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
Abhishek Rajpoot
Ìý
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
amudhak10
Ìý
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
amudhak10
Ìý
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
skatiarrahaman
Ìý
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
argiaggi
Ìý
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
Ìý
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
Ìý
Floating_point_representation.pdf
Floating_point_representation.pdfFloating_point_representation.pdf
Floating_point_representation.pdf
RameshK531901
Ìý
De boolean algebra
De boolean algebraDe boolean algebra
De boolean algebra
VinodKataria5
Ìý
L3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxL3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptx
Harish257692
Ìý

More from ssuser9dbd7e (6)

UHV PPT.doc
UHV PPT.docUHV PPT.doc
UHV PPT.doc
ssuser9dbd7e
Ìý
CA UNIT V..pptx
CA UNIT V..pptxCA UNIT V..pptx
CA UNIT V..pptx
ssuser9dbd7e
Ìý
CA UNIT IV.pptx
CA UNIT IV.pptxCA UNIT IV.pptx
CA UNIT IV.pptx
ssuser9dbd7e
Ìý
CA UNIT III.pptx
CA UNIT III.pptxCA UNIT III.pptx
CA UNIT III.pptx
ssuser9dbd7e
Ìý
CA UNIT I.pptx
CA UNIT I.pptxCA UNIT I.pptx
CA UNIT I.pptx
ssuser9dbd7e
Ìý
CN PPT.docx
CN PPT.docxCN PPT.docx
CN PPT.docx
ssuser9dbd7e
Ìý
CA UNIT V..pptx
CA UNIT V..pptxCA UNIT V..pptx
CA UNIT V..pptx
ssuser9dbd7e
Ìý
CA UNIT IV.pptx
CA UNIT IV.pptxCA UNIT IV.pptx
CA UNIT IV.pptx
ssuser9dbd7e
Ìý
CA UNIT III.pptx
CA UNIT III.pptxCA UNIT III.pptx
CA UNIT III.pptx
ssuser9dbd7e
Ìý
CA UNIT I.pptx
CA UNIT I.pptxCA UNIT I.pptx
CA UNIT I.pptx
ssuser9dbd7e
Ìý

Recently uploaded (20)

G8 mini project for alcohol detection and engine lock system with GPS tracki...
G8 mini project for  alcohol detection and engine lock system with GPS tracki...G8 mini project for  alcohol detection and engine lock system with GPS tracki...
G8 mini project for alcohol detection and engine lock system with GPS tracki...
sahillanjewar294
Ìý
eng funda notes.pdfddddddddddddddddddddddd
eng funda notes.pdfdddddddddddddddddddddddeng funda notes.pdfddddddddddddddddddddddd
eng funda notes.pdfddddddddddddddddddddddd
aayushkumarsinghec22
Ìý
Env and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdfEnv and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdf
MahmudHasan747870
Ìý
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
ssuserd9338b
Ìý
GROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptx
GROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptxGROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptx
GROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptx
meneememoo
Ìý
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
Thane Heins NOBEL PRIZE WINNING ENERGY RESEARCHER
Ìý
Indian Soil Classification System in Geotechnical Engineering
Indian Soil Classification System in Geotechnical EngineeringIndian Soil Classification System in Geotechnical Engineering
Indian Soil Classification System in Geotechnical Engineering
Rajani Vyawahare
Ìý
Cyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptxCyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptx
Harshith A S
Ìý
Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...
dhanashree78
Ìý
Piping-and-pipeline-calculations-manual.pdf
Piping-and-pipeline-calculations-manual.pdfPiping-and-pipeline-calculations-manual.pdf
Piping-and-pipeline-calculations-manual.pdf
OMI0721
Ìý
Taykon-Kalite belgeleri
Taykon-Kalite belgeleriTaykon-Kalite belgeleri
Taykon-Kalite belgeleri
TAYKON
Ìý
CONTRACTOR ALL RISK INSURANCESAR (1).ppt
CONTRACTOR ALL RISK INSURANCESAR (1).pptCONTRACTOR ALL RISK INSURANCESAR (1).ppt
CONTRACTOR ALL RISK INSURANCESAR (1).ppt
suaktonny
Ìý
Frankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkundeFrankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkunde
Lisa Emerson
Ìý
Introduction to Safety, Health & Environment
Introduction to Safety, Health  & EnvironmentIntroduction to Safety, Health  & Environment
Introduction to Safety, Health & Environment
ssuserc606c7
Ìý
Name.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Name.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVName.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Name.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
MerijimArsedelPalmad1
Ìý
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
ASHISHDESAI85
Ìý
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
Ìý
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
Thane Heins NOBEL PRIZE WINNING ENERGY RESEARCHER
Ìý
Power Point Presentation for Electrical Engineering 3-phase.ppt
Power Point Presentation for Electrical Engineering 3-phase.pptPower Point Presentation for Electrical Engineering 3-phase.ppt
Power Point Presentation for Electrical Engineering 3-phase.ppt
Aniket_1415
Ìý
health safety and environment presentation
health safety and environment presentationhealth safety and environment presentation
health safety and environment presentation
ssuserc606c7
Ìý
G8 mini project for alcohol detection and engine lock system with GPS tracki...
G8 mini project for  alcohol detection and engine lock system with GPS tracki...G8 mini project for  alcohol detection and engine lock system with GPS tracki...
G8 mini project for alcohol detection and engine lock system with GPS tracki...
sahillanjewar294
Ìý
eng funda notes.pdfddddddddddddddddddddddd
eng funda notes.pdfdddddddddddddddddddddddeng funda notes.pdfddddddddddddddddddddddd
eng funda notes.pdfddddddddddddddddddddddd
aayushkumarsinghec22
Ìý
Env and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdfEnv and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdf
MahmudHasan747870
Ìý
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
ssuserd9338b
Ìý
GROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptx
GROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptxGROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptx
GROUP-3-GRID-CODE-AND-DISTRIBUTION-CODE.pptx
meneememoo
Ìý
Indian Soil Classification System in Geotechnical Engineering
Indian Soil Classification System in Geotechnical EngineeringIndian Soil Classification System in Geotechnical Engineering
Indian Soil Classification System in Geotechnical Engineering
Rajani Vyawahare
Ìý
Cyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptxCyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptx
Harshith A S
Ìý
Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...
dhanashree78
Ìý
Piping-and-pipeline-calculations-manual.pdf
Piping-and-pipeline-calculations-manual.pdfPiping-and-pipeline-calculations-manual.pdf
Piping-and-pipeline-calculations-manual.pdf
OMI0721
Ìý
Taykon-Kalite belgeleri
Taykon-Kalite belgeleriTaykon-Kalite belgeleri
Taykon-Kalite belgeleri
TAYKON
Ìý
CONTRACTOR ALL RISK INSURANCESAR (1).ppt
CONTRACTOR ALL RISK INSURANCESAR (1).pptCONTRACTOR ALL RISK INSURANCESAR (1).ppt
CONTRACTOR ALL RISK INSURANCESAR (1).ppt
suaktonny
Ìý
Frankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkundeFrankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkunde
Lisa Emerson
Ìý
Introduction to Safety, Health & Environment
Introduction to Safety, Health  & EnvironmentIntroduction to Safety, Health  & Environment
Introduction to Safety, Health & Environment
ssuserc606c7
Ìý
Name.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Name.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVName.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Name.docxVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
MerijimArsedelPalmad1
Ìý
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
ASHISHDESAI85
Ìý
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
Ìý
Power Point Presentation for Electrical Engineering 3-phase.ppt
Power Point Presentation for Electrical Engineering 3-phase.pptPower Point Presentation for Electrical Engineering 3-phase.ppt
Power Point Presentation for Electrical Engineering 3-phase.ppt
Aniket_1415
Ìý
health safety and environment presentation
health safety and environment presentationhealth safety and environment presentation
health safety and environment presentation
ssuserc606c7
Ìý

CA UNIT II.pptx

  • 2. ALU • ALU is responsible for performing arithmetic operations such as addition, subtraction, multiplication, division and logical operations such as AND, OR, NOT • These are performed based on data types. 1.Fixed point number 2.Floating point number
  • 3. • Fixed point number – positive and negative integers • Floating point number - contains both integer part and fractional part
  • 4. • When lower byte addresses are used for the more significant bytes. 11 22 33 44 MSB LSB BIG ENDIAN: B0 B1 B2 B3 44 33 22 11
  • 5. • When lower byte addresses are used the less significant bytes. 11 22 33 44 MSB LSB LITTLE ENDIAN: B0 B1 B2 B3 11 22 33 44
  • 6. FIXED POINT REPRESENTATION • Unsigned – 6 , 10 • Signed integers – -15, -24 • Note: Change the Leftmost value for negative value representation. • Example: 6 = 0000 0110 -4 = ? -14= ?
  • 7. 1’S COMPLEMENT REPRESENTATION • Change all zeros to 1’s and 1’s to zero • Example: Find 1’s complement of (11010100) 2 . Solution: 1’s complement of 11010100 is 00101011.
  • 8. 2’S COMPLEMENT REPRESENTATION • Add 1 to 1’s complement. • Example: Find 2’s complement of (11010100)2 . Solution: 1’s complement of 11010100 is 00101011. ……….
  • 9. ADDITION AND SUBTRACTION • Rules relating addition and subtraction 4-(-5)=4+5 6+(-5)= 6binary+ (-5binary) (+A) - (+B) = (+A) + (-B) (+A) – (-B) = (+A) + (+B) (-A) – (+B) = (-A) + (-B) (-A) – (-B) = (-A) + (+B)
  • 10. BINARY ADDITION 0 + 0 = 0 1 + 0 = 1 0 + 1 = 1 1 + 1 = 1 0 1+1+1=1 1
  • 11. • Example: Add (6)10 with (7) 10 in binary. Upper significant bit (carry) 1 1 CARRY 0 1 1 0 = (6) 10 0 1 1 1 = (7) 10 1 1 0 1 = (13) 10 Lower significant bit(sum)
  • 12. HALF ADDER • A combinational circuit which performs two bits addition is called Half adder. • The circuit which performs three bits addition is called Full adder.
  • 13. HALF ADDER – TRUTH TABLE
  • 14. K-MAP • A diagram consisting of rectangular array of squares each represent a different combination of the variables of a Boolean function. Example:
  • 15. CONTD.. K-Map for Carry Logic diagram for carry Carry = AB
  • 16. CONTD.. K-Map for Sum Input Output A B 0 0 0 0 1 1 1 0 1 1 1 0 EX-OR: Logic Diagram:
  • 17. LOGIC DIAGRAM FOR HALF ADDER: A B
  • 18. • The combinational circuit which performs three bits addition is called Full adder. • It consist of three inputs(A,B,C in (previous lower significant) )and two outputs. FULL ADDER
  • 19. BLOCK SCHEMATIC OF FULL ADDER
  • 22. LOGIC DIAGRAM FOR FULL ADDER:
  • 23. • Rules of binary subtraction are as follows: 0 - 0 = 0 1 - 0 = 1 1 - 1 = 0 0 - 1 = 1 with a borrow of 1 BINARY SUBTRACTION
  • 24. • Example: Perform (11101100)2 – (00110010)2 1 1 1 0 1 1 0 0 - 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 0
  • 25. • Rules: 1. Take 1’s complement of B 2. Result = A + (1’s compl. of B) 3. Carry is generated then add it to Result and mark it as Positive 4. Carry not generated means mark it as Negative. BINARY SUBTRACTION FOR 1’S COMPLEMENT
  • 26. • Example: Perform (28)10 – (15)10 using 6 bit 1’s complement representation.
  • 27. • Example: Perform (28)10 – (15)10 using 6 bit 1’s complement representation. (28)10 -011100 (15)10 - 001111 011100 110000 (+) 1001100 1 (+) 001101
  • 28. • Rules: 1. Take 2’s complement of B 2. Result = A + (2’s compl. of B) 3. Carry is generated then add it to Result and mark it as Positive, ignore the carry. 4. Carry not generated means mark it as Negative. BINARY SUBTRACTION FOR 2’S COMPLEMENT
  • 29. PARALLEL SUBTRACTOR • 2’s complement is obtained for A – B then 1’s complement is implemented with inverters to get 2’s complement.
  • 30. OVERFLOW IN INTEGER • When both operand A and B have +sign, when the result comes in –sign then this state is known as Arithmetic Overflow. • Eg. Find (7)10 + (3)10 assume 6bit, then get 2’s complement for it. 111 Carry 0111 0011 (+) 1010 Result of 2’s complement is 6.
  • 31. DESIGN OF FAST ADDER • The sum and carry outputs of any stage cannot be produced until the input carry occurs; this leads to a time delay in the addition process. 0 1 0 1 0 0 1 1 + 1 0 0 0
  • 32. MULTIPLICATION Sequential Multiplication of Positive numbers • Multiplication process involves generation of partial products, one for each digit in the multiplier. These partial products are summed to get final result.
  • 35. SIGN MULTIPLICATION- BOOTH’S ALGORITHM • Booth’s algorithm scheme: (1,1) & (0,0) -> 0 (1,0) -> 1 (0,1) -> -1
  • 36. • Example : Recode the multiplier 101100 for booth’s multiplication. 1 0 1 1 0 0 0 implied zero -1 1 0 -1 0 0
  • 37. • Example : Multiply 01110 (14) and 11011 (-5). Sol: 01110 = 14 (multiplicand) 11011 = -5 (multiplier) 01-101 (Recode multiplier) 11011 X 01-101 = 1110111010 (-70)
  • 39. BIT PAIR RECODING OF MULTIPLIERS • Bit Pair recoding is used to speed up Booth’s algorithm process.
  • 40. 1. Multiply given 2’s complement no. using bit- pair recoding A= 110101 multiplicand (-11) B= 011011 multiplier (+27) Ans : 111011010111 (-297) 2. Multiply the following pair of signed 2’s complement numbers using bit-pair recoding of the multipliers A= 010111 (+23), B= 101100 (- 20). Ans : 111000110100 (-460)
  • 41. DIVISION • Division process is similar to the decimal numbers. Divisor = 110 Dividend = 11011011 Quotient = 1000100 Remainder = 00011
  • 43. • Perform the division of following no. using restoring division algorithm: Dividend = 1010 Divisor = 0011 Divided = 1000, Divisor = 11
  • 45. FLOATING POINT REPRESENTATION • To accommodate large values floating point numbers are used. • It has three fields: 1111101.1110010 1. 1111011110010 x 25 Mantissa { Scaling factor Exponent Sign
  • 47. EXCEPTIONS • Underflow – less than -127 • Overflow – greater than +127 • Divide by Zero • Inexact – Rounding off • Invalid – 0/0, input
  • 48. RULES FOR EXPONENT • If exponent is +ve, to get equal value at both side increment to the higher value. Eg: 1.75 X 102 and 6.8 x 104 then change 1.75 x 102 to 0.0175 x 104 • If the decimal value needs to move forward position of the floating point means then exponent value need to increased. Eg. 1.75 X 102 -> 0.0175 x 104
  • 49. • If exponent is -ve, to get equal value at both side decrement to the lower value. Eg – Subtract 1.1 x 2-1 and 1.0001 x 2-2 then change 1.0001 x 2-2 to 0.10001 x 2-1 • If the decimal value needs to move backward position of the floating point means then exponent value need to decrease in –ve sign. Eg. 1.0001 x 2-2 -> 0.10001 x 2-1
  • 50. FLOATING POINT ADDITION AND SUBTRACTION Ex: Perform addition and subtraction of single precision floating point numbers A and B, A = 44900000H B= 42A00000H • Step 1: Single precision format A= B= 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 . . . 0 0 sig n E’ Mantiss a 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 . . . 0 0
  • 51. • Exponent for A = 1000 1001 = 137 • Actual exponent = 137-127 =10 • Exponent for B = 1000 0101= 133 • Actual exponent= 133-127 = 6 Step 2: shifted mantissa of B (4 bits) B = 0000 01000…..0
  • 52. Step 3 : add mantissas, A = 0010000….0 , B=0000010…0 Result (A+B)= 00100100…0 A+B= Step 4: subtract mantissas, A = 0010000….0 , -B = 1111110000….0 Result (A-B)= 00011100…0 A-B= 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 . . . 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 . . . . 0
  • 53. • Add the numbers (0.75)10 and (-0.275)10 in binary using the floating point addition algorithm. Solution: Step 1: 0.75 x 2= 1.5 -> 1 0.275 x 2 = 0.55 -> 0 0.5 x 2 = 1.0 -> 1 0.55 x 2 = 1.10 -> 1 0.1 x 2 = 0.20 -> 0 0.20 x 2 = 0.40 -> 0 0.40 x 2 = 0.8 -> 0 0.80 x 2 = 1.60 -> 1 0.60 x 2 = 1.20 -> 1 0.20 x 2 = 0.40 -> 0
  • 54. (0.75)10 = (0.11)2 = 1.1 x 2-1 -(0.275)10 = -(0.01000110)2=> -(1.000110 x 2-2) => -(0.1000110 x 2-1) Step 2: 1.1 x 2-1 + -0.1000110 x 2-1= 0.1111010 x 2-1 Step 3: Normalize the result 1.111010 x 2-2
  • 55. Ex 1 : (0.5) 10 and (0.4375) 10 0.5= 0.1= 1.0 x 2-1 0.4375 = 0.0111=1.110 x 2-2 Multiply (1.0 x 2-1 )X (1.110 x 2-2 ) = 1.110000x 2-3 0.001110000 = 0.21875 10
  • 56. SUBWORD PARALLELISM • Subword parallelism, multiple subwords are packed into a word and then process whole words. • This is a form of SIMD(Single Instruction Multiple Data) processing. • For example if word size is 64bits and subwords sizes are 8,16 and 32 bits.
  • 57. GUARD BITS AND TRUNCATION • Extra bits added to round off calculations is called as Guard Bits. • 3 bit value is allowed after rounding off. • 3 common methods namely: 1. Chopping 2. Von Neumann rounding 3. Rounding
  • 58. 1. CHOPPING • Simplest method Eg. 0.00111 to 0.001 Original number 0. b-1 b-2 b-3 b-4 b-5 b-6 Truncated number 0. b-1 b-2 b-3
  • 59. 2.VON NEUMANN METHOD • If any bits to be removed are 1, then least significant bit is retained as 1. • Eg. 0.011000 -> 0.011 0.011010 -> 0.011 0.010010 -> 0.011 Original number 0. b-1 b-2 b-3 b-4 b-5 b- 6 With b-4 b-5 b-6 =000 0. b-1 b-2 b-3 b-4 b-5 b-6 With b-4 b-5 b-6 !=000 Truncated number 0. b-1 b-2 b-3 0. b-1 b-2 1
  • 60. 3.ROUNDING • Best method truncation • Eg. 0.01101 -> 0.011 0.011100 -> (0.011+0.001) -> 0.100 Original number 0. b-1 b-2 b-3 b-4 b-5 b- 6 With b-4 =0 0. b-1 b-2 b-3 b-4 b-5 b-6 With b-4 =1 Truncated number 0. b-1 b-2 b-3 0. b-1 b-2 b-3 +0.001

Editor's Notes

  • #7: 0 – 0000 1 – 0001 2 – 0010 3 – 0011 4 – 0100 5 – 0101 6 – 0110 7 – 0111 8 – 1000 9 – 1001 10 – 1010 11 – 1011 12 – 1100 13 – 1101 14 – 1110 15 – 1111