SlideShare a Scribd company logo
1 of 39
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 SystemDebarati Das
 
Number system and codes
Number system and codesNumber system and codes
Number system and codesAbhiraj Bohra
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of IntegersSusantha Herath
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number systemAswiniT3
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number systemAswiniT3
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversionsSusantha Herath
 
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 complementsarunachalamr16
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point ConversionRajesh 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
 
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 representationRitu Ranjan Shrivastwa
 

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).pdfTamiratDejene1
 
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 .pdfAsst.prof M.Gokilavani
 
data representation
 data representation data representation
data representationHaroon_007
 
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.pdfshubhangisonawane6
 
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 componentRai 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 componentRai University
 
digital logic circuits, digital component
digital logic circuits, digital componentdigital logic circuits, digital component
digital logic circuits, digital componentRai University
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 
module 1_class_numbers.pptx
module 1_class_numbers.pptxmodule 1_class_numbers.pptx
module 1_class_numbers.pptxssuser2efca7
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptxHamnaKhalid25
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
chapter 2 part 2.pdf
chapter 2 part 2.pdfchapter 2 part 2.pdf
chapter 2 part 2.pdfPraches1
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptxssusera6fdd5
 

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

08 logic simplification
08 logic simplification08 logic simplification
08 logic simplificationarunachalamr16
 
Boolean variables r010
Boolean variables   r010Boolean variables   r010
Boolean variables r010arunachalamr16
 
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 r013arunachalamr16
 
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 theoremsarunachalamr16
 
1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004arunachalamr16
 

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

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 

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)