0% found this document useful (0 votes)
137 views15 pages

Unit 1 Topic-Binary Codes

This document discusses binary codes and digital logic gates. It covers BCD code, Gray code, ASCII character codes, error detecting codes using parity bits, and the basic logic gates used in digital circuits like AND, OR, NOT. Binary addition using BCD code is demonstrated with an example. The graphic symbols and input-output relationships of common logic gates are shown.

Uploaded by

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

Unit 1 Topic-Binary Codes

This document discusses binary codes and digital logic gates. It covers BCD code, Gray code, ASCII character codes, error detecting codes using parity bits, and the basic logic gates used in digital circuits like AND, OR, NOT. Binary addition using BCD code is demonstrated with an example. The graphic symbols and input-output relationships of common logic gates are shown.

Uploaded by

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

Digital Electronics

(KOE-039)

Unit 1-Digital Systems and Binary Numbers


Topic-Binary Codes and Code Conversion

Book Reference: Digital Logic and Computer Design by M. Morris Mano

Digital Logic Design Ch1-1


Content
 Binary Codes

Digital Logic Design Ch1-2


Binary Codes
 BCD Code
 A number with k decimal digits will
require 4k bits in BCD.
 Decimal 396 is represented in BCD
with 12bits as 0011 1001 0110, with
each group of 4 bits representing one
decimal digit.
 A decimal number in BCD is the
same as its equivalent binary number
only when the number is between 0
and 9.
 The binary combinations 1010
through 1111 are not used and have
no meaning in BCD.

Digital Logic Design Ch1-3


Binary Code
 Example:
 Consider decimal 185 and its corresponding value in BCD and binary:

 BCD addition

Digital Logic Design Ch1-4


Binary Code
 Example:
 Consider the addition of 184 + 576 = 760 in BCD:

 Decimal Arithmetic: (+375) + (-240) = +135


Hint 6: using 10’s of BCD

Digital Logic Design Ch1-5


Binary Codes
 Other Decimal Codes

Digital Logic Design Ch1-6


Binary Codes)
 Gray Code
 The advantage is that only bit in the
code group changes in going from
one number to the next.
» Error detection.
» Representation of analog data.
» Low power design.

000 001

010 011
100 101

110 111

1-1 and onto!! Digital Logic Design Ch1-7


Binary Codes
 American Standard Code for Information Interchange (ASCII) Character Code

Digital Logic Design Ch1-8


Binary Codes
 ASCII Character Code

Digital Logic Design Ch1-9


ASCII Character Codes
 American Standard Code for Information Interchange (Refer to
Table 1.7)
 A popular code used to represent information sent as character-
based data.
 It uses 7-bits to represent:
 94 Graphic printing characters.
 34 Non-printing characters.
 Some non-printing characters are used for text format (e.g. BS =
Backspace, CR = carriage return).
 Other non-printing characters are used for record marking and
flow control (e.g. STX and ETX start and end text areas).

Digital Logic Design Ch1-10


ASCII Properties
 ASCII has some interesting properties:
 Digits 0 to 9 span Hexadecimal values 3016 to 3916
 Upper case A-Z span 4116 to 5A16
 Lower case a-z span 6116 to 7A16
» Lower to upper case translation (and vice versa) occurs by flipping bit 6.

Digital Logic Design Ch1-11


Binary Codes
 Error-Detecting Code
 To detect errors in data communication and processing, an eighth bit is
sometimes added to the ASCII character to indicate its parity.
 A parity bit is an extra bit included with a message to make the total
number of 1's either even or odd.
 Example:
 Consider the following two characters and their even and odd parity:

Digital Logic Design Ch1-12


Binary Codes
 Error-Detecting Code
 Redundancy (e.g. extra information), in the form of extra bits, can be
incorporated into binary code words to detect and correct errors.
 A simple form of redundancy is parity, an extra bit appended onto the
code word to make the number of 1’s odd or even. Parity can detect all
single-bit errors and some multiple-bit errors.
 A code word has even parity if the number of 1’s in the code word is even.
 A code word has odd parity if the number of 1’s in the code word is odd.
 Example:

Message A: 100010011 (even parity)


Message B: 10001001 0 (odd parity)

Digital Logic Design Ch1-13


Binary Logic
 Logic gates
 Graphic Symbols and Input-Output Signals for Logic gates:

Fig. 1.4 Symbols for digital logic circuits

Fig. 1.5 Input-Output signals for gates Digital Logic Design Ch1-14
Binary Logic
 Logic gates
 Graphic Symbols and Input-Output Signals for Logic gates:

Fig. 1.6 Gates with multiple inputs

Digital Logic Design Ch1-15

You might also like