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

DLD Lecture 4

This document discusses digital logic design and binary coding. It covers binary numbers and how they are used to represent coded elements. Binary coded decimal (BCD) assigns a 4-bit code to each decimal digit from 0 to 9. The ASCII code is a 7-bit standard binary code used to represent alphanumeric characters. The document provides examples of encoding names in BCD and decoding ASCII codes.

Uploaded by

speado record
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)
8 views

DLD Lecture 4

This document discusses digital logic design and binary coding. It covers binary numbers and how they are used to represent coded elements. Binary coded decimal (BCD) assigns a 4-bit code to each decimal digit from 0 to 9. The ASCII code is a 7-bit standard binary code used to represent alphanumeric characters. The document provides examples of encoding names in BCD and decoding ASCII codes.

Uploaded by

speado record
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/ 12

Digital Logic Design

Dr. Irfan Yousuf


Department of Computer Science (New Campus)
UET, Lahore
(Lecture # 4; March 02, 2020)
Outline
• Binary Coding
Binary Numbers and Binary Coding

• Bit = Binary Digit = 0, 1


• Given n binary digits (called bits), a binary code is a mapping from a
set of represented elements to a subset of the 2n binary numbers.

• If Bit = 1 then we can have 21 binary numbers, i.e, 0, 1


• If Bit = 2 then we can have 22 binary numbers, i.e, 00, 01, 10, 11
Binary Code
• An n-bit binary code is a group of n bits that assume
up to 2n distinct combinations of 1s and 0s, with
each combination representing one element of the
set being coded.
• The bit combinations of an n-bit code can be
determined from the count in binary from 0 to 2n - 1
• Each element must be assigned a unique binary bit
combination, and no two elements can have the
same value; otherwise, the code assignment is
ambiguous.
How to write binary combinations?
Binary Coded Decimal (BCD)
Binary coded decimal (BCD) is a system of writing
numerals that assigns a four-digit binary code to each
digit 0 through 9 in a decimal (base-10) numeral.
Binary Coded Decimal (BCD)
▪ A BCD number greater than 10 has a representation
different from its equivalent binary number, even
though both contain 1s and 0s.
▪ Moreover, the binary combinations 1010 through
1111 are not used and have no meaning in the BCD
code.
Alphanumeric Code

• Many applications of digital computers require the handling


of data consisting not only of numbers, but also of letters.
• To represent the names and other pertinent information, it is
necessary to formulate a binary code for the letters of the
alphabet.
• Any alphanumeric character set for English is a set of
elements that includes the ten decimal digits, the 26 letters
of the alphabet, and several (more than three) special
characters.
ASCII Code
▪ The standard binary code for the alphanumeric
characters is called ASCII (American Standard Code for
Information Interchange).
▪ It uses seven bits to code 128 characters
ASCII Code Exercise
▪ Use the ASCII code to write your first name in BCD
beginning with an uppercase letter and continuing with
lowercase letters.
ASCII Code Exercise
▪ Decode the following ASCII code.

0111 0001 0001 0001 0001 0001 0001 0001


0001 0000 0000 0111 0111 0001 0001 0001
0001 0001 0100 0001 0001 0000 0001 0000
0101 0001 0001 0000 0001 0000 0011
Summary
• Binary Coding
• Study Reflection Method to write Gray Codes

You might also like