SlideShare a Scribd company logo
1 of 31
Download to read offline
F.Y.B.SC.(C.SC.)
PRINCIPLES OF DIGITAL
ELECTRONICS- NUMBER SYSTEMS
-Prof. Vandana Pagar
Assistant professor
MIT ACSC.
TOPICS TO BE COVERED
➢Number Systems:
1. Decimal Number System
2. Binary Number System
3. Hexadecimal Number System
➢Representation of Numbers of
Different Radix
➢Conversion of Numbers from one Radix
to Another Radix
WHAT IS NUMBER SYSTEM ?
•system for representing number of certain type.
• Example:
–There are several systems for representing the
–counting numbers.
– These include the usual base “10” or decimal system : 1,2,3
,…..10,11,12,..99,100,…
,…..10,11,12,..99,100,…
System Base Symbols
Used by
humans?
Used in
computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa-
decimal
16 0, 1, … 9,
A, B, … F
No No
COMMON NUMBER SYSTEM
Decimal Binary
Hexa-
decimal
0 0 0
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
COUNTING
DECIMAL NUMBER SYSTEM
In Decimal number system, an
ordered set of ten symbols
0,1,2,3,4,5,6,7,8 and 9 are used to
specify the quantities.
Symbols used are known as digits.
Radix or base of decimal number
system is 10
DECIMAL NUMBER SYSTEM
BINARY NUMBER SYSTEM
 The binary number system is a code that uses
only two basic symbols i.e. 0 and 1
 Generally in digital electronics 0 represents low
level and 1 represents high level.
 Symbols in binary number system are called as
bits.
BINARY NUMBER SYSTEM
HEXADECIMAL NUMBER SYSTEM
 Hexadecimal Number
System has a base of
sixteen.
 It is extensively used in
Microprocessor work
 It uses 16 distinct symbols
0 to 9 and Ato F
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,
F
BINARY TO DECIMAL CONVERSION:
(i) Get the decimal number
(ii) Write the weights in exponential form
(iii) Place 1 and a 0 at appropriate positions i.e. place a
1 if weight is taken during the sum and 0 otherwise.
iv.) Add all the products
HEXADECIMAL TO DECIMAL
CONVERSION:
 In a hexadecimal number system each digit
position corresponds to power of 16. The weight
of the digit position in a hexadecimal number is
as follows:
▪ In hexadecimal number system each digit
position corresponds to appropriate power of 16.
The weights of the digit positions in hexadecimal
number are as follows:
………163 162 161 160 . 16-1 16-2 16-3
▪ To convert Hexadecimal number to decimal
number, multiply each hexadecimal digit by its
weight and add the resulting product.
DECIMAL TO ANY BASE
 Steps:
1. Convert integer part
( Successive Division Method )
2. Convert fractional part
( Successive Multiplication Method )
DECIMAL TO BINARY CONVERSION
Steps in Successive Division Method
1. Divide the integer part of decimal number by
desired base number, store quotient (Q) and
remainder (R)
2. Consider quotient as a new decimal number and
repeat step1 until quotient becomes 0
3. Note down the remainders in the reverse order
DECIMAL FRACTIONS TO BINARY
 Multiply Rule is used
 Multiply bit by two and record the carry in the
integer position
 Note down the integers in forward direction(top
to bottom).
(0.364) 10 = ( ?)2
0.364*2 = 0.728 0
0.728*2 = 1.456 1
0.456*2 = 0.912 0
0.912*2 =1.824 1
0.824*2= 1.648 1
Ans:(0.364) 10 = ( 0.01011)2
DECIMAL TO HEXADECIMAL
HEXADECIMAL TO BINARY
 To convert a hexadecimal number to a binary
number, first write each hexadecimal digit to its
4-bit equivalent using the binary codes, and then
write the binary numbers without a gap.
Example : Convert (9A)16 to binary equivalent.
Solution :- (9 A)
(1001 1010) 2
Thus (9A)16 = (1001 1010) 2
BINARY TO HEXADECIMAL CONVERSION
(BIN TO HEX) :
 Converting a binary to hexadecimal is a straight
forward procedure. Simply break the binary
number into four-bit groups starting at binary
point, and replace each group with the equivalent
hexadecimal symbol.
 Example : Convert (101101)2 to Hexadecimal
equivalent
10 1101
2 D
(101101)2=(2D)16
BINARY ADDITIONS
 Binary numbers are added like decimal
numbers.
 In decimal, when numbers sum more than 9 a
carry results.
 In binary when numbers sum more than 1 a
