0% found this document useful (0 votes)
10 views

01 Week01 IntroductionAndNumberSystem

The document provides information about digital logic design course including: - Grading is based on final exam (40%), midterm (30%), quizzes (20%) and assignments (10%). - No retakes are allowed for quizzes, homework or other assessments. 75% attendance is required to take the final exam. - Textbooks for the course are listed. - Digital logic design refers to designing digital devices using logic gates, processors, memory etc. that process binary values of 0 and 1.

Uploaded by

ugorgeous26
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

01 Week01 IntroductionAndNumberSystem

The document provides information about digital logic design course including: - Grading is based on final exam (40%), midterm (30%), quizzes (20%) and assignments (10%). - No retakes are allowed for quizzes, homework or other assessments. 75% attendance is required to take the final exam. - Textbooks for the course are listed. - Digital logic design refers to designing digital devices using logic gates, processors, memory etc. that process binary values of 0 and 1.

Uploaded by

ugorgeous26
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 58

Digital Logic

Design

Department of Computer Science


UET Lahore
Grading & Evaluation

• Final Exam (40)


• Midterm Exam (30)
• Quizzes (20)
• Assignments etc. (10)

2
Class Policy
• No Re-take of any of the Quiz, HW
or any other assessment
• 75% attendance is required to
appear in Final Exam
Text Books

Digital Design-With an Introduction to the Verilog


HDL by M. Morris Mano & Michael D. Ciletti, 5th
Edition
Digital Fundamentals by Thomas L. Floyd, 11th Edition
What is Digital Logic Design refers to
designing digital devices that use
Digital logic gates, ALU’s, microprocessors,
RAM, ROM to control other circuits.
Logic
Design It is a specific form of logic circuit
that processes the numerical values
0 and 1.
What is
Digital
What is Digital?
ANALOG AND DIGITAL QUANTITIES

 Types of electronic devices or instruments:


 Analog
 Digital
ANALOG AND DIGITAL QUANTITIES

 Combination of analog and digital:

Give 5 examples of digital and analog


devices each from around you.
What is Digital Logic Design refers to
designing digital devices that use
Digital logic gates, ALU’s, microprocessors,
RAM, ROM to control other circuits.
Logic
Design It is a specific form of logic circuit
that processes the numerical values
0 and 1.
Number Systems
Number Systems
Decimal Number System

Binary Number System

Octal Number System

Hexadecimal Number System


Conversion
Decimal to Binary and Binary to Decimal:
We will see two methods for each conversion.
Decimal to Binary:

2 19 10011 2 29 11101
2 91 2 14  1
2 41 2 07  0
2 20 2 03  1
10
11
Conversion
Binary to Decimal:
Convert to Decimal

11101
4 3 2 1 0
1x2 + 1x2 + 1x2 + 0x2 + 1x2

1x16 + 1x8 + 1x4 + 0x2 + 1x1

16 + 8 + 4 + 0 + 1 = 29
( 11101 ) 2 = ( 29 ) 10
Magnitude of a
102=100 101=10 100=1
Decimal Number
Weights

2 6 3 Factors

3x1 =3

6x10 =60 263


2x100 =200
Conversion
Binary to Decimal:
Convert to Decimal

11101
4 3 2 1 0
1x2 + 1x2 + 1x2 + 0x2 + 1x2

1x16 + 1x8 + 1x4 + 0x2 + 1x1

16 + 8 + 4 + 0 + 1 = 29
( 11101 ) 2 = ( 29 ) 10
210=1024 29=512 28=256 27=128 26=64 25=32 24=16 23=8 22=4 21=2 20=1 Weights
b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 bn=0 or 1
Factors
20 1
21 2 In case of binary numbers the Factors are either 0 or 1.
22 4
• If 0, after multiplying with weight, it would become 0.
23 8
24 16 • If 1, after multiplying with weight, it would be equal to weight.
25 32
26 64 22=4 21=2 20=1 Weights
27 128 1 0 1 Factors
2 8
256
1x1 =1
29 512
210 1024
0x2 =0 5 ( 101 )2= ( 5 )10
1x4 =4
Conversion
Binary to Decimal:
Convert to Decimal

