SlideShare a Scribd company logo
Digital Arithmetic:
Operations and
Circuits
Objectives
• Addition, subtraction, multiplication, and division
of two binary numbers.
• Addition and subtraction of hexadecimal numbers
• Difference between binary addition and OR addition.
• Comparison among three different systems for
representing signed numbers.
• Manipulate signed binary numbers using the 2’s –
complement system.
• BCD adder circuit and addition process.
• Basic operation of an arithmetic/logic unit
Binary Addition
• The addition of two binary numbers is performed in
exactly the same manner as the addition of decimal
numbers.
• Least-significant-digit first.
• “Carry” of 1 into the next position may be needed.
• 4 different cases for binary addition
position
next
into
1
of
carry
1
11
1
1
1
position
next
into
1
of
carry
0
10
1
1
1
0
1
0
0
0













•The operations of subtraction, multiplication, and division
actually use only addition as their basic operation
Example
1001(9)
110(6)
(3)
011

)
24
(
11000
1111(15)
1001(9)

Review Question
• Add the following pairs of binary numbers.
– 10110+00111
– 10001111+00000001
Representing signed numbers
Considerations: representing both positive
and negative numbers; efficient computation.
Sign-magnitude system
Sign-magnitude system: represents + and –
numbers, but we need to design special circuits
to add positive and negative numbers.
ex: 5 + (-5) = 0
use 8 bit signed-binary numbers and add using
full-adder circuits :
0 0 0 0 0 1 0 1 ( 5)
+ 1 0 0 0 0 1 0 1 (-5)
_____________________
1 0 0 0 1 0 1 0 (-10)
1’s complement system
– Change each 0 to 1, and each 1 to 0.
– Example
(45) 1 0 1 1 0 1 original binary number
     
(-45) 0 1 0 0 1 0 complement each bit
1 0 1 1 0 1 (45)
+ 0 1 0 0 1 0 (-45)
____________________
1 1 1 1 1 1
Add one to this result, get zero.
2’s complement of a binary number:
– Take the 1’s complement of the number
– Add 1 to the least-significant-bit position
number
binary
original
of
complement
s
2'
010011
complement
s
2'
form
to
1
add
1
complement
s
1'
form
bit to
each
complement
010010
45
of
equivalent
binary
101101

Representing signed numbers
using 2’s complement form
• If the number is positive, the magnitude is
represented in its positional-weighted binary form,
and a sign bit of 0 is placed in front of the MSB.
• If the number is negative, the magnitude is
represented in its 2’s complement form, and a sign
bit of 1 is placed in front of the MSB.
example
Example
• Represent each of the following signed decimal
numbers as a signed binary number in the 2’s-
complement system. Use a total of five bits including
the sign bit.
(a) +13 (b) –9 (c) +3 (d) –2 (e) -8
Negation
• Negation is the operation of converting a postive
number to its negative equivalent or a negative
number to its positive equivalent.
• We negate a signed binary number by 2’s-complementing
it.
• Example
– Each of the following numbers is a signed binary
number in the 2’s-complement system. Determine the
decimal value in each case:
(a)01100 (b) 11010 (c)10001
Special case in 2’s-complement
representation
• Whenever a signed number has a 1 in the sign bit and
all 0s for the magnitude bits, its decimal equivalent
is –2N, where N is the number of bits in the
magnitude.
• The complete range of values that can be represented
in the 2’s-complement system having N magnitude bits
is –2N to +(2N - 1).
• What is the range of unsigned decimal values that can
be represented in a byte?
• What is the range of signed decimal values that can
be represented in a byte?
Review Questions
• Represent each of the following values as an eight-bit
signed number in the 2’s-complement system
(a)+13 (b) –7 (c)-128
• Each of the following is a signed binary number in the 2’s-
complement system. Determine the decimal equivalent for
each.
(a)100011 (b)1000000 (c)01111110
• What range of signed decimal values can be represented in
12 bits(including the sign bit)?
• How many bits are required to represent decimal values
ranging from –50 to +50?
• What is the largest negative decimal value that can be
represented by a two-byte number?
• Perform the 2’s-complement operation on each of the
following.
(a)10000 (b)10000000 ©1000
• Define the negation operation
Addition in the 2’s-complement
system
• Case I: Two Postive Numbers.
+9  0 1001 (augend)
+4  0 0100 (addend)
0 1101 (sum = +13)
Sign bits
Addition, cont.
• Case II: Positive Number and Smaller Negative Number
+9  0 1001 (augend)
-4  1 1100 (addend)
1 0 0101
Sign bits
This carry is disregarded; the result
is 01001(sum=+5)
Addition, cont.
• Case III: Positive Number and Larger Negative Number
-9  10111
+4  00100
11011 (sum = -5)
Negative sign bit
Addition, cont.
• Case IV: two negative Numbers
-9  10111
-4  11100
1 10011
Sign bit
This carry is disregarded; the result is
10011(sum =-13)
Addition, cont.
• Case V: Equal and Opposite Numbers
-9  10111
+9  01001
0 100000
Disregard; the result is
00000(sum = +0)
Review Questions
• Assume the 2’s complement system for both questions
– True or False: Whenever the sum of two signed
binary numbers has a sign bit of 1, the magnitude
of the sum is in 2’s complement form.
– Add the following pairs of signed numbers. Express
the sum as a signed binary number and as a decimal
number
• (a) 100111+111011
• (b) 100111+011001
Subtraction in the 2’s-
complement System
• The procedure for subtracting one binary number(the
subtrahend) from another binary number(the minuend)
– Negate the subtrahend. This will change the
subtrahend to its equivalent value of opposite
sign.
– Add this to the minuend. The result of this
addition will represent the difference between the
subtrahend and the minuend.
Arithmetic Overflow
• When two positive or two negative numbers are being
added, an overflow could occur if there is a carry
happening to the sign-bit position.
• Overflow can occur when the minuend and subtrahend
have different signs.
Review Questions
• Perform the subtraction on the following pairs of
signed numbers using the 2’s-complement system.
Express the results as signed binary numbers and as
decimal values.
(a)01001-11010 (b)10010-10011
• How can arithmetic overflow be detected when signed
numbers are being added? Subtracted?
Multiplication of Binary
numbers
• The same manner as the multiplication of decimal
numbers.
1001  multiplicand = 910
1011  multiplier=1110
1001
1001
0000
1001
1100011 final product = 9910
Multiplication in the 2’s-
Complement System
• If the two numbers to be multiplied are positive,
they are already in true binary form and are
multiplied as they are.
• When the two numbers are negative, they will be in
2’s-complement form. Each is converted to a positive
number, and then the two numbers are multiplied. The
product is kept as a positive number and is given a
sign bit of 0.
• When one of the number is positive and the other is
negative, the negative number is first converted to a
positive magnitude by taking its 2’s complement. The
product will be in true-magnitude form, should be
changed to 2’s complement form and given a sign bit
of 1.
Review Question
• Multiply the unsigned numbers 0111 and 1110
Binary Division
• The same as for decimal numbers---long division
0
11
0011
011
1001
0010
11
0
100
100
100
1
.
0010
0
.
1010
100
The division of signed numbers is handled
in the same way as multiplication.
1.7 Binary Codes
• BCD Code
– A number with k decimal
digits will require 4k bits
in BCD.
– Decimal 396 is represented
in BCD with 12bits as 0011
1001 0110, with each group
of 4 bits representing one
decimal digit.
– A decimal number in BCD is
the same as its equivalent
binary number only when the
number is between 0 and 9.
– The binary combinations 1010
through 1111 are not used
and have no meaning in BCD.
Binary Code
• Example:
– Consider decimal 185 and its corresponding value
in BCD and binary:
• BCD addition
Binary Code
• Example:
– Consider the addition of 184 + 576 = 760 in BCD:
• Decimal Arithmetic: (+375) + (-240) = +135
Hint 6: using 10’s of BCD
Binary Codes
• Other Decimal Codes
Binary Codes)
• Gray Code
– The advantage is that only
bit in the code group
changes in going from one
number to the next.
• Error detection.
• Representation of analog
data.
• Low power design.
000 001
010
100
110 111
101
011
1-1 and onto!!
Binary Codes
• American Standard Code for Information
Interchange (ASCII) Character Code
Binary Codes
• ASCII Character Code
ASCII Character Codes
• American Standard Code for Information Interchange
(Refer to Table 1.7)
• A popular code used to represent information sent as
character-based data.
• It uses 7-bits to represent:
– 94 Graphic printing characters.
– 34 Non-printing characters.
• Some non-printing characters are used for text format
(e.g. BS = Backspace, CR = carriage return).
• Other non-printing characters are used for record
marking and flow control (e.g. STX and ETX start and
end text areas).
ASCII Properties
• ASCII has some interesting properties:
– Digits 0 to 9 span Hexadecimal values 3016 to 3916
– Upper case A-Z span 4116 to 5A16
– Lower case a-z span 6116 to 7A16
• Lower to upper case translation (and vice versa)
occurs by flipping bit 6.
Binary Codes
• Error-Detecting Code
– To detect errors in data communication and
processing, an eighth bit is sometimes added to
the ASCII character to indicate its parity.
– A parity bit is an extra bit included with a
message to make the total number of 1's either
even or odd.
• Example:
– Consider the following two characters and their
even and odd parity:
Binary Codes
• Error-Detecting Code
– Redundancy (e.g. extra information), in the form of
extra bits, can be incorporated into binary code
words to detect and correct errors.
– A simple form of redundancy is parity, an extra bit
appended onto the code word to make the number of
1’s odd or even. Parity can detect all single-bit
errors and some multiple-bit errors.
– A code word has even parity if the number of 1’s in
the code word is even.
– A code word has odd parity if the number of 1’s in
the code word is odd.
– Example:
10001001
10001001
1
0 (odd parity)
Message B:
Message A: (even parity)

