SlideShare uma empresa Scribd logo
1 de 20
Number Codes Digital Logic and  Software Principles © University of Wales Newport 2009 This work is licensed under a  Creative Commons Attribution 2.0 License .
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Number Codes
Binary Coded Decimal BCD Numbers Each decimal digit to be represented in BCD is converted into its 4 digit binary equivalent. The final number will consist of four times the number of original decimal digits.  As the decimal digits relating to 1010, 1011, 1100, 1101, 1110, 1111 do not exist these are invalid. Decimal Binary BCD 0 0000 0000 0000 0000 1 0000 0001 0000 0001 2 0000 0010 0000 0010 3 0000 0011 0000 0011 4 0000 0100 0000 0100 5 0000 0101 0000 0101 6 0000 0110 0000 0110 7 0000 0111 0000 0111 8 0000 1000 0000 1000 9 0000 1001 0000 1001 10 0000 1010 0001 0000 11 0000 1011 0001 0001 12 0000 1100 0001 0010 13 0000 1101 0001 0011 14 0000 1110 0001 0100 15 0000 1111 0001 0101 16 0001 0000 0001 0110 17 0001 0001 0001 0111 18 0001 0010 0001 1000 19 0001 0011 0001 1001 20 0001 0100 0010 0000
Converting between Decimal and BCD From Decimal to BCD:      To convert decimal to binary replace each decimal digit by its binary equivalent and then concatenate the result. For example, 2769 0010  0111  0110  1001 = 0010011101101001 Number Codes
From BCD to Decimal: Group the bits from the left into fours – if leading zeroes have been removed so that the total number of digits are a multiple of four. Convert each group into its decimal equivalent. Example 110101011010010001 00 11 0101 0110 1001 0001   3   5   6   9   1
BCD Addition BCD numbers can be added as long as certain rules are followed – these are.  if the addition produces a carry  or  if it creates an invalid BCD number then correct the digit by adding six where the error  occurred. . For example, 24 + 13 = 37 15 + 9 = 24 19 + 28 = 47  Number Codes
BCD Subtraction BCD numbers can be subtracted as long as certain rules are followed – these are.  if the subtraction produces a borrow  or  if it creates an invalid BCD number then correct the digit by subtracting six where the  error occurred. For example, 37 - 12 = 25 65 – 19 = 46 41 – 18 = 23  Number Codes
Other Codes ASCII Representation of Digits  (American Standard Code for Information Interchange) ASCII  is a code that allows not only decimal digits to be represented in binary format but also other non numerical characters. In its simplest form it has seven binary digits allowing the identification of 128 different characters. For the representation of the numbers from 0 to 9 we simply convert each digit to  four bit binary and then add 011 to the left hand side. 5 0101 0110101 decimal binary ASCII Number Codes
EBCDIC Representation of Digits  (Extended Binary Coded Decimal Interchange Code) This is an eight bit code which is used to represent decimal numbers. The decimal number is converted to its four bit binary equivalent and then four ones are added to the left. 5 0101 11110101 decimal binary EBCDIC Number Codes
Excess-3 (XS3)   Excess three is the same as BCD but before the conversion takes place three is added to the decimal number. This means the following combinations do not exist as valid XS3 numbers. 0000 0001 0010 1101 1110 and 1111 This representation simplifies the addition process. Rule:  if the addition stage generates a carry add 3,  if it does not subtract 3 Number Codes
For example, 24 + 13 = 37 15 + 9 = 24 19 + 28 = 47 Subtraction Rule:  if the subtraction stage requires a borrow subtract 3,  if it does not add 3 For example, 37 - 12 = 25 65 – 19 = 46 41 – 18 = 23 Number Codes
4221  This coding technique is used to produce a balanced number of 0s and 1s in a random sequence of decimal conversions Rather than the multipliers scaling by a factor of 2 as we move to the left, the multipliers are  4, 2, 2, 1  not  8, 4, 2, 1  This is sometimes written 4221 BCD.  Number Codes
Summary Number Codes Digit ASCII EBCDIC XS3 4221 0 0011 0000 1111 0000 0011 0000 1 0011 0001 1111 0001 0100 0001 2 0011 0010 1111 0010 0101 0010 3 0011 0011 1111 0011 0110 0011 4 0011 0100 1111 0100 0111 1000 5 0011 0101 1111 0101 1000 0111 6 0011 0110 1111 0110 1001 1100 7 0011 0111 1111 0111 1010 1101 8 0011 1000 1111 1000 1011 1110 9 0011 1001 1111 1001 1100 1111
Gray Code If the decimal numbers to be encoded are increasing or decreasing linearly  e.g.  3 – 4 – 5 – 6 – 7 or 23 – 22 – 21 – 20 – 19 etc then it is possible for the conversion process to cause ambiguities as the digits change. This can be prevented if Gray Codes are employed. Begin with all zeros and change the least significant bit. Change the next bit and reflect previous lower significant bits.  Carry on with this process. Number Codes
Shaft Encoder This converts rotary movement into a digital number. It takes the following form: Number Codes Encoder Disk Light Sources Light Detectors Rotating Shaft
The encoder disk has areas that are opaque and areas that are transparent. As the disk turns light is passed to the detectors or blocked. The disk has the following form: complete this for binary code Binary Disk 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
As the disk rotates anticlockwise we will reach a point where the output is  0 1 1 1  which is the output for position 7.  Further rotation will move us to segment 8 where the output is  1 0 0 0 .  Note that each of the four bits change their state during this transition. Problems arise due to the fact that the light sources and detectors can never be “perfectly” aligned and therefore one of the bits will change before the others. Bit 0 first we have a reading of 0 1 1 0  position 6 Bit 1 first we have a reading of 0 1 0 1  position 5 Bit 2 first we have a reading of 0 0 1 1  position 3 Bit 3 first we have a reading of 1 1 1 1  position 15 Number Codes
We can see that with this code we can have erroneous outputs, which could be very serious. For this reason we use Grey Code   Generation of Gray is as follows: 0 0 0 0 0 0 0 0 1 1 0 0 1 1 3 0 0 1 0 2 0 1 1 0 6 0 1 1 1 7 0 1 0 1 5 0 1 0 0 4 1 1 0 0  12 1 1 0 1 13 1 1 1 1 15 1 1 1 0 14 1 0 1 0 10 1 0 1 1 11 1 0 0 1 9 1 0 0 0 8 Note Only one bit changes as we move from one segment to the next – hence no possible erroneous outputs. Complete the Gray disk on the next page. How can we convert from Gray to Binary? Number Codes
Gray Disk Number Codes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
This resource was created by the University of Wales Newport and released as an open educational resource through the Open Engineering Resources project of the HE Academy Engineering Subject Centre. The Open Engineering Resources project was funded by HEFCE and part of the JISC/HE Academy UKOER programme. © 2009 University of Wales Newport This work is licensed under a  Creative Commons Attribution 2.0 License . The JISC logo is licensed under the terms of the Creative Commons Attribution-Non-Commercial-No Derivative Works 2.0 UK: England & Wales Licence.  All reproductions must comply with the terms of that licence. The HEA logo is owned by the Higher Education Academy Limited may be freely distributed and copied for educational purposes only, provided that appropriate acknowledgement is given to the Higher Education Academy as the copyright holder and original publisher. The name and logo of University of Wales Newport is a trade mark and all rights in it are reserved.  The name and logo should not be reproduced without the express authorisation of the University. Number Codes