carry takes place.
0 + 0 = 0
1 + 0 = 1
1 + 1 = 0 + carry 1
1 + 1 + 1 = 1 + carry 1
BINARY CODED DECIMAL (BCD) CODE:-
 The binary coded decimal (BCD) code is a
weighted code. This code is found very convenient
for representing digits. Each group of four bits is
used to represent one decimal digit. It is also
called as 8421 code. This code consists of four bits
which have the weights as 8 4 2 1 . The four bit
combination that represents the decimal digits 0
to 9 are shown in table 1.4.
BCD CODE
BINARY SUBTRACTION:
 To perform a binary subtraction you first have to
represent the number to be subtracted in its negative
form. This is known as its two's complement.
 The two's complement of a binary number is obtained
by:
1. Replacing all the 1s with 0s and the 0s with 1s. This is
known as its one's complement.
2. Adding 1 to this number by the rules of binary
addition.
Now you have the two's complement.
Example:
The decimal subtraction 29 - 7 = 22 is the same as
adding (29) + (-7) = 22
1. Convert the number to be subtracted to its two's
complement:
2’S COMPLEMENT SUBTRACTION
00000111 (decimal 7)
11111000 (one's complement)
+ 00000001 (add 1)
11111001 (two's complement)
29 00011101
+-7 11111001
22 (1)00010110
NON-WEIGHTED CODES:-
 Non-weighted binary codes do not follow the
positional weight principle. The example of non-
weighted codes is gray codes, excess-3 code and
alphanumeric code etc.
 Alphanumeric Code:- In communication
along with ordinary number, we need some
characters, punctuation marks and also
control signals. The code we have studied so
far is not enough for data communication. For
overcoming this problem binary symbols are
used for representing number, alphabetic
character and special symbols.
 The binary codes which are uses to represents
number, alphabetic character and special symbol
are called alphanumeric code.
 ASCII
 EBCDIC
ASCII Code
 The ASCII code is extensively used for data
communication and in computers. It is a 7-bit
code, so it can represents 27 or 128 different
characters.
 It can represent decimal number 0-9, letters of
alphabets in lower case and upper case, special
symbol and control instructions. Each symbol has
7- bit code which is made up of a 3-bit group
followed by a 4-bit group. The number is
represented by 8421 code.
GRAY CODE:
 Binary to Gray Converter: In this conversion
the most significant bit (MSB) is copied as it is,
so these represents MSB of gray code, then going
from left to right add each adjacent pair of binary
digits to get the next gray code. After the
addition forget the about carry.
GRAY CODE
GRAY TO BINARY CODE CONVERSION
 In this conversion first write MSB bit as it is of a
gray code, this one is an MSB bit of binary code,
and then add each MSB of binary code to the
next bit of gray code. If carry is generated then
neglect the carry.
REFERENCE BOOKS:
1. Digital Fundamentals: Floyd T.M., Jain R.P., Pearson
Education
2. Digital Electronics: Jain R.P., Tata McGraw Hill
3. Digital Principles and Applications: Malvino Leach, Tata
McGraw-Hill
4. M.Morris Mano, “ Digital Design “ 3rdEdition, PHI,
NewDelhi.
Digital Electronics- Number systems & codes

More Related Content

What's hot

Number system....
Number system....Number system....
Number system....
mshoaib15
 

What's hot (20)

Basics of digital electronics
Basics of digital electronicsBasics of digital electronics
Basics of digital electronics
 
3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )
 
Binary codes
Binary codesBinary codes
Binary codes
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
Digital Logic & Design
Digital Logic & DesignDigital Logic & Design
Digital Logic & Design
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
BCD to Decimal - Digital Electronics
BCD to Decimal - Digital ElectronicsBCD to Decimal - Digital Electronics
BCD to Decimal - Digital Electronics
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Number System
Number SystemNumber System
Number System
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
binary number system
 binary number system binary number system
binary number system
 
Number System
Number SystemNumber System
Number System
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number system
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
review of number systems and codes
review of number systems and codesreview of number systems and codes
review of number systems and codes
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Number system
Number systemNumber system
Number system
 
Number system....
Number system....Number system....
Number system....
 

Similar to Digital Electronics- Number systems & codes

Similar to Digital Electronics- Number systems & codes (20)

digital-180612132737.pdf
digital-180612132737.pdfdigital-180612132737.pdf
digital-180612132737.pdf
 
DIGITAL DESIGN
DIGITAL DESIGNDIGITAL DESIGN
DIGITAL DESIGN
 
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
 
NUMBER SYSTEM.pptx
NUMBER SYSTEM.pptxNUMBER SYSTEM.pptx
NUMBER SYSTEM.pptx
 
Data Representation
Data RepresentationData Representation
Data Representation
 
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...
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
 
data representation
 data representation data representation
data representation
 
DLD_PPT_0.pptx
DLD_PPT_0.pptxDLD_PPT_0.pptx
DLD_PPT_0.pptx
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
 
Number system
Number systemNumber system
Number system
 
Data representation
Data representationData representation
Data representation
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octal
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Csc 2313 (lecture 3)
Csc 2313 (lecture 3)Csc 2313 (lecture 3)
Csc 2313 (lecture 3)
 
Csc 2313 (lecture 3)
Csc 2313 (lecture 3)Csc 2313 (lecture 3)
Csc 2313 (lecture 3)
 

More from VandanaPagar1 (9)

DDUV.pdf
DDUV.pdfDDUV.pdf
DDUV.pdf
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
 
Cloud-topology.pdf
Cloud-topology.pdfCloud-topology.pdf
Cloud-topology.pdf
 
Networking Technologies in IOT.pdf
Networking Technologies in IOT.pdfNetworking Technologies in IOT.pdf
Networking Technologies in IOT.pdf
 
IoT_application.pptx
IoT_application.pptxIoT_application.pptx
IoT_application.pptx
 
Logic Synthesis
Logic SynthesisLogic Synthesis
Logic Synthesis
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
 
Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
 

Recently uploaded

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 

Digital Electronics- Number systems & codes

  • 1. F.Y.B.SC.(C.SC.) PRINCIPLES OF DIGITAL ELECTRONICS- NUMBER SYSTEMS -Prof. Vandana Pagar Assistant professor MIT ACSC.
  • 2. TOPICS TO BE COVERED ➢Number Systems: 1. Decimal Number System 2. Binary Number System 3. Hexadecimal Number System ➢Representation of Numbers of Different Radix ➢Conversion of Numbers from one Radix to Another Radix
  • 3. WHAT IS NUMBER SYSTEM ? •system for representing number of certain type. • Example: –There are several systems for representing the –counting numbers. – These include the usual base “10” or decimal system : 1,2,3 ,…..10,11,12,..99,100,… ,…..10,11,12,..99,100,…
  • 4. System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 No Yes Octal 8 0, 1, … 7 No No Hexa- decimal 16 0, 1, … 9, A, B, … F No No COMMON NUMBER SYSTEM
  • 5. Decimal Binary Hexa- decimal 0 0 0 1 1 1 2 10 2 3 11 3 4 100 4 5 101 5 6 110 6 7 111 7 COUNTING
  • 6. DECIMAL NUMBER SYSTEM In Decimal number system, an ordered set of ten symbols 0,1,2,3,4,5,6,7,8 and 9 are used to specify the quantities. Symbols used are known as digits. Radix or base of decimal number system is 10
  • 8. BINARY NUMBER SYSTEM  The binary number system is a code that uses only two basic symbols i.e. 0 and 1  Generally in digital electronics 0 represents low level and 1 represents high level.  Symbols in binary number system are called as bits.
  • 10. HEXADECIMAL NUMBER SYSTEM  Hexadecimal Number System has a base of sixteen.  It is extensively used in Microprocessor work  It uses 16 distinct symbols 0 to 9 and Ato F 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, F
  • 11. BINARY TO DECIMAL CONVERSION: (i) Get the decimal number (ii) Write the weights in exponential form (iii) Place 1 and a 0 at appropriate positions i.e. place a 1 if weight is taken during the sum and 0 otherwise. iv.) Add all the products
  • 12. HEXADECIMAL TO DECIMAL CONVERSION:  In a hexadecimal number system each digit position corresponds to power of 16. The weight of the digit position in a hexadecimal number is as follows: ▪ In hexadecimal number system each digit position corresponds to appropriate power of 16. The weights of the digit positions in hexadecimal number are as follows: ………163 162 161 160 . 16-1 16-2 16-3 ▪ To convert Hexadecimal number to decimal number, multiply each hexadecimal digit by its weight and add the resulting product.
  • 13. DECIMAL TO ANY BASE  Steps: 1. Convert integer part ( Successive Division Method ) 2. Convert fractional part ( Successive Multiplication Method )
  • 14. DECIMAL TO BINARY CONVERSION Steps in Successive Division Method 1. Divide the integer part of decimal number by desired base number, store quotient (Q) and remainder (R) 2. Consider quotient as a new decimal number and repeat step1 until quotient becomes 0 3. Note down the remainders in the reverse order
  • 15. DECIMAL FRACTIONS TO BINARY  Multiply Rule is used  Multiply bit by two and record the carry in the integer position  Note down the integers in forward direction(top to bottom). (0.364) 10 = ( ?)2 0.364*2 = 0.728 0 0.728*2 = 1.456 1 0.456*2 = 0.912 0 0.912*2 =1.824 1 0.824*2= 1.648 1 Ans:(0.364) 10 = ( 0.01011)2
  • 17. HEXADECIMAL TO BINARY  To convert a hexadecimal number to a binary number, first write each hexadecimal digit to its 4-bit equivalent using the binary codes, and then write the binary numbers without a gap. Example : Convert (9A)16 to binary equivalent. Solution :- (9 A) (1001 1010) 2 Thus (9A)16 = (1001 1010) 2
  • 18. BINARY TO HEXADECIMAL CONVERSION (BIN TO HEX) :  Converting a binary to hexadecimal is a straight forward procedure. Simply break the binary number into four-bit groups starting at binary point, and replace each group with the equivalent hexadecimal symbol.  Example : Convert (101101)2 to Hexadecimal equivalent 10 1101 2 D (101101)2=(2D)16
  • 19. BINARY ADDITIONS  Binary numbers are added like decimal numbers.  In decimal, when numbers sum more than 9 a carry results.  In binary when numbers sum more than 1 a carry takes place. 0 + 0 = 0 1 + 0 = 1 1 + 1 = 0 + carry 1 1 + 1 + 1 = 1 + carry 1
  • 20. BINARY CODED DECIMAL (BCD) CODE:-  The binary coded decimal (BCD) code is a weighted code. This code is found very convenient for representing digits. Each group of four bits is used to represent one decimal digit. It is also called as 8421 code. This code consists of four bits which have the weights as 8 4 2 1 . The four bit combination that represents the decimal digits 0 to 9 are shown in table 1.4.
  • 22. BINARY SUBTRACTION:  To perform a binary subtraction you first have to represent the number to be subtracted in its negative form. This is known as its two's complement.  The two's complement of a binary number is obtained by: 1. Replacing all the 1s with 0s and the 0s with 1s. This is known as its one's complement. 2. Adding 1 to this number by the rules of binary addition. Now you have the two's complement. Example: The decimal subtraction 29 - 7 = 22 is the same as adding (29) + (-7) = 22 1. Convert the number to be subtracted to its two's complement:
  • 23. 2’S COMPLEMENT SUBTRACTION 00000111 (decimal 7) 11111000 (one's complement) + 00000001 (add 1) 11111001 (two's complement) 29 00011101 +-7 11111001 22 (1)00010110
  • 24. NON-WEIGHTED CODES:-  Non-weighted binary codes do not follow the positional weight principle. The example of non- weighted codes is gray codes, excess-3 code and alphanumeric code etc.  Alphanumeric Code:- In communication along with ordinary number, we need some characters, punctuation marks and also control signals. The code we have studied so far is not enough for data communication. For overcoming this problem binary symbols are used for representing number, alphabetic character and special symbols.  The binary codes which are uses to represents number, alphabetic character and special symbol are called alphanumeric code.  ASCII  EBCDIC
  • 25. ASCII Code  The ASCII code is extensively used for data communication and in computers. It is a 7-bit code, so it can represents 27 or 128 different characters.  It can represent decimal number 0-9, letters of alphabets in lower case and upper case, special symbol and control instructions. Each symbol has 7- bit code which is made up of a 3-bit group followed by a 4-bit group. The number is represented by 8421 code.
  • 26.
  • 27. GRAY CODE:  Binary to Gray Converter: In this conversion the most significant bit (MSB) is copied as it is, so these represents MSB of gray code, then going from left to right add each adjacent pair of binary digits to get the next gray code. After the addition forget the about carry.
  • 29. GRAY TO BINARY CODE CONVERSION  In this conversion first write MSB bit as it is of a gray code, this one is an MSB bit of binary code, and then add each MSB of binary code to the next bit of gray code. If carry is generated then neglect the carry.
  • 30. REFERENCE BOOKS: 1. Digital Fundamentals: Floyd T.M., Jain R.P., Pearson Education 2. Digital Electronics: Jain R.P., Tata McGraw Hill 3. Digital Principles and Applications: Malvino Leach, Tata McGraw-Hill 4. M.Morris Mano, “ Digital Design “ 3rdEdition, PHI, NewDelhi.