11101 11101
4 3 2 1 0
1x2 + 1x2 + 1x2 + 0x2 + 1x2
16 + 8 + 4 + 
2 + 1
1x16 + 1x8 + 1x4 + 0x2 + 1x1 =29
16 + 8 + 4 + 0 + 1 = 29
( 11101 ) 2 = ( 29 ) 10
Conversion
Binary to Decimal:
Convert to Decimal

1110110

64 + 32 + 16 + 
8 +4 +2 +
1

=118

( 1110110 ) 2 = ( 118 ) 10
Conversion
Decimal to Binary:
Convert to binary

Weights
64 32 16 8 4 2 1

0b6 b05 1b4 b13 1b2 0b1 b


2 29 11101
10 Factors

2 14  1
2 07  0
2 03  1
11
Decimal to Binary:
Convert to binary

128 64 32 16 8 4 2 1

b07 1b6 b05 b04 1b3 0b2 b1


1 1b0
Conversion
Decimal to Octal and Octal to Decimal:
Decimal to Octal:
Convert to Octal
Convert to Octal
8 85 125 8 2181 4205
8 10  5
8 272  5
12 8 34  0
42
Conversion
Octal to Decimal:
Convert to Decimal

4205
3 2 1 0
4x8 + 2x8 + 0x8 + 5x8

4x512 + 2x64 + 0x8 + 5x1

2048 + 128 + 0 + 5 = 2181


( 4205 ) 8= ( 2181 ) 10
Conversion Decimal Hex
Decimal to Hex and Hex to Decimal: 0 0
Decimal to Hex: 1 1
2 2
Convert to Hex 3 3
4 4
Convert to Hex 5 5

16 274 6 6

16 17  2 16 8646 7 7

16 540  6 21C6 8 8
11 9 9
16 33  12=C 10 A

21 11 B
112 12 C
13 D
14 E
15 F
Conversion Decimal Hex
Hex to Decimal: 0 0
Convert to Decimal 1 1
2 2
3 3
21C6 4 4
5 5
3 2 1 0
2x16 + 1x16 + Cx16 + 6x16 6 6
7 7
8 8
2x4096 + 1x256 + 12x16 + 6x1 9 9
10 A
8192 + 256 + 192 + 6 = 8646 11 B
12 C

( 21 C 6 ) 16 = ( 8646 ) 10 13
14
D
E
15 F
Conversion
Octal to Binary
1.Octal  Decimal Binary Decimal Octal Binary
2.Directly: Octal Binary 0 0 0 0 0
1 1 0 0 1
Covert 2 2 0 1 0
3 3 0 1 1
4 4 1 0 0
3406 5 5 1 0 1
6 6 1 1 0
7 7 1 1 1
011 100 000 110

011100000110
( 3406 )8 = ( 11100000110 ) 2
Conversion
Binary to Octal
1.Binary  Decimal  Octal Decimal Hex Binary
2.Directly: Binary  Octal 0 0 0 0 0
1 1 0 0 1
Convert to Octal 2 2 0 1 0
3 3 0 1 1
4 4 1 0 0
5 5 1 0 1
6 6 1 1 0
10111011010111 7 7 1 1 1

(010) (111) (011) (010) (111)

2 7 3 2 7 ( 10111011010111 )2=( 27327 )8