More Related Content

What's hot

Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
Debarati Das
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
Abhiraj Bohra
 
Data Representation
Data RepresentationData Representation
Data Representation
Dilum Bandara
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
Susantha Herath
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
Dr. Anita Goel
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
AswiniT3
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
AswiniT3
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversions
Susantha Herath
 
Representation of Real Numbers
Representation of Real NumbersRepresentation of Real Numbers
Representation of Real Numbers
Forrester High School
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
Arti Parab Academics
 
1’s and 2’s complements
1’s and 2’s complements1’s and 2’s complements
1’s and 2’s complements
arunachalamr16
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point Conversion
Rajesh Sharma
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
Data Representation
Data RepresentationData Representation
Data Representation
Education Front
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
pyingkodi maran
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
Sanjay Saluth
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationQuick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representation
Ritu Ranjan Shrivastwa
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
dilip kumar
 

What's hot (20)

Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
 
09 Arithmetic
09  Arithmetic09  Arithmetic
09 Arithmetic
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversions
 
Representation of Real Numbers
Representation of Real NumbersRepresentation of Real Numbers
Representation of Real Numbers
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 
1’s and 2’s complements
1’s and 2’s complements1’s and 2’s complements
1’s and 2’s complements
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point Conversion
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationQuick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representation
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 

