92 views

Uploaded by kstu1112

- bpj lesson 13
- DDS Reference
- Error Detection 3
- 8x8 Matrix Vinyl
- Without the Ability to Interact With the Rest of the World
- Binaries, Strings and Char Lists - Elixir
- Combinational Circuits Design
- Excel
- Smart Messaging Specification Rev 3 0 0
- 6502_microprocessor.pdf
- Lec2 Binary Arithmetic
- Binary Codes
- 6502
- Part III 8051 General Pgms
- Mmixal Intro.ps
- Assignment
- Abcd
- Mathmatics Basics in Hindi and English
- Error Correction
- 7.CS6201 -DPSD

You are on page 1of 5

Objectives

In this lesson, you will study:

1. Several binary codes including

¾ Binary Coded Decimal (BCD),

¾ Error detection codes,

¾ Character codes

2. Coding versus binary conversion.

¾ Internally, digital computers operate on binary numbers.

¾ When interfacing to humans, digital processors, e.g. pocket calculators, communication is

decimal-based.

¾ Input is done in decimal then converted to binary for internal processing.

¾ For output, the result has to be converted from its internal binary representation to a decimal

form.

¾ To be handled by digital processors, the decimal input (output) must be coded in binary in a

digit by digit manner.

¾ For example, to input the decimal number 957, each digit of the number is individually

coded and the number is stored as 1001_0101_0111.

¾ Thus, we need a specific code for each of the 10 decimal digits. There is a variety of such

decimal binary codes.

¾ The shown table gives several common such codes.

¾ One commonly used code is the Binary Coded Decimal (BCD) code which corresponds to

the first 10 binary representations of the decimal digits 0-9.

¾ The BCD code requires 4 bits to represent the 10 decimal digits.

¾ Since 4 bits may have up to 16 different binary combinations, a total of 6 combinations will

be unused.

¾ The position weights of the BCD code are 8, 4, 2, 1.

¾ Other codes (shown in the table) use position weights of 8, 4, -2, -1 and 2, 4, 2, 1.

¾ An example of a non-weighted code is the excess-3 code where digit codes is obtained from

their binary equivalent after adding 3. Thus the code of a decimal 0 is 0011, that of 6 is

1001, etc.

1

Decimal BCD

Digit 8 4 2 1 8 4 -2 -1 2 4 2 1 Excess-3

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1

1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 0

2 0 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1

3 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 0

4 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1

5 0 1 0 1 1 0 1 1 1 0 1 1 1 0 0 0

6 0 1 1 0 1 0 1 0 1 1 0 0 1 0 0 1

7 0 1 1 1 1 0 0 1 1 1 0 1 1 0 1 0

8 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 1

9 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0

U 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0

N 1 0 1 1 0 0 1 0 0 1 1 0 0 0 0 1

U 1 1 0 0 0 0 1 1 0 1 1 1 0 0 1 0

S 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 1

E 1 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0

D 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 1

¾ Converting a decimal number into binary is done by repeated division (multiplication) by 2

for integers (fractions) (see lesson 4).

¾ Coding a decimal number into its BCD code is done by replacing each decimal digit of the

number by its equivalent 4 bit BCD code.

Example Converting (13)10 into binary, we get 1101, coding the same number into BCD, we

obtain 00010011.

equivalent value and give its BCD code as

well.

Answer {(1011111)2, and 10010101}

2

Error-Detection Codes

¾ Binary information may be transmitted through some communication medium, e.g. using

wires or wireless media.

¾ A corrupted bit will have its value changed

from 0 to 1 or vice versa.

¾ To be able to detect errors at the receiver end, the sender sends an extra bit (parity bit) with

the original binary message.

Binary

Message

SENDER Reciever

Error

Detecting Bit

(Parity Bit)

¾ A parity bit is an extra bit included with the n-bit binary message to make the total number

of 1’s in this message (including the parity bit) either odd or even.

¾ If the parity bit makes the total number of 1’s an odd (even) number, it is called odd (even)

parity.

¾ The table shows the required odd (even) parity for a 3-bit message.

X Y Z P P

0 0 0 1 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 0 1

¾ At the receiver end, an error is detected if the message does not match have the proper