Conversion
Hex to Binary
1.Hex  Decimal Binary Decimal Hex Binary
2.Directly: Hex Binary 0 0 0 0 0 0
1 1 0 0 0 1
21C6 2
3
2
3
0
0
0
0
1
1
0
1
4 4 0 1 0 0
5 5 0 1 0 1
0010 0001 1100 0110 6 6 0 1 1 0
7 7 0 1 1 1
8 8 1 0 0 0
9 9 1 0 0 1
10 A 1 0 1 0
0010 0001 1100 0110 11 B 1 0 1 1
12 C 1 1 0 0
13 D 1 1 0 1
( 21 C 6 )16 =( 10 0001 1100 0110 )2 14 E 1 1 1 0
15 F 1 1 1 1
Conversion
Binary to Hex
1.Binary  Decimal  Hex Decimal Hex Binary
2.Directly: Binary  Hex 0 0 0 0 0 0
1 1 0 0 0 1
2 2 0 0 1 0
0110111011010111 3
4
3
4
0
0
0
1
1
0
1
0
5 5 0 1 0 1
6 6 0 1 1 0
(0110) (1110) (1101) (0111) 7 7 0 1 1 1
8 8 1 0 0 0
9 9 1 0 0 1
6 E D 7 10 A 1 0 1 0
11 B 1 0 1 1
12 C 1 1 0 0
13 D 1 1 0 1
14 E 1 1 1 0
( 110111011010111 )2 =( 6 ED 7 )16 15 F 1 1 1 1
Basic Arithmetic Operations
In Octal Number System Octal
Base: 8
0 0 0 0
( 2 ) 8 + ( 3 )8= ( 5 )8 0 0 0 1
0 0 0 2
( 7 ) 8 + ( 1 ) 8 = ( 10 ) 8 0 0 0 3
0 0 0 4
( 5 ) 8+ ( 4 ) 8 = ( 11 ) 8 0 0 0 5
0 0 0 6
0 0 0 7
0 0 1 0
1 0 0 1 1
523 0
0
0
0
1
1
2
3
417 0 0 1 4
0 0 1 5
11 4 2 0 0 1 6
0 0 1 7
Basic Arithmetic Operations
In Octal Number System Octal
Base: 8
0 0 0 0
0 0 0 1
0 0 0 2
( 7 ) 8 − ( 1 ) 8= ( 6 )8 0 0 0 3
0 0 0 4
( 5 ) 8 − ( 4 )8 =( 1 )8 0 0 0 5
0 0 0 6
0 0 0 7
0 0 1 0
1 13 0 0 1 1
523 0
0
0
0
1
1
2
3
417 0 0 1 4
0 0 1 5
104 0 0 1 6
0 0 1 7
Basic Arithmetic Operations
Decimal Hex
In Hex Number System 0 00
1 01
( 2 ) 16 + ( 5 ) 16 = ( 7 ) 16 2
3
02
03
( 8 ) 16 + ( 4 ) 16 = ( C ) 16 4
5
04
05
( B ) 16 + ( 5 ) 16 = ( 10 ) 16 6
7
06
07
8 08
9 09
10 0A
1 11 0B
5B8 12 0C
13 0D
A77 14 0E
10 2 F 15 0F
16 10
17 11
18 12
19 13
Basic Arithmetic Operations
Decimal Hex
In Hex Number System 0 00
1 01
2 02
3 03
( 8 ) 16 − ( 3 ) 16 = ( 5 ) 16 4
5
04
05
( C ) 16 − ( 5 )16 = ( 7 ) 16 6
7
06
07
8 08
9 09
F 10 0A
C 10 12
11 0B
D 0 2 F 12 0C
13 0D
A 7 7 14 0E
C 5 B 8 15 0F
16 10
17 11
18 12
19 13
Basic Arithmetic Operations
In Binary Number System
Decimal Binary
0 0 1 1 1 0 0 0
+0 +1 +0 +1 1 1 0 1
2 1 0
0 1 1 10 +1 3 1 1
11

1 1
11010
11011
110101
Basic Arithmetic Operations
In Binary Number System
10 Decimal Binary
0 1 1 0 0 0 0
-0 -1 -0 -1 1 0 1
2 1 0
0 0 1 1(With 1 Borrow) 3 1 1

10 1
0 0 10 10

