SlideShare uma empresa Scribd logo
1 de 38
Applied physics III

Digital Codes

by Benson Mbuya
Binary Coded Decimal (BCD)
• One of the most widely used representations of
numerical data is the binary coded decimal
(BCD) form in which each integer of a decimal
number is represented by a 4-bit binary number
(see conversion table).
• It is particularly useful for the driving of display
devices where a decimal output is desired. BCD
usually refers to such coding in which the binary
digits have their normal values, i.e., 8421.
Sometimes it is written "8421 BCD" to clearly
distinguish it from other binary codes such as
the4221 Code, but when BCD is used without
qualification, the 8421 version is assumed.
Binary Coded Decimal (BCD)
Binary-Coded Decimal (BCD)
• Four bits per digit
Digit

Bit pattern

0

0000

Note: the following bit
patterns are not used:

1

0001

2

0010

1010
1011
1100
1101
1110
1111

3

0011

4

0100

5

0101

6

0110

7

0111

8

1000

9

1001
Example
• 709310 = ? (in BCD)

7

0

9

3

0111

0000

1001

0011
BCD
BCD Addition
• Multi-digit BCD numbers can be added together
23
0010 0011
45
0100 0101
68
0110 1000
23
0010 0011
48
0100 1000
71
0110 1011
• 1011 is illegal BCD number
BCD Addition
• Add a 0110 (6) to an invalid BCD number
• Carry added to the most significant BCD digit
23
48
71

0010 0011
0100 1000
0110 1011
0110
0111 0001
32
84
71

0011 0010
1000 0100
1011 0110
0110
10001 0110
Gray Code : Minimum Change code
• Gray code is also known as reflected binary code.
• The reflected binary code was originally designed to prevent
spurious outputs from electromechanical switches.
• Today, Gray codes are widely used to facilitate error correction in
digital communications
Gray code
Converting Gray coded number to binary
Example: binary to gray code
Example: Gray code to Binary
Alphanumeric Codes
• Represent numbers and alphabetic characters.
—Also represent other characters such as symbols and
various instructions necessary for conveying
information.

• The ASCII is the most common alphanumeric
code.
—ASCII = American Standard Code for Information
Interchange
The Problem
• Representing text strings, such as
“Hello, world”, in a computer
Codes and Characters
• Each character is coded as a byte
• Most common coding system is ASCII
(Pronounced ass-key)
• ASCII = American National Standard Code for
Information Interchange
• Defined in ANSI document X3.4-1977
ASCII Features
•
•
•
•

7-bit code
8th bit is unused (or used for a parity bit)
27 = 128 codes
Two general types of codes:
—95 are “Graphic” codes (displayable on a console)
—33 are “Control” codes (control features of the
console or communications channel)
ASCII
Table

http://ascii-table.com/img/table.gif
ASCII CHART
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

000
NULL
SOH
STX
ETX
EDT
ENQ
ACK
BEL
BS
HT
LF
VT
FF
CR
SO
SI

001
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
ESC
FS
GS
RS
US

010
!
"
#
$
%
&
'
(
)
*
+
,
.
/

011
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?

100
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O

101
P
Q
R
S
T
U
V
W
X
Y
Z
[

]
^
_

110
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o

111
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL
000
001
0000
NULL
DLE
0001
SOH
DC1
0010
STX
DC2
0011
ETX
DC3
0100
EDT
DC4
0101
ENQ
NAK
0110
ACK
SYN
0111
BEL
ETB
1000
BS
CAN
1001
HT
EM
1010
LF
SUB
1011
VT
Least significantESC
bit
1100
FF
FS
1101
CR
GS
1110
SO
RS
1111
SI
US

010

011
0
!
1
"
2
#
3
Most significant bit
$
4
%
5
&
6
'
7
(
8
)
9
*
:
+
;
,
<
=
.
>
/
?

100
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O

101
P
Q
R
S
T
U
V
W
X
Y
Z
[

]
^
_

110
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o

111
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL
e.g., ‘a’ = 1100001

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

000
NULL
SOH
STX
ETX
EDT
ENQ
ACK
BEL
BS
HT
LF
VT
FF
CR
SO
SI