parity (odd/even).

¾ Parity bits can detect the occurrence 1, 3, 5 or any odd number of errors in the transmitted

message.

3

¾ No error is detectable if the transmitted message has 2 bits in error since the total number of

1’s will remain even (or odd) as in the original message.

¾ In general, a transmitted message with even number of errors cannot be detected by the

parity bit.

Error-Detection Codes

¾ Binary information may be transmitted through some communication medium, e.g. using

wires or wireless media.

¾ Noise in the transmission medium may cause the transmitted binary message to be

corrupted by changing a bit from 0 to 1 or vice versa.

¾ To be able to detect errors at the receiver end, the sender sends an extra bit (parity bit).

Gray Code

¾ The Gray code consist of 16 4-bit code words to represent the decimal Numbers 0 to 15.

¾ For Gray code, successive code words differ by only one bit from one to the next as shown

in the table and further illustrated in the Figure.

Gray Code Decimal

Equivalent

0000

1000 0001

0

0 0 0 0 0

15 1

1001 0011 0 0 0 1 1

14 2

0 0 1 1 2

1011 13

0010 0 0 1 0 3

3

0 1 1 0 4

0 1 1 1 5

1010 12 4 0110

0 1 0 1 6

0 1 0 0 7

5

1110 11 0111

1 1 0 0 8

10

6 1 1 0 1 9

1111 0101

9 7 1 1 1 1 10

8

1101 0100 1 1 1 0 11

1100

1 0 1 0 12

1 0 1 1 13

Character Codes

1 0 0 1 14

ASCII Character Code

1 0 0 0 15

¾ ASCII code is a 7-bit code. Thus, it represents a total of 128

characters.

4

¾ Out of the 128 characters, there are 94 printable characters and 34 control (non- printable)

characters.

¾ The printable characters include the upper and lower case letters (2*26), the 10 numerals (0-9), and

32 special characters, e.g. @, %, $, etc.

¾ For example, “A” is at (41)16, while “a” is at (61) )16.

¾ To convert upper case letters to lower case letters, add (20)16. Thus “a” is at (41)16 + (20)16 = (61)16.

¾ The code of the character “9” at position (39)16 is different from the binary number 9 (0001001). To

convert ASCII code of a numeral to its binary number value, subtract (30)16.

¾ Unicode is a 16-bit character code that accommodates characters of various languages of the

world.

- bpj lesson 13Uploaded byapi-307094458
- DDS ReferenceUploaded byapi-26564177
- Error Detection 3Uploaded bynithinu
- 8x8 Matrix VinylUploaded byScott Melgarejo
- Without the Ability to Interact With the Rest of the WorldUploaded byJake Tyler
- Binaries, Strings and Char Lists - ElixirUploaded byAndré Calazans
- Combinational Circuits DesignUploaded byBasheer V.P
- ExcelUploaded bysvksolai
- Smart Messaging Specification Rev 3 0 0Uploaded byblychtr
- 6502_microprocessor.pdfUploaded bybandihoot
- Lec2 Binary ArithmeticUploaded bynachocatalan
- Binary CodesUploaded byJatin Suri
- 6502Uploaded byaregaer
- Part III 8051 General PgmsUploaded byHEMA
- Mmixal Intro.psUploaded byUgo Comi
- AssignmentUploaded byMilan Mondal
- AbcdUploaded bySaiVamsi
- Mathmatics Basics in Hindi and EnglishUploaded byneeraj22yadav
- Error CorrectionUploaded bySrini Vasulu
- 7.CS6201 -DPSDUploaded byNitinchandra Hegade
- net1.txtUploaded byVrunda
- AssignmentUploaded byMilan Mondal
- How to Convert From Decimal to BinaryUploaded bycykee
- Optional-Vector Space Applic 1Uploaded byMuhammad Saad Malik
- CONVERTING BINARY TO DECIMALUploaded byGerard Joseph
- TI-NspireCAS ReferenceGuide EnUploaded byblaster_x22
- Ibps Po Prelim. Set 1 bank poUploaded byAkanksha Srivastava
- Basic Plc Ladder Logic FunctionsUploaded byAmon Amarth
- A Manual of Pronunciation. for Practical Use in Schools and Families - Otis AshmoreUploaded bymiki1222
- Chandigarh Number System 1Uploaded bySushobhan Sanyal

