# [#4] – Computer Codes – Questions

Numeric data is not the only form of data handled by a computer. We often require to process alphanumeric data also. An alphanumeric data is a string of symbols, where a symbol may be one of the letters A, B, C ….. Z, or one of the digitals 0, 1, 2 …..9 or a special character, such as + – * / , . ( ) =  etc. An alphabet data consists of only the letters A, B, C …..Z, and blank character. Similarly, numeric data consists of only the digits 0, 1, 2, ….. 9. However, the bits 0 and 1 must represent any data internally. Hence, computers use binary coding schemes to represent data internally.

In binary coding, a group of bits represents every symbol that appears in the data. The group of bits used to represent a symbol is called as byte. To indicate the number of bits in a group, sometimes, a byte is referred to as n-bit byte, where the group contains n bits. However, the term byte, commonly means an 8-byte (a group of 8 bits) because most modern computers use 8 bits to represent a symbol.

Points To Remember:

• Computers use binary coding schemes to represent data internally. In binary coding, a group of bits represents every symbol that appears in the data. The group of bits used to represent a symbol is called a byte. Most modern computers use 8 bits to represent a symbol. Hence, the term byte commonly means a group of 8 bits.
• BCD, EBCDIC, ASCII, and Unicode are the commonly used computer codes for internal data representation.
• BCD (Binary Coded Decimal) is a 6-bit code that can represent 64 different characters.
• EBCDIC (Extended Binary-Coded Decimal Interchange Code) is an 8-bit code that can represent 256 different characters.
• ASCII (American Standard Code for Information Interchange) is one of the most popular and widely supported computer codes. It is of two types – ASCII-7 and ASCII-8. ASCII-7 is a 7-bit code that can represent 128 different characters and ASCII-8 is an 8-bit code that can represent 256 different characters.
• Unicode provides a consistent way of encoding multilingual plain text. It has the capacity to encode as many as a million characters. Unicode has three types of encoding forms – UTF-8, UTF-16, and UTF-32.
• Collating sequence is ordering of symbols in an encoding standard.

List of Questions

1. Define the term ‘byte’. What is the difference between a bit and a byte?
2. Write 4-bit BCD code for following numbers:
2510
12810
6410
102410
3. Write BCD code for following words using binary notation:
BIT
CODE
BYTE
ZERO
4. Write BCD code for following words using octal notation:
COMPUTER
VIDEO
INPUT
OUTPUT
5. Why BCD code was extended to EBCDIC?
6. How many different characters are possible in the following encoding schemes:
BCD
ASCII-7
EBCDIC
ASCII-8
7. Why are octal and hexadecimal shortcut notations used? Identify shortcut notations used for each of the following computer codes:
BCD
ASCII-7
EBCDIC
ASCII-8
8. Why do we have a packed decimal format? How does it differ from a zoned decimal format?
9. A newly designed computer code uses 9 bits. How many different characters are possible in this code?
10. Write EBCDIC code for following words in both binary and hexadecimal notations:
SUN
CAT
MOON
DOG
How many bytes are required to store each of these words using this coding?
11. Write EBCDIC code for following words in hexadecimal notation:
PROGRAM
BYTE
OUTPUT
OCTAL
How many bytes are required to store each of these words using this coding?
12. Write EBCDIC code for following words in binary notation:
ZONE
SKY
BOY
TAPE
How many bytes are required to store each of these words using this coding?
13. Using hexadecimal notation, write the zoned-decimal coding for following numbers:
1256
-63
+439
-786
How many bytes are required for each of these representations?
14. Using hexadecimal notation, write the packed-decimal coding for following numbers:
12915
872
+9876
-256
How many bytes are required for each of these representations?
15. List the similarities and differences between 7-bit and 8-bit ASCII.
16. Write ASCII-7 and ASCII-8 codes for following words using binary and hexadecimal notations:
DRY
DAMP
WET
TERM
How many bytes are required to store each of these words in ASCII?
17. Write ASCII-7 and ASCII codes for following words using binary notation:
PRINT
RUB
TYPE
GIVE
How many bytes are required to store each of these words in ASCII?
18. What is unicode? What motivated its development?
19. Why it was difficult to exchange text files internationally before Unicode was developed? How did Unicode help in overcoming this problem?
20. Why was Unicode developed?
21. List some key features of Unicode.
22. Describe the three encoding forms defined by Unicode standard and the environment for which each of them is most suitable.
23. Explain the meaning of the term “collating sequence”.
24. A computer uses EBCDIC as its internal representation of characters. In which order will this computer sort following strings?
ABC
245
123
25. A computer uses ASCII. In which order will this computer sort following strings?
BED
2good
512