Mais conteúdo relacionado

Mais procurados

BCD to Decimal - Digital Electronics
BCD to Decimal - Digital ElectronicsBCD to Decimal - Digital Electronics
BCD to Decimal - Digital ElectronicsMilap Bhanderi
 
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 )MdFazleRabbi18
 
Error detection and correction codes r006
Error detection and correction codes   r006Error detection and correction codes   r006
Error detection and correction codes r006arunachalamr16
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & DecoderPritam Shil
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesstudent
 
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
 
Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted CodesSubhamSatpathy2
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representationAnil Pokhrel
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
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 arithmeticAmrutaMehata
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number systemMuhammad Shahid
 
data representation
 data representation data representation
data representationHaroon_007
 
Data representation
Data representationData representation
Data representationMysore
 

Mais procurados (20)

Binary codes
Binary codesBinary codes
Binary codes
 
BCD to Decimal - Digital Electronics
BCD to Decimal - Digital ElectronicsBCD to Decimal - Digital Electronics
BCD to Decimal - 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 )
 
Error detection and correction codes r006
Error detection and correction codes   r006Error detection and correction codes   r006
Error detection and correction codes r006
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & Decoder
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codes
 
Codes
CodesCodes
Codes
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
Bcd
BcdBcd
Bcd
 
. computer codes
. computer codes. computer codes
. computer codes
 
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...
 
Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted Codes
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
 
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
 
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
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number system
 
