0% found this document useful (0 votes)
2 views16 pages

DLD Lecture 09 and 10

The document discusses the classification of binary codes, including weighted codes, non-weighted codes, alphanumeric codes, and error detecting codes. It explains character sets, focusing on ASCII and EBCDIC, detailing how these character sets convert alphanumeric characters to binary code for computer processing. Additionally, it covers the conversion of string characters to ASCII code and the implications for file sizes based on character count.

Uploaded by

Ali Asghar
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)
2 views16 pages

DLD Lecture 09 and 10

The document discusses the classification of binary codes, including weighted codes, non-weighted codes, alphanumeric codes, and error detecting codes. It explains character sets, focusing on ASCII and EBCDIC, detailing how these character sets convert alphanumeric characters to binary code for computer processing. Additionally, it covers the conversion of string characters to ASCII code and the implications for file sizes based on character count.

Uploaded by

Ali Asghar
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/ 16

Quaid-e-Awam University of Engineering,

Science and Technology

BSIT
Digital Logic Designs (DLD)
Lecture 9 and 10

Department of Information Technology 1


Classification of binary codes
The codes are broadly categorized into following
four categories.
• Weighted Codes
• BCD (8421) Done
• 6311
• 2421
• 642-3
• 84-2-1
• Non-Weighted Codes
• Excess-3 Codes
• Gray Codes
• Alphanumeric Codes
• ASCII Today
• EBCDIC
• Error Detecting Codes (Parity)
2
Alphanumeric Codes /
Characters
Alphanumeric characters are used to make words
and strings. They include uppercase and lowercase
letters, the digits 0-9, and symbols such as ? + and £.

Computers are unable to process these characters


directly as they only process binary code. So they
need a way of converting these characters to binary
code and vice versa. They can do this using character
sets.
Character sets are collections of characters that a
computer recognises from their binary
representation.
Alphanumeric Codes /
Characters
As well as the alphanumeric characters mentioned
above, character sets also contain special characters
which do certain commands (e.g. space, delete,
enter).
So when you press a button on your keyboard it
sends a binary signal to the computer telling it which
key you pressed. The computer then uses the
character set to translate the binary code into a
particular character.
What is a character set?
A character set is a defined list of characters recognised by the
computer hardware and software.
Alphanumeric Codes /
Characters
ASCII is the most commonly-used character set in the
English-speaking world. Each ASCII character is given
a 7-bit binary code – this means that it can represent
a total of 128 different characters, including all the
letters in the English alphabet, numbers, symbols and
commands.
An extra bit (0) is added to the start of the binary
code for each ASCII character. This means that each
ASCII character fits nicely into 1 byte (8 bits).
Alphanumeric Codes /
Characters
Extended ASCII is a character set which gives each
character an 8-bit binary code, allowing for 256
characters to be represented. The first 128
characters are in exactly the same order as the ASCII
characters.

Extended ASCII is particularly useful for many


European languages like French and German which
include accents on some of the vowels, like á, Ô, and
Ü.
ASCII
• ASCII code represents alphanumeric data in most computers.

• Stands for: “American Standard Code for Information Interchange”

• It works like any other code. One thing represents another.

• In ASCII, binary is used to represent our numbers, letters and


symbols.

• ASCII includes definitions for 128 characters:


• 33 are non-printing control characters (many now obsolete) that
affect how text and space is processed and 95 printable characters,
including space.
ASCII: Groupings
The ASCII codes are grouped as follows:

0 - 32 Control codes (non-printing)


33 - 47 Printable symbols such as ! / \ &
48 - 57 The digits 0-9
58 - 64 Printable symbols such as < > =
65 - 90 Upper case characters A to Z
91 - 96 Printable characters including [ ]
97 - 122 Lower case characters a to z
123 - 127 Printable characters including { }
Non-printable
ASCII control codes
Converting string
characters to ASCII code
To a computer, a character in a string is just a
number; a number representing one of the
characters in the ASCII code. An algorithm might
need to find the ASCII code for a character. All
programming languages have commands for this.
Converting string
characters to ASCII code
CHR() to return a character from a number.
ASC() to return a number from a character.

Therefore:
myString = CHR (67)
Print (myString)
Would return the letter upper case C as 67 is the ASCII code that letter.

Entering:
ASC (‘D’)
Would return the number 68 as that is its number in the ASCII code.
Size of ASCII files
Because on byte is used for each character, the size of a
plain text file in bytes should be equal to the number of
characters.

Example:

The file consist of 59 characters, including spaces, and so


the size of the file should be 59 bytes.
EBCDIC
EBCDIC
Extended binary coded decimal interchange code
(EBCDIC) is an 8-bit binary code for numeric and
alphanumeric characters. It was developed and
used by IBM. It is a coding representation in which
symbols, letters and numbers are presented in
binary language.
EBCDIC
EBCDIC is an 8-bit character encoding widely used in
IBM midrange and mainframe computers. This
encoding was developed in 1963 and 1964.

EBCDIC was developed to enhance the existing


capabilities of binary-coded decimal code. This code
is used in text files of S/390 servers and OS/390
operating systems of IBM.
Thanks

16

You might also like