Similar to Digital fundamendals r001a

Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
TamiratDejene1
 
Alu1
Alu1Alu1
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
GnanaDeepikaMeduri
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
Asst.prof M.Gokilavani
 
data representation
 data representation data representation
data representation
Haroon_007
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
nivedita murugan
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
NabeelaNousheen
 
Module 2_Data representations.pdf
Module 2_Data representations.pdfModule 2_Data representations.pdf
Module 2_Data representations.pdf
Aditya kishore saxena
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
shubhangisonawane6
 
Bca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital componentBca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital component
Rai University
 
B.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital componentB.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital component
Rai University
 
digital logic circuits, digital component
digital logic circuits, digital componentdigital logic circuits, digital component
digital logic circuits, digital component
Rai University
 
Data Representation
Data RepresentationData Representation
Data Representation
Education Front
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
PeriyanayagiS
 
module 1_class_numbers.pptx
module 1_class_numbers.pptxmodule 1_class_numbers.pptx
module 1_class_numbers.pptx
ssuser2efca7
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
HamnaKhalid25
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
RavikumarR77
 
chapter 2 part 2.pdf
chapter 2 part 2.pdfchapter 2 part 2.pdf
chapter 2 part 2.pdf
Praches1
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptx
ssusera6fdd5
 

Similar to Digital fundamendals r001a (20)

Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
Alu1
Alu1Alu1
Alu1
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
 
data representation
 data representation data representation