001
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
ESC
FS
GS
RS
US

010
!
"
#
$
%
&
'
(
)
*
+
,
.
/

011
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?

100
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O

101
P
Q
R
S
T
U
V
W
X
Y
Z
[

]
^
_

110
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o

111
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL
95 Graphic codes

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

000
NULL
SOH
STX
ETX
EDT
ENQ
ACK
BEL
BS
HT
LF
VT
FF
CR
SO
SI

001
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
ESC
FS
GS
RS
US

010
!
"
#
$
%
&
'
(
)
*
+
,
.
/

011
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?

100
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O

101
P
Q
R
S
T
U
V
W
X
Y
Z
[

]
^
_

110
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o

111
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL
33 Control codes

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

000
NULL
SOH
STX
ETX
EDT
ENQ
ACK
BEL
BS
HT
LF
VT
FF
CR
SO
SI

001
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
ESC
FS
GS
RS
US

010
!
"
#
$
%
&
'
(
)
*
+
,
.
/

011
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?

100
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O

101
P
Q
R
S
T
U
V
W
X
Y
Z
[

]
^
_

110
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o

111
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL
“Hello, world” Example

H
e
l
l
o
,
w
o
r
l
d

=
=
=
=
=
=
=
=
=
=
=
=

Binary
01001000
01100101
01101100
01101100
01101111
00101100
00100000
01110111
01100111
01110010
01101100
01100100

=
=
=
=
=
=
=
=
=
=
=
=

Hexadecimal
48
65
6C
6C
6F
2C
20
77
67
72
6C
64

=
=
=
=
=
=
=
=
=
=
=
=

Decimal
72
101
108
108
111
44
32
119
103
114
108
100
Extended ASCII
• There are an additional 128 characters that
were adopted by IBM for use in their PCs. It’s
popular and is used in applications other than
PCs  unofficial standard.
—The extended ASCII characters are represented by
an 8-bit code series from 80h-FFh
Extended
ASCII Table

http://ascii-table.com/img/table-pc.gif
Error Detection
• Digital Systems are very Reliable
• Errors during storage or transmission
• Parity Bit

—Even Parity
—Odd Parity
Odd Parity Error Detection
•
•
•
•
•
•
•
•

Original data
10011010
With Odd Parity
110011010
1-bit error
110111010
Number of 1s even indicates 1-bit error
2-bit error
110110010
Number of 1s odd no error indicated
3-bit error
100110010
Number of 1s even indicates error
BCD Addition
• Try these:
ex: Add the following numbers
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)

0011+0100
00100011 + 00010101
10000110 + 00010011
010001010000 + 010000010111
1001 + 0100
1001 + 1001
00010110 + 00010101
01100111 + 01010011
references
• http://hyperphysics.phyastr.gsu.edu/hbase/electronic/number3.html

• http://hyperphysics.phyastr.gsu.edu/hbase/electronic/number3.html#c3
• http://autonopedia.org/crafts_and_technology/E
lectronics/DigitalBasics/codes.html

Mais conteúdo relacionado

Mais procurados (10)

Unicode Encoding Forms
Unicode Encoding FormsUnicode Encoding Forms
Unicode Encoding Forms
 
ASCII-EBCDIC-HEX
ASCII-EBCDIC-HEXASCII-EBCDIC-HEX
ASCII-EBCDIC-HEX
 
. computer codes
. computer codes. computer codes
. computer codes
 
UTF-8: The Secret of Character Encoding
UTF-8: The Secret of Character EncodingUTF-8: The Secret of Character Encoding
UTF-8: The Secret of Character Encoding
 
Unicode
UnicodeUnicode
Unicode
 
Digital principles basic
Digital principles basicDigital principles basic
Digital principles basic
 
6.number system
6.number system6.number system
6.number system
 
Chapter 04 computer codes
Chapter 04 computer codesChapter 04 computer codes
Chapter 04 computer codes
 
Sinhala Unicode and Usage
Sinhala Unicode and UsageSinhala Unicode and Usage
Sinhala Unicode and Usage
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 

Destaque