data representation
 data representation data representation
data representation
 
Data representation
Data representationData representation
Data representation
 

Destaque (13)

Numbersystemcont
NumbersystemcontNumbersystemcont
Numbersystemcont
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
Design considerations
Design considerationsDesign considerations
Design considerations
 
Decoders student
Decoders studentDecoders student
Decoders student
 
Semiconductor theory
Semiconductor theorySemiconductor theory
Semiconductor theory
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systems
 
Introduction to fourier analysis
Introduction to fourier analysisIntroduction to fourier analysis
Introduction to fourier analysis
 
8051 Assembly Language Programming
8051 Assembly Language Programming8051 Assembly Language Programming
8051 Assembly Language Programming
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
B sc cs i bo-de u-iii combitional logic circuit
B sc cs i bo-de u-iii combitional logic circuitB sc cs i bo-de u-iii combitional logic circuit
B sc cs i bo-de u-iii combitional logic circuit
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
 
Logic gates
Logic gatesLogic gates
Logic gates
 
8051 experiments1
8051 experiments18051 experiments1
8051 experiments1
 

Semelhante a Number codes students

Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2ISMT College
 
Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfUmerKhan147799
 
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfW3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfMOHDZAMRIBINIBRAHIM1
 
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...JatinJatin30
 
PPT - 2.pptx
PPT - 2.pptxPPT - 2.pptx
PPT - 2.pptxANUTD1
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdeepaMS4
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
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
 

Semelhante a Number codes students (20)

Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 
Digital logic mohammed salim ch2
Digital logic mohammed salim ch2Digital logic mohammed salim ch2
Digital logic mohammed salim ch2
 
Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdf
 
Binary codes
Binary codesBinary codes
Binary codes
 
binarycodes.pdf
binarycodes.pdfbinarycodes.pdf
binarycodes.pdf
 
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfW3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
 
Mcs 012 soved assignment 2015-16
Mcs 012 soved assignment 2015-16Mcs 012 soved assignment 2015-16
Mcs 012 soved assignment 2015-16
 
Number system
Number systemNumber system
Number system
 
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
 
Number system
Number systemNumber system
Number system
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
PPT - 2.pptx
PPT - 2.pptxPPT - 2.pptx
PPT - 2.pptx
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptx
 
BCDCONVERTER.pptx
BCDCONVERTER.pptxBCDCONVERTER.pptx
BCDCONVERTER.pptx
 
ch2.pdf
ch2.pdfch2.pdf
ch2.pdf
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
DESIGN OF COMBINATIONAL LOGIC
DESIGN OF COMBINATIONAL LOGICDESIGN OF COMBINATIONAL LOGIC
DESIGN OF COMBINATIONAL LOGIC
 
Number Codes and Registers
Number Codes and RegistersNumber Codes and Registers
Number Codes and Registers
 
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
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 

Mais de School of Design Engineering Fashion & Technology (DEFT), University of Wales, Newport (8)

Number bases
Number basesNumber bases
Number bases
 
Sequential Logic
Sequential LogicSequential Logic
Sequential Logic
 
Logic Equation Simplification
Logic Equation SimplificationLogic Equation Simplification
Logic Equation Simplification
 
Stabilised Power Supplies
Stabilised Power SuppliesStabilised Power Supplies
Stabilised Power Supplies
 