data representation
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Module 2_Data representations.pdf
Module 2_Data representations.pdfModule 2_Data representations.pdf
Module 2_Data representations.pdf
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
Bca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital componentBca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital component
 
B.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital componentB.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital component
 
digital logic circuits, digital component
digital logic circuits, digital componentdigital logic circuits, digital component
digital logic circuits, digital component
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
module 1_class_numbers.pptx
module 1_class_numbers.pptxmodule 1_class_numbers.pptx
module 1_class_numbers.pptx
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
chapter 2 part 2.pdf
chapter 2 part 2.pdfchapter 2 part 2.pdf
chapter 2 part 2.pdf
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptx
 

More from arunachalamr16

Pipeline r014
Pipeline   r014Pipeline   r014
Pipeline r014
arunachalamr16
 
Registers r011
Registers   r011Registers   r011
Registers r011
arunachalamr16
 
08 logic simplification
08 logic simplification08 logic simplification
08 logic simplification
arunachalamr16
 
Boolean algebra r009
Boolean algebra   r009Boolean algebra   r009
Boolean algebra r009
arunachalamr16
 
Boolean variables r010
Boolean variables   r010Boolean variables   r010
Boolean variables r010
arunachalamr16
 
Central processing unit and stack organization r013
Central processing unit and stack organization   r013Central processing unit and stack organization   r013
Central processing unit and stack organization r013
arunachalamr16
 
Counters r012
Counters  r012Counters  r012
Counters r012
arunachalamr16
 
Flipflop r012
Flipflop   r012Flipflop   r012
Flipflop r012
arunachalamr16
 
Universal gates r008
Universal gates   r008Universal gates   r008
Universal gates r008
arunachalamr16
 
Logic gates r007
Logic gates   r007Logic gates   r007
Logic gates r007
arunachalamr16
 
18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems
18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems
18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems
arunachalamr16
 
1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004
arunachalamr16
 
Pill camera
Pill cameraPill camera
Pill camera
arunachalamr16
 

More from arunachalamr16 (13)

Pipeline r014
Pipeline   r014Pipeline   r014
Pipeline r014
 
Registers r011
Registers   r011Registers   r011
Registers r011
 
08 logic simplification
08 logic simplification08 logic simplification
08 logic simplification
 
Boolean algebra r009
Boolean algebra   r009Boolean algebra   r009
Boolean algebra r009
 
Boolean variables r010
Boolean variables   r010Boolean variables   r010
Boolean variables r010
 
Central processing unit and stack organization r013
Central processing unit and stack organization   r013Central processing unit and stack organization   r013
Central processing unit and stack organization r013
 
Counters r012
Counters  r012Counters  r012
Counters r012
 
Flipflop r012
Flipflop   r012Flipflop   r012
Flipflop r012
 
Universal gates r008
Universal gates   r008Universal gates   r008
Universal gates r008
 
Logic gates r007
Logic gates   r007Logic gates   r007
Logic gates r007
 
18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems
18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems
18 pc09 1.2_ digital logic gates _ boolean algebra_basic theorems
 
1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004
 
Pill camera
Pill cameraPill camera
Pill camera
 

Recently uploaded

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 

Recently uploaded (20)

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 