- 2-Lecture Notes Lesson3 5Uploaded bykstu1112
- adhocUploaded bykstu1112
- 2-Lecture Notes Lesson3 1Uploaded bykstu1112
- 2-Lecture Notes Lesson5 2Uploaded bykstu1112
- 2-Lecture Notes Lesson5 4Uploaded bykstu1112
- CODF_v02bUploaded byajaysatija
- 1elec_1Uploaded byhatim5
- Lab ManualUploaded bykstu1112
- 2-Lecture Notes Lesson1 3Uploaded bykstu1112
- 2-Lecture Notes Lesson2 5Uploaded bykstu1112
- bgpUploaded bykstu1112
- 2-Lecture Notes Lesson3 6Uploaded bykstu1112
- 2-Lecture Notes Lesson5 3Uploaded bykstu1112
- Junction Diode07Uploaded bykstu1112
- 2-Lecture Notes Lesson3 7Uploaded bykstu1112
- 3-Presentations COE 081 202 MemoryAndPLDsUploaded bykstu1112
- 4-Homeworks_HW_3_coe_081_202_02Uploaded bykstu1112
- 2-Lecture Notes Lesson1 1Uploaded bykstu1112
- 2-Lecture Notes Lesson2 6Uploaded bykstu1112
- 4-Homeworks_HW_1_coe_081_202_02_solUploaded bykstu1112
- 1-Syllabus Coe 081 202 01 SyllabusUploaded bykstu1112
- 2-Lecture Notes Lesson2 7Uploaded bykstu1112
- 2-Lecture Notes Lesson2 4Uploaded bykstu1112
- 3-Presentations COE 081 202 Com Bi National LogicUploaded bykstu1112
- 2-Lecture Notes Lesson2 2Uploaded bykstu1112
- 2-Lecture Notes Lesson4 2Uploaded bykstu1112
- 4-Homeworks_HW_2_coe_081_202_02Uploaded bykstu1112
- 4-Homeworks_HW_1_coe_081_202_02Uploaded bykstu1112
- 2-Lecture Notes Lesson1 4Uploaded bykstu1112
- 2-Lecture Notes Lesson2 3Uploaded bykstu1112

- Number SystemUploaded byDigitallogicdl
- repaso 1Uploaded byHector Gasga
- dlc slides1Uploaded bygumbo tyagi
- Lect4 Base ConversionUploaded byaggarwalmegha
- Data representationUploaded byAkshay Mathur
- ir126Uploaded byapi-3738835
- 1.0 Number BasesUploaded byshahzuan123
- Memento2010.DocUploaded bymickado
- Vedic Maths FormuleeUploaded bybosudipta4796
- Binary and Decimal ConversionsUploaded bySturge
- 1_coding and DecodingUploaded byPratik Pasiyawala
- 062 Teorija Informacije Aritmeticko kodiranjeUploaded byAidaVeispahic
- Error control coding Shuai Lin and costello Solutions Chapter 03Uploaded byMuthu Kumar
- DorkUploaded bymurali2317
- 605 Ass and Quiz 2011Uploaded byRohan Jain
- Binary Codes.pdfUploaded bygutterbc
- Mohican DictionaryUploaded bydwinchell_1
- Barcode Reference EnUploaded bySoniaChiches
- ir159Uploaded byapi-3738835
- 80MM Printer Programmer Manual-20150312Uploaded byjeffprox69
- ASCII Device Control CharactersUploaded byJosef Vev Msyoki
- Lecturer1 Number SystemUploaded bykotreshmarali
- EE576_Lec_01Uploaded byYasser F. Aleryani
- EmoticonsUploaded byandreicatalind
- EEN 417-logic circuitsUploaded byAngelo Mark Ordoña Porgatorio
- Coding TheoryUploaded byAnbuselvi Mathivanan
- Binary_Coded_Decimal.pdfUploaded bydestaw
- Catalogo de DecapodosUploaded byJuan de la Garza
- Chapter 4Uploaded byJesse Garrard
- Digtial electronicsUploaded bygjdapromise