Lecture 2.4 logic_gate_&_simple_logic_circuit
Lecture 2.4 logic_gate_&_simple_logic_circuitLecture 2.4 logic_gate_&_simple_logic_circuit
Lecture 2.4 logic_gate_&_simple_logic_circuit
KMJ Science Computer
 

Destaque (20)

Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
boolean algebra(continued)
boolean algebra(continued)boolean algebra(continued)
boolean algebra(continued)
 
Karnaughmaprev1 130728135103-phpapp01
Karnaughmaprev1 130728135103-phpapp01Karnaughmaprev1 130728135103-phpapp01
Karnaughmaprev1 130728135103-phpapp01
 
Chapter iii: Number System
Chapter iii: Number SystemChapter iii: Number System
Chapter iii: Number System
 
DIGITAL ELECTRONICS- Number System
DIGITAL ELECTRONICS- Number SystemDIGITAL ELECTRONICS- Number System
DIGITAL ELECTRONICS- Number System
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
 
Karnaugh map program Assignment
Karnaugh map program AssignmentKarnaugh map program Assignment
Karnaugh map program Assignment
 
Lecture 2.4 logic_gate_&_simple_logic_circuit
Lecture 2.4 logic_gate_&_simple_logic_circuitLecture 2.4 logic_gate_&_simple_logic_circuit
Lecture 2.4 logic_gate_&_simple_logic_circuit
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
boolean algebra
boolean algebraboolean algebra
boolean algebra
 
Digital Basics
Digital BasicsDigital Basics
Digital Basics
 
Digital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraDigital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebra
 
The Karnaugh Map
The Karnaugh MapThe Karnaugh Map
The Karnaugh Map
 
Chap 3
Chap 3Chap 3
Chap 3
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
kmap
kmapkmap
kmap
 
Karnaugh Mapping Explained
Karnaugh Mapping ExplainedKarnaugh Mapping Explained
Karnaugh Mapping Explained
 
Flip flops, counters &amp; registers
Flip flops, counters &amp; registersFlip flops, counters &amp; registers
Flip flops, counters &amp; registers
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
 
Digital 1 8
Digital 1 8Digital 1 8
Digital 1 8
 

Semelhante a Applied physics iii lecture3 digital_codes

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
Milind Patil
 

Semelhante a Applied physics iii lecture3 digital_codes (20)

Computer-codes.pptx
Computer-codes.pptxComputer-codes.pptx
Computer-codes.pptx
 
Topic 2.3 (1)
Topic 2.3 (1)Topic 2.3 (1)
Topic 2.3 (1)
 
Ch12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdfCh12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdf
 
Octal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversionsOctal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversions
 
Class2
Class2Class2
Class2
 
Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
 
Codes r005
Codes  r005Codes  r005
Codes r005
 
Comprehasive Exam - IT
Comprehasive Exam - ITComprehasive Exam - IT
Comprehasive Exam - IT
 
1.1.2 HEXADECIMAL
1.1.2 HEXADECIMAL1.1.2 HEXADECIMAL
1.1.2 HEXADECIMAL
 
Ascii codes
Ascii codesAscii codes
Ascii codes
 
Lecture_ASCII and Unicode.ppt
Lecture_ASCII and Unicode.pptLecture_ASCII and Unicode.ppt
Lecture_ASCII and Unicode.ppt
 
Encoder-and-decoder.pptx
Encoder-and-decoder.pptxEncoder-and-decoder.pptx
Encoder-and-decoder.pptx
 
Chap 01[1]
Chap 01[1]Chap 01[1]
Chap 01[1]
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
Coa presentation1
Coa presentation1Coa presentation1
Coa presentation1
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Unicode - Hacking The International Character System
Unicode - Hacking The International Character SystemUnicode - Hacking The International Character System
Unicode - Hacking The International Character System
 
Binary codes
Binary codesBinary codes
Binary codes
 
Data Representation in Computers
Data Representation in ComputersData Representation in Computers
Data Representation in Computers
 
This file is intended to be loaded by Logisim (httpwww.cburc.docx
 This file is intended to be loaded by Logisim (httpwww.cburc.docx This file is intended to be loaded by Logisim (httpwww.cburc.docx
This file is intended to be loaded by Logisim (httpwww.cburc.docx
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Último (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 

Applied physics iii lecture3 digital_codes