Digital fundamendals r001a

  • 2. Objectives • Addition, subtraction, multiplication, and division of two binary numbers. • Addition and subtraction of hexadecimal numbers • Difference between binary addition and OR addition. • Comparison among three different systems for representing signed numbers. • Manipulate signed binary numbers using the 2’s – complement system. • BCD adder circuit and addition process. • Basic operation of an arithmetic/logic unit
  • 3. Binary Addition • The addition of two binary numbers is performed in exactly the same manner as the addition of decimal numbers. • Least-significant-digit first. • “Carry” of 1 into the next position may be needed. • 4 different cases for binary addition position next into 1 of carry 1 11 1 1 1 position next into 1 of carry 0 10 1 1 1 0 1 0 0 0              •The operations of subtraction, multiplication, and division actually use only addition as their basic operation
  • 5. Review Question • Add the following pairs of binary numbers. – 10110+00111 – 10001111+00000001
  • 6. Representing signed numbers Considerations: representing both positive and negative numbers; efficient computation. Sign-magnitude system
  • 7. Sign-magnitude system: represents + and – numbers, but we need to design special circuits to add positive and negative numbers. ex: 5 + (-5) = 0 use 8 bit signed-binary numbers and add using full-adder circuits : 0 0 0 0 0 1 0 1 ( 5) + 1 0 0 0 0 1 0 1 (-5) _____________________ 1 0 0 0 1 0 1 0 (-10)
  • 8. 1’s complement system – Change each 0 to 1, and each 1 to 0. – Example (45) 1 0 1 1 0 1 original binary number       (-45) 0 1 0 0 1 0 complement each bit 1 0 1 1 0 1 (45) + 0 1 0 0 1 0 (-45) ____________________ 1 1 1 1 1 1 Add one to this result, get zero.
  • 9. 2’s complement of a binary number: – Take the 1’s complement of the number – Add 1 to the least-significant-bit position number binary original of complement s 2' 010011 complement s 2' form to 1 add 1 complement s 1' form bit to each complement 010010 45 of equivalent binary 101101 
  • 10. Representing signed numbers using 2’s complement form • If the number is positive, the magnitude is represented in its positional-weighted binary form, and a sign bit of 0 is placed in front of the MSB. • If the number is negative, the magnitude is represented in its 2’s complement form, and a sign bit of 1 is placed in front of the MSB.
  • 12. Example • Represent each of the following signed decimal numbers as a signed binary number in the 2’s- complement system. Use a total of five bits including the sign bit. (a) +13 (b) –9 (c) +3 (d) –2 (e) -8
  • 13. Negation • Negation is the operation of converting a postive number to its negative equivalent or a negative number to its positive equivalent. • We negate a signed binary number by 2’s-complementing it. • Example – Each of the following numbers is a signed binary number in the 2’s-complement system. Determine the decimal value in each case: (a)01100 (b) 11010 (c)10001
  • 14. Special case in 2’s-complement representation • Whenever a signed number has a 1 in the sign bit and all 0s for the magnitude bits, its decimal equivalent is –2N, where N is the number of bits in the magnitude. • The complete range of values that can be represented in the 2’s-complement system having N magnitude bits is –2N to +(2N - 1). • What is the range of unsigned decimal values that can be represented in a byte? • What is the range of signed decimal values that can be represented in a byte?
  • 15. Review Questions • Represent each of the following values as an eight-bit signed number in the 2’s-complement system (a)+13 (b) –7 (c)-128 • Each of the following is a signed binary number in the 2’s- complement system. Determine the decimal equivalent for each. (a)100011 (b)1000000 (c)01111110 • What range of signed decimal values can be represented in 12 bits(including the sign bit)? • How many bits are required to represent decimal values ranging from –50 to +50? • What is the largest negative decimal value that can be represented by a two-byte number? • Perform the 2’s-complement operation on each of the following. (a)10000 (b)10000000 ©1000 • Define the negation operation
  • 16. Addition in the 2’s-complement system • Case I: Two Postive Numbers. +9  0 1001 (augend) +4  0 0100 (addend) 0 1101 (sum = +13) Sign bits
  • 17. Addition, cont. • Case II: Positive Number and Smaller Negative Number +9  0 1001 (augend) -4  1 1100 (addend) 1 0 0101 Sign bits This carry is disregarded; the result is 01001(sum=+5)
  • 18. Addition, cont. • Case III: Positive Number and Larger Negative Number -9  10111 +4  00100 11011 (sum = -5) Negative sign bit
  • 19. Addition, cont. • Case IV: two negative Numbers -9  10111 -4  11100 1 10011 Sign bit This carry is disregarded; the result is 10011(sum =-13)
  • 20. Addition, cont. • Case V: Equal and Opposite Numbers -9  10111 +9  01001 0 100000 Disregard; the result is 00000(sum = +0)
  • 21. Review Questions • Assume the 2’s complement system for both questions – True or False: Whenever the sum of two signed binary numbers has a sign bit of 1, the magnitude of the sum is in 2’s complement form. – Add the following pairs of signed numbers. Express the sum as a signed binary number and as a decimal number • (a) 100111+111011 • (b) 100111+011001
  • 22. Subtraction in the 2’s- complement System • The procedure for subtracting one binary number(the subtrahend) from another binary number(the minuend) – Negate the subtrahend. This will change the subtrahend to its equivalent value of opposite sign. – Add this to the minuend. The result of this addition will represent the difference between the subtrahend and the minuend.
  • 23. Arithmetic Overflow • When two positive or two negative numbers are being added, an overflow could occur if there is a carry happening to the sign-bit position. • Overflow can occur when the minuend and subtrahend have different signs.
  • 24. Review Questions • Perform the subtraction on the following pairs of signed numbers using the 2’s-complement system. Express the results as signed binary numbers and as decimal values. (a)01001-11010 (b)10010-10011 • How can arithmetic overflow be detected when signed numbers are being added? Subtracted?
  • 25. Multiplication of Binary numbers • The same manner as the multiplication of decimal numbers. 1001  multiplicand = 910 1011  multiplier=1110 1001 1001 0000 1001 1100011 final product = 9910
  • 26. Multiplication in the 2’s- Complement System • If the two numbers to be multiplied are positive, they are already in true binary form and are multiplied as they are. • When the two numbers are negative, they will be in 2’s-complement form. Each is converted to a positive number, and then the two numbers are multiplied. The product is kept as a positive number and is given a sign bit of 0. • When one of the number is positive and the other is negative, the negative number is first converted to a positive magnitude by taking its 2’s complement. The product will be in true-magnitude form, should be changed to 2’s complement form and given a sign bit of 1.
  • 27. Review Question • Multiply the unsigned numbers 0111 and 1110
  • 28. Binary Division • The same as for decimal numbers---long division 0 11 0011 011 1001 0010 11 0 100 100 100 1 . 0010 0 . 1010 100 The division of signed numbers is handled in the same way as multiplication.
  • 29. 1.7 Binary Codes • BCD Code – A number with k decimal digits will require 4k bits in BCD. – Decimal 396 is represented in BCD with 12bits as 0011 1001 0110, with each group of 4 bits representing one decimal digit. – A decimal number in BCD is the same as its equivalent binary number only when the number is between 0 and 9. – The binary combinations 1010 through 1111 are not used and have no meaning in BCD.
  • 30. Binary Code • Example: – Consider decimal 185 and its corresponding value in BCD and binary: • BCD addition
  • 31. Binary Code • Example: – Consider the addition of 184 + 576 = 760 in BCD: • Decimal Arithmetic: (+375) + (-240) = +135 Hint 6: using 10’s of BCD
  • 32. Binary Codes • Other Decimal Codes
  • 33. Binary Codes) • Gray Code – The advantage is that only bit in the code group changes in going from one number to the next. • Error detection. • Representation of analog data. • Low power design. 000 001 010 100 110 111 101 011 1-1 and onto!!
  • 34. Binary Codes • American Standard Code for Information Interchange (ASCII) Character Code
  • 35. Binary Codes • ASCII Character Code
  • 36. ASCII Character Codes • American Standard Code for Information Interchange (Refer to Table 1.7) • A popular code used to represent information sent as character-based data. • It uses 7-bits to represent: – 94 Graphic printing characters. – 34 Non-printing characters. • Some non-printing characters are used for text format (e.g. BS = Backspace, CR = carriage return). • Other non-printing characters are used for record marking and flow control (e.g. STX and ETX start and end text areas).
  • 37. ASCII Properties • ASCII has some interesting properties: – Digits 0 to 9 span Hexadecimal values 3016 to 3916 – Upper case A-Z span 4116 to 5A16 – Lower case a-z span 6116 to 7A16 • Lower to upper case translation (and vice versa) occurs by flipping bit 6.
  • 38. Binary Codes • Error-Detecting Code – To detect errors in data communication and processing, an eighth bit is sometimes added to the ASCII character to indicate its parity. – A parity bit is an extra bit included with a message to make the total number of 1's either even or odd. • Example: – Consider the following two characters and their even and odd parity:
  • 39. Binary Codes • Error-Detecting Code – Redundancy (e.g. extra information), in the form of extra bits, can be incorporated into binary code words to detect and correct errors. – A simple form of redundancy is parity, an extra bit appended onto the code word to make the number of 1’s odd or even. Parity can detect all single-bit errors and some multiple-bit errors. – A code word has even parity if the number of 1’s in the code word is even. – A code word has odd parity if the number of 1’s in the code word is odd. – Example: 10001001 10001001 1 0 (odd parity) Message B: Message A: (even parity)