Amplifier Compensation
Amplifier CompensationAmplifier Compensation
Amplifier Compensation
 
Counter And Sequencer Design- Student
Counter And Sequencer Design- StudentCounter And Sequencer Design- Student
Counter And Sequencer Design- Student
 
Chapter 6 Probability
Chapter 6  ProbabilityChapter 6  Probability
Chapter 6 Probability
 
Chapter 4 Integration
Chapter 4  IntegrationChapter 4  Integration
Chapter 4 Integration
 

Último

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Último (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 

Number codes students

  • 1. Number Codes Digital Logic and Software Principles © University of Wales Newport 2009 This work is licensed under a Creative Commons Attribution 2.0 License .
  • 2.
  • 3. Binary Coded Decimal BCD Numbers Each decimal digit to be represented in BCD is converted into its 4 digit binary equivalent. The final number will consist of four times the number of original decimal digits. As the decimal digits relating to 1010, 1011, 1100, 1101, 1110, 1111 do not exist these are invalid. Decimal Binary BCD 0 0000 0000 0000 0000 1 0000 0001 0000 0001 2 0000 0010 0000 0010 3 0000 0011 0000 0011 4 0000 0100 0000 0100 5 0000 0101 0000 0101 6 0000 0110 0000 0110 7 0000 0111 0000 0111 8 0000 1000 0000 1000 9 0000 1001 0000 1001 10 0000 1010 0001 0000 11 0000 1011 0001 0001 12 0000 1100 0001 0010 13 0000 1101 0001 0011 14 0000 1110 0001 0100 15 0000 1111 0001 0101 16 0001 0000 0001 0110 17 0001 0001 0001 0111 18 0001 0010 0001 1000 19 0001 0011 0001 1001 20 0001 0100 0010 0000
  • 4. Converting between Decimal and BCD From Decimal to BCD:      To convert decimal to binary replace each decimal digit by its binary equivalent and then concatenate the result. For example, 2769 0010 0111 0110 1001 = 0010011101101001 Number Codes
  • 5. From BCD to Decimal: Group the bits from the left into fours – if leading zeroes have been removed so that the total number of digits are a multiple of four. Convert each group into its decimal equivalent. Example 110101011010010001 00 11 0101 0110 1001 0001 3 5 6 9 1
  • 6. BCD Addition BCD numbers can be added as long as certain rules are followed – these are. if the addition produces a carry or if it creates an invalid BCD number then correct the digit by adding six where the error occurred. . For example, 24 + 13 = 37 15 + 9 = 24 19 + 28 = 47 Number Codes
  • 7. BCD Subtraction BCD numbers can be subtracted as long as certain rules are followed – these are. if the subtraction produces a borrow or if it creates an invalid BCD number then correct the digit by subtracting six where the error occurred. For example, 37 - 12 = 25 65 – 19 = 46 41 – 18 = 23 Number Codes
  • 8. Other Codes ASCII Representation of Digits (American Standard Code for Information Interchange) ASCII is a code that allows not only decimal digits to be represented in binary format but also other non numerical characters. In its simplest form it has seven binary digits allowing the identification of 128 different characters. For the representation of the numbers from 0 to 9 we simply convert each digit to four bit binary and then add 011 to the left hand side. 5 0101 0110101 decimal binary ASCII Number Codes
  • 9. EBCDIC Representation of Digits (Extended Binary Coded Decimal Interchange Code) This is an eight bit code which is used to represent decimal numbers. The decimal number is converted to its four bit binary equivalent and then four ones are added to the left. 5 0101 11110101 decimal binary EBCDIC Number Codes
  • 10. Excess-3 (XS3) Excess three is the same as BCD but before the conversion takes place three is added to the decimal number. This means the following combinations do not exist as valid XS3 numbers. 0000 0001 0010 1101 1110 and 1111 This representation simplifies the addition process. Rule: if the addition stage generates a carry add 3, if it does not subtract 3 Number Codes
  • 11. For example, 24 + 13 = 37 15 + 9 = 24 19 + 28 = 47 Subtraction Rule: if the subtraction stage requires a borrow subtract 3, if it does not add 3 For example, 37 - 12 = 25 65 – 19 = 46 41 – 18 = 23 Number Codes
  • 12. 4221 This coding technique is used to produce a balanced number of 0s and 1s in a random sequence of decimal conversions Rather than the multipliers scaling by a factor of 2 as we move to the left, the multipliers are 4, 2, 2, 1 not 8, 4, 2, 1 This is sometimes written 4221 BCD. Number Codes
  • 13. Summary Number Codes Digit ASCII EBCDIC XS3 4221 0 0011 0000 1111 0000 0011 0000 1 0011 0001 1111 0001 0100 0001 2 0011 0010 1111 0010 0101 0010 3 0011 0011 1111 0011 0110 0011 4 0011 0100 1111 0100 0111 1000 5 0011 0101 1111 0101 1000 0111 6 0011 0110 1111 0110 1001 1100 7 0011 0111 1111 0111 1010 1101 8 0011 1000 1111 1000 1011 1110 9 0011 1001 1111 1001 1100 1111
  • 14. Gray Code If the decimal numbers to be encoded are increasing or decreasing linearly e.g. 3 – 4 – 5 – 6 – 7 or 23 – 22 – 21 – 20 – 19 etc then it is possible for the conversion process to cause ambiguities as the digits change. This can be prevented if Gray Codes are employed. Begin with all zeros and change the least significant bit. Change the next bit and reflect previous lower significant bits. Carry on with this process. Number Codes
  • 15. Shaft Encoder This converts rotary movement into a digital number. It takes the following form: Number Codes Encoder Disk Light Sources Light Detectors Rotating Shaft
  • 16. The encoder disk has areas that are opaque and areas that are transparent. As the disk turns light is passed to the detectors or blocked. The disk has the following form: complete this for binary code Binary Disk 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  • 17. As the disk rotates anticlockwise we will reach a point where the output is 0 1 1 1 which is the output for position 7. Further rotation will move us to segment 8 where the output is 1 0 0 0 . Note that each of the four bits change their state during this transition. Problems arise due to the fact that the light sources and detectors can never be “perfectly” aligned and therefore one of the bits will change before the others. Bit 0 first we have a reading of 0 1 1 0 position 6 Bit 1 first we have a reading of 0 1 0 1 position 5 Bit 2 first we have a reading of 0 0 1 1 position 3 Bit 3 first we have a reading of 1 1 1 1 position 15 Number Codes
  • 18. We can see that with this code we can have erroneous outputs, which could be very serious. For this reason we use Grey Code Generation of Gray is as follows: 0 0 0 0 0 0 0 0 1 1 0 0 1 1 3 0 0 1 0 2 0 1 1 0 6 0 1 1 1 7 0 1 0 1 5 0 1 0 0 4 1 1 0 0 12 1 1 0 1 13 1 1 1 1 15 1 1 1 0 14 1 0 1 0 10 1 0 1 1 11 1 0 0 1 9 1 0 0 0 8 Note Only one bit changes as we move from one segment to the next – hence no possible erroneous outputs. Complete the Gray disk on the next page. How can we convert from Gray to Binary? Number Codes
  • 19. Gray Disk Number Codes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  • 20. This resource was created by the University of Wales Newport and released as an open educational resource through the Open Engineering Resources project of the HE Academy Engineering Subject Centre. The Open Engineering Resources project was funded by HEFCE and part of the JISC/HE Academy UKOER programme. © 2009 University of Wales Newport This work is licensed under a Creative Commons Attribution 2.0 License . The JISC logo is licensed under the terms of the Creative Commons Attribution-Non-Commercial-No Derivative Works 2.0 UK: England & Wales Licence.  All reproductions must comply with the terms of that licence. The HEA logo is owned by the Higher Education Academy Limited may be freely distributed and copied for educational purposes only, provided that appropriate acknowledgement is given to the Higher Education Academy as the copyright holder and original publisher. The name and logo of University of Wales Newport is a trade mark and all rights in it are reserved. The name and logo should not be reproduced without the express authorisation of the University. Number Codes