1 1 0 0 1
0 1 0 1 0
0 1 1 1 1
Decimal Octal Hex Binary
Base: 10 Base: 8 Base: 16 Base: 2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1
0 0 0 2 0 0 0 2 0 0 0 2 0 0 0 1 0
0 0 0 3 0 0 0 3 0 0 0 3 0 0 0 1 1
0 0 0 4 0 0 0 4 0 0 0 4 0 0 1 0 0
0 0 0 5 0 0 0 5 0 0 0 5 0 0 1 0 1
0 0 0 6 0 0 0 6 0 0 0 6 0 0 1 1 0
0 0 0 7 0 0 0 7 0 0 0 7 0 0 1 1 1
0 0 0 8 0 0 1 0 0 0 0 8 0 1 0 0 0
0 0 0 9 0 0 1 1 0 0 0 9 0 1 0 0 1
0 0 1 0 0 0 1 2 0 0 0 A 0 1 0 1 0
0 0 1 1 0 0 1 3 0 0 0 B 0 1 0 1 1
0 0 1 2 0 0 1 4 0 0 0 C 0 1 1 0 0
0 0 1 3 0 0 1 5 0 0 0 D 0 1 1 0 1
0 0 1 4 0 0 1 6 0 0 0 E 0 1 1 1 0
0 0 1 5 0 0 1 7 0 0 0 F 0 1 1 1 1
0 0 1 6 0 0 2 0 0 0 1 0 1 0 0 0 0
0 0 1 7 0 0 2 1 0 0 1 1 1 0 0 0 1
0 0 1 8 0 0 2 2 0 0 1 2 1 0 0 1 0
0 0 1 9 0 0 2 3 0 0 1 3 1 0 0 1 1
0 0 2 0 0 0 2 4 0 0 1 4 1 0 1 0 0
Decimal Octal Hex Binary
Base: 10 Base: 8 Base: 16 Base: 2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0
For
0 1
the Example0
shown
0 0
below:
1
Note
0
that:
0 0 1 0 0 0 0 1
0 0
•0 The
2
Decimal
0 0
Number:
0 2
• 0The 0Decimal
0 2
Number: 0 0 0 1 0
0 0 0 3 0 0 0 3 0 0 0 3 0 0 0 1 1
0 0 •0 The
4 0 0 0 4 • 0The 0Octal0 4 0 0 1 0 0
Octal Number: Number:
0 0 0 5 0 0 0 5 0 0 0 5 0 0 1 0 1
0 0 •0 The
6 Hex Number:
0 0 0 6 • 0The 0Hex0Number:
6 0 0 1 1 0
0 0 0 7 0 0 0 7 0 0 0 7 0 0 1 1 1
0 0 •0 The
8 Binary Number:
0 0 1 0 • 0The 0Binary
0 Number:
8 0 1 0 0 0
0 0 0 9 0 0 1 1 0 0 0 9 0 1 0 0 1
0 0 1 0 0 0 1 2 0 0 0 A 0 1 0 1 0
0 0 1 1 0 0 1 3 0 0 0 B 0 1 0 1 1
0 0 =1 ==2 0 0 1 4 0 0 0 C 0 1 1 0 0
0 0 1 3 0 0 1 5 0 0 0 D 0 1 1 0 1
0 0 1 4 0 0 1 6 0 0 0 E 0 1 1 1 0
0 0 1 5 0 0 1 7 0 0 0 F 0 1 1 1 1
0 0 1 6 0 0 2 0 0 0 1 0 1 0 0 0 0
0 0 1 7 0 0 2 1 0 0 1 1 1 0 0 0 1
0 0 1 8 0 0 2 2 0 0 1 2 1 0 0 1 0
0 0 1 9 0 0 2 3 0 0 1 3 1 0 0 1 1
0 0 2 0 0 0 2 4 0 0 1 4 1 0 1 0 0
What is meant by Signed
Numbers ?
• So far, we have not considered the sign of the
numbers. So, by default the numbers are
Positive.
• What if we have to save a negative number?
• For example, binary equivalent of 20 (in
decimal) is 10100. So is the binary equivalent
of -20 as -10100?
• How to save negative sign in a Digital Device?
• Basically, there is a concept of Complement
of a number (in any number system) to
represent a negative number and there is no
need for the negative sign.
Complement of a Number
• Complement of a positive number represents
the negative of that number (without the
negative sign).

