0% found this document useful (0 votes)
11 views20 pages

05 - Codes & Displays - 2022-23

The document discusses different types of codes including BCD code, binary coded decimal code, excess-3 code, reflecting code, gray code, and parity codes. It also discusses seven-segment displays and how they can be used to display numbers in decimal form by converting binary coded decimal codes to seven-segment codes using integrated circuits like the 7447 BCD to seven-segment converter.

Uploaded by

Eray Güler
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views20 pages

05 - Codes & Displays - 2022-23

The document discusses different types of codes including BCD code, binary coded decimal code, excess-3 code, reflecting code, gray code, and parity codes. It also discusses seven-segment displays and how they can be used to display numbers in decimal form by converting binary coded decimal codes to seven-segment codes using integrated circuits like the 7447 BCD to seven-segment converter.

Uploaded by

Eray Güler
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

1

LOGIC DESIGN

CODES
DISPLAYS

Doç.Dr. Birim BALCI CBÜ 2022-23 Spring


CODES
2

 Coding is a set of rules whose equivalents are precisely


specified between the two sets.
 With coding , we produce a new set from the elements
of symbol set.
Advantages of Coding,
- provides convenience in arithmetic operations.
- makes it easy to find errors.
- simplifies the correction of errors.
- improves efficiency in memory operations.
- allows us to understand the process of processing information easily.
Types of Codes
4
Some codes are given under 2 categories hierarchically.

ASCII: American Standard Code for Information Interchange


EBCDIC: Extended BCD Interchange Code
BCD Code (Binary Coded Decimal)
5

Each digit in the decimal system is


represented by 4 bits.

 Exp:
Decimal Binary BCD
0 0 0
9 1001 1001
10 1010 0001 0000
141 10001101 0001 0100 0001

 National BCD code


(8421 BCD or NBCD)
6

 BCD (Binary Coded Decimal)

 National BCD codu (8421 BCD or NBCD)

 8421 code

tn : weight 8421

23 22 -2 -1
BCD (Binary Coded Decimal) Addition
7

Remember:
 If sum =< 9
Each digit in the decimal
system is represented by 5 0101 45 0100 0101
4 bits. + 4 + 0100 + 33 + 0011 0011
9 1001 78 0111 1000

 If sum > 9 add 6.


6 0110
+ 7 + 0111
13 1101  Wrong
+ 0110  add 6
10011  OK
Because,
each digit in decimal system represented with 4 bits,
the must be represented with 8 bits. SO,
result is 0001 0011
BCD (Binary Coded Decimal) Subtraction
8

64
- 22  take complement according to base t
42 22 78
and make addition
64  0100 0100
78  + 0111 1000
1101 1100
 9< >9
 + 0110 0110 iki tarafa da 6 ekle.
 1 0100 0010
 ignore result is: 0100 0010
Self Complementing code
9

The code that carries the


complement itself.
(Tümleyenini kendi içinde taşıyan kod)

 XS3 (3 fazlalıklı kod)


 2421
After decimal 4, the complement of
the numbers that complete each other
to 9 is taken.
 6311
10

Example:
Convert 48 given in decimal (base 10) to excess3 code.

Hint: BCD code + (11) = ( … ) excess3


Solution:
(48)10 = ( ? ) excess3

 (48)10 = ( 0100 1000)BCD

0100 1000
+ 0011 0011
(0111 1011)excess3
Reflecting code (Yansımalı Kod)
11

 Only 1 digit is different


between code words that
complement each other to
nine.
(Birbirini 9’a tamamlayan kod sözcükleri arasında
sadece 1 hane farklıdır)

 means the distance between


consecutive code words is 1.
(Distance = 1)
Unit Distance Codes
12

3 bit gray
 4 bit gray

 UDBC
Types of Codes…
13

 Easy way to obtain 3 bit Gray code table


3 bit : 3 inputs (A,B, C)
0, 1,2….7 : cell numbers : decimal equivalent of the code
Types of Codes…
14

 Easy way to obtain 4 bit Gray code table


4 bit : 4 inputs (A, B, C, D )
0, 1,2….15 : cell numbers : decimal equivalent of the code
15

Binary to Gray Code Gray  Binary


Conversion Conversion
 Take the MsD
 Take the MsD (most significand digit)
 Apply cross EXOR to the other
 Apply EXOR to the other bits bits

Binary 10110 Gray 11101

Gray 11101 Binary 10110


Parity Code & Error detecting code
16

It works if there is one bit error.


Bilginin, saklanması ya da transferi sürecinde bozulup bozulmadığını
anlamayı sağlar.

 One additional bit called parity.


 Even parity (number of 1’s (including pariy bit) must be an even number)
 Odd parity (number of 1’s (including pariy bit) must be an odd number)

Dec BCD odd p. BCD even p. BCD


0 0000 10000 00000
1 0001 00001 10001
2 0010 00010 10010
….
9 1001 11001 01001
Parity Code & Error detecting code
17

Application of parity code on line and column basis.


Finds one bit error and makes possible to correct.

Exp: Find and correct the bit error (according to odd parity).
10011  number of 1’s : 3 OK
10111  number of 1’s : 4 X
01000
Error at 10000
intersection.
Take the 10011 number of 1’s: 1 OK
complement to number of 1’s: 4 X
correct !
18
PART B: Displays
19

 LED diplays
 Seven –segment display Seven –segment display
 18-segment display
 5x7 dotmatrix display
Seven –segment display
20

Common anode Comman cathode (generally used)


 all the cathode connections of the
 all the anode connections of the LED LED segments are joined together to
segments are joined together to logic “1”. logic “0” or ground.
 The individual segments are
 The individual segments are illuminated illuminated by application of a
by applying a ground, logic “0” “HIGH”, or logic “1” signal via a
or “LOW” signal via a suitable current limiting current limiting resistor to forward
resistor to the Cathode of the particular segment (a- bias the individual Anode terminals
g). (a-g).

Dec a b c d e f g
0 0 0 0 0 0 0 1 Dec a b c d e f g
9 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0
9 1 1 1 1 0 1 1
BCD-7segment converter (7447)
21

 Used to convert BDC code to 7segment code.

You might also like