• Adding a number with its Complement will


result into 0.
Complement of a Number
• In any Number System with base n there are two complements i.e. n-
1th and nth complement. The nth complement represents the Negative of
that (Positive) number.

• n-1th complement of a number is obtained by subtracting each of the


digit of number from n-1. (In case of Decimal number system subtract
each digit from 9)

• nth complement = n-1th complement + 1


Negative Numbers
In Binary Number System
In case of Binary Numbers we have 1’s complement and 2’s complement.

1’s complement: To take 1’s complement of a binary number, simply invert all the bits.
Example:

2’s complement: Adding 1 to 1’s complement gives the 2’s complement.


Example:
Example of 1’s and 2’s Complement
Find 2’s complement of 110010
Direct method of 2’s Complement:
Starting from right side, do not invert the bits until the first 1 is reached and after that invert all
bits…

001110
Find 2’s complement of 1001000

0111000
Signed and Unsigned Numbers
LSB and MSB: Decimal Binary Unsigned Signed
In n-bit number, the right most bit MSB LSB
0 0 0 0 0 0 0
is the LSB and left most is MSB. 1 0 0 0 1 1 1
2 0 0 1 0 2 2
3 0 0 1 1 3 3
Unsigned Notation: 4 0 1 0 0 4 4
All Numbers are positive. 5 0 1 0 1 5 5
6 0 1 1 0 6 6
7 0 1 1 1 7 7
Signed Notation: 8 1 0 0 0 8 -8
Half are Positive and Half are Negative 9 1 0 0 1 9 -7
10 1 0 1 0 10 -6
11 1 0 1 1 11 -5
How to find the –ve number? 12 1 1 0 0 12 -4
13 1 1 0 1 13 -3
14 1 1 1 0 14 -2
15 1 1 1 1 15 -1
Signed and Unsigned Numbers
• MSB=0  Positive Number (with magnitude Decimal Binary Unsigned Signed
same as the Unsigned Notation
MSB LSB
• MSB=1  Negative Number (How to find the 0 0 0 0 0 0 0
value??) 1 0 0 0 1 1 1
• Is 11010 a Positive Number or Negative 2 0 0 1 0 2 2
Number (in Signed Notation)? 3 0 0 1 1 3 3
• What about 011010? 4 0 1 0 0 4 4
• Is not 11010 and 011010 both Same? 5 0 1 0 1 5 5
6 0 1 1 0 6 6
• Firstly, we have to decide (and fix) the size of 7 0 1 1 1 7 7
the number (number of bits), then we can 8 1 0 0 0 8 -8
declare a bit as MSB. 9 1 0 0 1 9 -7
• If we have 5-Bit number, then 11010 has MSB 10 1 0 1 0 10 -6
as 1 and we cannot add a zero on leftmost 11 1 0 1 1 11 -5
position. And the number is a negative 12 1 1 0 0 12 -4
13 1 1 0 1 13 -3
number.
14 1 1 1 0 14 -2
• If we have a 6-Bit number, then 11010 in 6-Bit 15 1 1 1 1 15 -1
is 011010 and it is a Positive Number.
Signed and Unsigned Numbers
• MSB=0  Positive Number (with magnitude Decimal Binary Unsigned Signed
same as the Unsigned Notation
MSB LSB
• MSB=1  Negative Number (How to find the 0 0 0 0 0 0 0
value??) 1 0 0 0 1 1 1
2 0 0 1 0 2 2
3 0 0 1 1 3 3
4 0 1 0 0 4 4
5 0 1 0 1 5 5
6 0 1 1 0 6 6
7 0 1 1 1 7 7
8 1 0 0 0 8 -8
9 1 0 0 1 9 -7
10 1 0 1 0 10 -6
11 1 0 1 1 11 -5
12 1 1 0 0 12 -4
13 1 1 0 1 13 -3
14 1 1 1 0 14 -2
15 1 1 1 1 15 -1
Range of numbers in n-bit Systems
Unsigned Notation: Decimal Binary Unsigned Signed

n-bits : 0
MSB
0 0 0
LSB
0 0 0
• Total 2n different numbers 1
2
0
0
0
0
0
1
1
0
1
2
1
2
• 0 to 2n -1 3
4
0
0
0
1
1
0
1
0
3
4
3
4
5 0 1 0 1 5 5
6 0 1 1 0 6 6
• Represent (40) in 6-Bit Binary Number 7 0 1 1 1 7 7
using Unsigned Notation 8
9
1
1
0
0
0
0
0
1
8
9
-8
-7
10 1 0 1 0 10 -6
11 1 0 1 1 11 -5
12 1 1 0 0 12 -4
• Represent (40) in 5-Bit Binary Number 13 1 1 0 1 13 -3
using Unsigned Notation 14 1 1 1 0 14 -2
15 1 1 1 1 15 -1
Range of numbers in n-bit Systems
Signed Notation: Decimal Binary Unsigned Signed
n-bits : MSB LSB
• 0 0 0 0 0 0 0
Total 2n different numbers
1 0 0 0 1 1 1
• Half +ve and Half –ve 2 0 0 1 0 2 2
• Half is 2n /2 = 2n-1 3 0 0 1 1 3 3
• +ve= 0 to 2n-1 -1 4 0 1 0 0 4 4
5 0 1 0 1 5 5
• -ve = -1 to -2n-1 6 0 1 1 0 6 6
• Represent (-40) in 6-Bit Binary 7 0 1 1 1 7 7
Number using signed Notation 8 1 0 0 0 8 -8
9 1 0 0 1 9 -7
10 1 0 1 0 10 -6
11 1 0 1 1 11 -5
12 1 1 0 0 12 -4
• Represent (-40) in 7-Bit Binary 13 1 1 0 1 13 -3
Number using signed Notation 14 1 1 1 0 14 -2
15 1 1 1 1 15 -1
Does 2’s Complement actually represents a –ve
number? Decimal Binary Unsigned Signed

In Decimal Numbers: 0
MSB
0 0 0
LSB
0 0 0
1 0 0 0 1 1 1
2 0 0 1 0 2 2
3 0 0 1 1 3 3
4 0 1 0 0 4 4
In Binary Numners: 5
6
0
0
1
1
0
1
1
0
5
6
5
6
7 0 1 1 1 7 7
8 1 0 0 0 8 -8
9 1 0 0 1 9 -7
10 1 0 1 0 10 -6
11 1 0 1 1 11 -5
0110 12 1 1 0 0 12 -4
13 1 1 0 1 13 -3
1100 14 1 1 1 0 14 -2
15 1 1 1 1 15 -1
10010
How does a computer know to treat a number as
Signed or Unsigned?
Decimal Binary Unsigned Signed
Unsigned Signed MSB LSB
0 0 0 0 0 0 0
1010 10 -6 1 0 0 0 1 1 1
2 0 0 1 0 2 2
+ 0010 2 2 3 0 0 1 1 3 3
4 0 1 0 0 4 4
5 0 1 0 1 5 5
1100 12 -4 6 0 1 1 0 6 6
7 0 1 1 1 7 7
8 1 0 0 0 8 -8
9 1 0 0 1 9 -7
10 1 0 1 0 10 -6
11 1 0 1 1 11 -5
12 1 1 0 0 12 -4
13 1 1 0 1 13 -3
14 1 1 1 0 14 -2
15 1 1 1 1 15 -1
BCD (Binary Coded Decimal) Numbers
HEX Binary Decimal BCD
Hex to Binary
00 00000 0 0 0 0 0 0
21C6 01 00001 1 0 0 0 0 1
02 00010 2 0 0 0 1 0
03 00011 3 0 0 0 1 1
0010 0001 1100 0110 (0010 0001 1100 0110)2 04 00100 4 0 0 1 0 0
05 00101 5 0 0 1 0 1
06 00110 6 0 0 1 1 0
07 00111 7 0 0 1 1 1
Decimal to BCD 08 01000 8 0 1 0 0 0
3974 09
0A
01001 9
0 1 0 1 0 10
0
1
1 0 0
0 0 0
1
0
0B 0 1 0 1 1 11 1 0 0 0 1
0011 1001 0111 0100 (0011 1001 0111 0100)BCD 0C 0 1 1 0 0 12 1 0 0 1 0
0D 0 1 1 0 1 13 1 0 0 1 1
0E 0 1 1 1 0 14 1 0 1 0 0
0F 0 1 1 1 1 15 1 0 1 0 1
10 1 0 0 0 0 16 1 0 1 1 0
11 1 0 0 0 1 17 1 0 1 1 1
12 1 0 0 1 0 18 1 1 0 0 0
13 1 0 0 1 1 19 1 1 0 0 1
14 1 0 1 0 0 20 1 0 0 0 0
BCD (Binary Coded Decimal) Numbers
Decimal Binary Decimal BCD
BCD to Decimal: 00 00000 0 0 0 0 0 0
01 00001 1 0 0 0 0 1
0100 0110 1000 0101 02 00010 2 0 0 0 1 0
03 00011 3 0 0 0 1 1
04 00100 4 0 0 1 0 0
05 00101 5 0 0 1 0 1
06 00110 6 0 0 1 1 0
07 00111 7 0 0 1 1 1
08 01000 8 0 1 0 0 0
09 01001 9 0 1 0 0 1
0110 1100 1001 NOT a Valid BCD Number 10 0 1 0 1 0 10 1 0 0 0 0
11 0 1 0 1 1 11 1 0 0 0 1
12 0 1 1 0 0 12 1 0 0 1 0
13 0 1 1 0 1 13 1 0 0 1 1
14 0 1 1 1 0 14 1 0 1 0 0
15 0 1 1 1 1 15 1 0 1 0 1
16 1 0 0 0 0 16 1 0 1 1 0
17 1 0 0 0 1 17 1 0 1 1 1
18 1 0 0 1 0 18 1 1 0 0 0
19 1 0 0 1 1 19 1 1 0 0 1
20 1 0 1 0 0 20 1 0 0 0 0
BCD (Binary Coded Decimal) Numbers
Decimal Binary Decimal BCD
BCD Calculation
00 00000 0 0 0 0 0 0
01 00001 1 0 0 0 0 1
0111 0101 0101 0101 0010 552 02 00010 2 0 0 0 1 0
+0001 0010 +0001 0110 0011 163 03 00011 3 0 0 0 1 1
04 00100 4 0 0 1 0 0
1000 0111 0110 1011 0101 715 05 00101 5 0 0 1 0 1
+ 0110 06 00110 6 0 0 1 1 0
07 00111 7 0 0 1 1 1
0111 0001 0101 08 01000 8 0 1 0 0 0
09 01001 9 0 1 0 0 1
10 0 1 0 1 0 10 1 0 0 0 0
11 0 1 0 1 1 11 1 0 0 0 1
0110 0100 0011 643 12 0 1 1 0 0 12 1 0 0 1 0
-0100 1001 0010 492 13 0 1 1 0 1 13 1 0 0 1 1
14 0 1 1 1 0 14 1 0 1 0 0
0001 1011 0001 151 15 0 1 1 1 1 15 1 0 1 0 1
-0110 16 1 0 0 0 0 16 1 0 1 1 0
17 1 0 0 0 1 17 1 0 1 1 1
0001 0101 0001 18 1 0 0 1 0 18 1 1 0 0 0
19 1 0 0 1 1 19 1 1 0 0 1
20 1 0 1 0 0 20 1 0 0 0 0
Other Decimal
Codes
Gray Code
ASCII Codes
A parity bit is an extra bit included with
Error‐Detecting
a message to make the total number of
Code (Parity Bit) 1’s either even or odd.

You might also like