Computer Codes (BCD, EBCDIC,ASCI and UNI) Solved MCQs

BCD CODE

1. A group of bits used to represent a symbol is called a ____________
a) byte
b) memory
c) nibble
d) code


Answer: a
Explanation: In binary coding, every symbol that appears in data is represented by a group of bits, which are called bytes. Computer codes use binary coding schemes.

2. BCD uses 6 bits to represent a symbol.
a) True
b) False


Answer: a
Explanation: In a Binary Coded Decimal format, 64 characters i.e. 26 different characters can be represented. It is one of the early computer codes.

3. Which of the following is not a type of computer code?
a) EBCDIC
b) BCD
c) ASCII
d) EDIC


Answer: d
Explanation: There is no coding scheme like EDIC. EBCDIC stands for Extended Binary Coded Decimal Interchange Code. BCD stands for Binary Coded Decimal. ASCII stands for American Standard Code for information interchange.

4. The BCD representation of (34)10 is _______________
a) 6
b) 7
c) 8
d) 5


Answer: b
Explanation: BCD numbers are represented as:
34 = (0011 0100)BCD.
Each digit is individually taken and an equivalent standard 4 bit term is written for the respective digit.

5. Perform BCD addition of (23)BCD + (20)BCD .
a) 00110100
b) 01000011
c) 10011
d) 11100


Answer: b
Explanation: To add any two BCD numbers :
Simply perform the addition : 23+20=43.
Then, write the equivalent BCD number = (0100 0011)BCD.

6. The weights used in Binary coded decimal code are:
a) 4,2,1
b) 8,4,2,1
c) 6,4,2,1
d) 2,1


Answer: b
Explanation: BCD is a weighted code and it uses the weights 8,4,2,1 respectively. It is often called the 8421 code. Since, it uses 4 bits for the representation therefore the weights are assigned as : 23 = 8, 22 = 4, 21 = 2, 20 = 1.

7. Write the decimal equivalent for (110001)BCD.
a) 31
b) 13
c) C1
d) 1C


Answer: a
Explanation: To obtain the decimal equivalent :
We start from the rightmost bit and make groups of 4, then write the decimal equivalent accordingly.
0011 0001 = (31)10.

8. The 9’s complement of 45 is _____________
a) 45
b) 54
c) 64
d) 46


Answer: b
Explanation: The 9’s complement of a number is obtained by subtracting each digit from 9. Here, 99-45=54. Therefore, the 9’s complement is 54.
9. The 10’s complement of 455 is _________
a) 543
b) 544
c) 545
d) 546


Answer: c
Explanation: To obtain the 10’s complement, we first obtain the 9’s complement and then add 1 to it.
999-455=544 (9’s)
544+1=545(10’s).
10. The Excess-3 representation of (0100)BCD is __________
a) 0110
b) 1110
c) 0111
d) 1100


Answer: c
Explanation: The excess-3 code is obtained by adding 3 to the BCD code.
Here, 0100+0011=0111.
Also, 4+3=7.




EBCDIC CODE



1. What does EBCDIC stand for?
a) Extended Binary Converted Decimal Intermediate Code
b) Extended Binary Coded Decimal Intermediate Code
c) Extended Binary Coded Decimal Interchange Code
d) Extended Binary Converted Decimal Interchange Code


Answer: b
Explanation: EBCDIC is the Extended BCD interchange code. It uses 8 bits to represent a symbol. It can represent 256 different characters.

2. In EBCDIC, a maximum of 128 different characters can be represented.
a) True
b) False


Answer: b
Explanation: EBCDIC uses 8 bits for representation. Therefore, 28 i.e., 256 different characters can be represented and not 128. Thus, the above statement is false.

3. The EBCDIC code for the character A is ______________
a) digit : 1100 zone : 0001
b) digit : 1111 zone : 0001
c) digit : 1100 zone : 1010
d) digit : 1111 zone : 1010


Answer: a
Explanation: The character A is represented by the digit 1100 and the zone 0001. The hex representation for the same is C1. Similarly for B it is C2 and so on.

4. The hex representation for F is _______________
a) C6
b) C5
c) D6
d) D1


Answer: a
Explanation: Certain hex representations are :
C1=A
C2=B
C3=D
C4=E
C5=F
C6=G
C7=H
C8=I
C9=J.

5. In EBCDIC, D5 is used to represent ________ character.
a) J
b) N
c) O
d) K


Answer: b
Explanation: D5 is used to represent N in this system. The representations D1 to D9 are used for the characters J to R respectively.

6. Which of the following is not a character of the digit 1110?
a) S
b) Z
c) O
d) X


Answer: c
Explanation: All the alphabets from S to Z have their digit as 1110. Here, O has the digit 1101 and therefore is the incorrect option. Example: S has the digit as 1110 and zone 0010.

7. What is the hexadecimal equivalent of the digit 9?
a) E9
b) F9
c) G9
d) H9


Answer: b
Explanation: For digits in EBCDIC, the hex equivalent starts from F0 to F9.
F0=0
F1=1
F2=2
F3=3 and so on.

8. The characters from 0 to 9 have their common digit as ___________
a) 1111
b) 0000
c) 0001
d) 1000


Answer: a
Explanation: The digits are 1111 in case of numbers. Here, 0.101 gets converted to 1.010 in its 1’s complement format.

9. The EBCDIC is mainly used in ___________
a) Programming
b) Machine Codes
c) Mainframes
d) Super Computers


Answer: c
Explanation: This concept of EBCDIC was invented by IBM. It is mainly used in the IBM mainframe environment. So basically, mainframes use EBCDIC codes.

10. Which of the following character is available in EBCDIC but not in ASCII?
a) cent sign
b) dollar sign
c) comma
d) punctuation


Answer: a
Explanation: The cent sign wasn’t available in ASCII which is the American Standard Code for Information interchange. It was available in EBCDIC though and thus was considered better.





ASCII CODE


1. What does ASCII stand for?
a) American Standard Code for Information Interchange
b) American Scientific Code for Information Interchange
c) American Scientific Code for Interchanging Information
d) American Standard Code for Interchanging Information


Answer: a
Explanation: The ASCII codes are used to represent the bits into symbols and vice versa. ASCII is the American Standard Code which is used to exchange information.

2. The decimal representation for the character ‘!’ in ASCII is ____________
a) 31
b) 32
c) 33
d) 34


Answer: c
Explanation: The decimal representation of a few basic characters are:
33 : !
34 : ”
35: #
36 :$.

3. The two types of ASCII are _____________ and ____________
a) ASCII-4 and ASCII-8
b) ASCII-8 and ASCII-16
c) ASCII-7 and ASCII-8
d) ASCII-4 and ASCII-16


Answer: c
Explanation: The two types of ASCII are ASCII-7 and ASCII-8. ASCII-7 uses 7 bits for the representation of numbers and ASCII-8 uses 8-bits.

4. Any set of digits or alphabets are generally referred as ______________
a) Characters
b) Symbols
c) Bits
d) Bytes


Answer: a
Explanation: We refer to the digits and alphabets generally as characters. A character is generally a unit of information in computers.

5. The first 128 characters are the same in both the types of ASCII i.e. ASCII-7 and ASCII-8.
a) True
b) False


Answer: a
Explanation: There are two types of ASCII codes: ASCII-7 and ASCII-8. ASCII-7 uses 7 bits to represent a number whereas ASCII-8 uses 8-bits to represent a number.

6. The number of characters that can be represented in ASCII-8 are ______________
a) 128
b) 256
c) 32
d) 64


Answer: b
Explanation: ASCII-8 can represent 256 different characters. ASCII-8 uses 8-bits for the representation of numbers i.e. it can represent 28 = 256 different characters.

7. The zone of alphabetic characters from A to O in ASCII is _____________
a) 1000
b) 0100
c) 0010
d) 0001


Answer: b
Explanation: The zone used by ASCII for alphabets is 0100. For e.g. A is represented as 0100(zone)0001(digit). The hex equivalent is 41 for A. The zone used by numbers is 0011.

8. The representation of the number 8 in binary in ASCII-8 format _________
a) 00111000
b) 01001000
c) 1000
d) 00011000


Answer: a
Explanation: The ASCII-8 format will have 8 bits. The zone for the character 8 is 0011 and the digit is 1000. Therefore, its representation is 00111000.

9. Binary Coding for the letter X is ______________
a) 01011000
b) 00111000
c) 10001000
d) 00010100


Answer: a
Explanation: The binary coding for the letter X is 01011000. Here, 0101 is the zone whereas 1000 is the digit. The alphabets from P to Z have the zone 0101.

10. Express the ASCII equivalent of the signed binary number (00110010)2.
a) 2
b) 1
c) A
d) ,


Answer: a
Explanation: The ASCII characters for the remaining options are:
1 : 00110001
A : 01000001
, : 00101100.


UNICODE




1. The numbers used to represent numeric values in EBCDIC are _______
a) zoned
b) unsigned
c) packed
d) eb


Answer: a
Explanation: Zoned numbers represent the numeric values under EBCDIC (Extended Binary Coded Decimal Interchange Code). In zoned format, there is only one digit per byte.

2. Unicode provides a consistent way of encoding multilingual plain text.
a) True
b) False


Answer: a
Explanation: Unicode defines codes for characters used in all major languages of the world.
It is a coding system which supports almost all the languages. It defines special codes for different characters, symbols, diacritics, etc.

3. Which of the following is not a type of numeric value in zoned format?
a) Positive
b) Negative
c) Double
d) Unsigned


Answer: c
Explanation: The zoned format can represent numeric values of type Positive, negative and unsigned numbers. A sign indicator is used in the zone position of the rightmost digit.

4. The sign indicator of unsigned numbers is ____________
a) C
b) D
c) F
d) X


Answer: c
Explanation: A sign indicator is used in the zone position of the rightmost digit. A sign indicator C is used for positive, D for negative and F is used for negative numbers.

5. The EBCDIC value of the number 345 in zoned format is __________
a) F3F4F5
b) E3E4E5
c) F3F4C5
d) F3F4D5


Answer: a
Explanation: F is used for the representation of unsigned numbers therefore, F3F4F5 represents 345. F3F4C5 represents +345 . F3F4D5 represents -345.

6. Which of the following is a valid encoding format?
a) UTF-1
b) UTF-8
c) UTF-A
d) UTF-4


Answer: b
Explanation: The various encoding formats are UTF-8, UTF-16 and UTF-32. UTF stands for Unicode Transformation Format. It is basically an encoding system that supports all languages.

7. _________________ defines the assigned ordering among the characters used by the computer.
a) Unicode
b) Collating Sequence
c) Accumulation
d) Sorting


Answer: b
Explanation: Collating sequence is the term used for ordering among characters. It may vary depending upon the type of code used by a computer.

8. The sorting sequence of the strings A1,23,1A will be ______________
a) 23 > A1 > 1A
b) 23 < 1A > A1
c) A1 > 1A > 23
d) A1 < 1A < 23


Answer: d
Explanation: The sorting order is A1, 1A, 23. Numeric characters are given a greater preference in EBCDIC as compared to the alphabets.

9. The default character coding in HTML-5 is _____________
a) UTF-8
b) UTF-16
c) UTF-4
d) UTF-32


Answer: a
Explanation: HTML5 which is the hypertext markup language generally uses the UTF-8 format as its default encoding. Unicode covers all the characters and symbols in all the different languages.

10. Numbers used in packed decimal format can be used for _____________ operations.
a) logical
b) relational
c) arithmetic
d) bitwise


Answer: c
Explanation: The packed numbers can be used for arithmetic operations. The packed numbers also require the lesser number of bytes as compared to zoned numbers.


DATA TYPES



1. Which of the following is not a data type?
a) Symbolic Data
b) Alphanumeric Data
c) Numeric Data
d) Alphabetic Data


Answer: a
Explanation: Data types are of three basic types: Numeric, Alphabetic and Alphanumeric. Numeric Data consists of only numbers.
Alphabetic Data consists of only letters and a blank character and alphanumeric data consists of symbols.

2. *@Ac# is a type of ________________ data.
a) Symbolic
b) Alphanumeric
c) Alphabetic
d) Numeric


Answer: b
Explanation: Alphanumeric data consists of symbols. Alphanumeric data may be a letter, either in uppercase or lowercase or some special symbols like #,^,*,(, etc.

3. Which of the following is not a valid representation in bits?
a) 8-bit
b) 24-bit
c) 32-bit
d) 64-bit


Answer: b
Explanation: There are no criteria like the 24-bit representation of numbers. Numbers can be written in 8-bit, 16-bit, 32-bit and 64-bit as per the IEEE format.

4. What are the entities whose values can be changed called?
a) Constants
b) Variables
c) Modules
d) Tokens


Answer: b
Explanation: Variables are the data entities whose values can be changed. Constants have a fixed value. Tokens are the words which are easily identified by the compiler.

5. Which of the following is not a basic data type in C language?
a) float
b) int
c) real
d) char


Answer: c
Explanation: There are 5 basic data types in C language: int, char, float, double, void.
Int is for the representation of integers, char is for strings and characters, float and double are for floating point numbers whereas void is a valueless special data type.

6. BOOLEAN is a type of data type which basically gives a tautology or fallacy.
a) True
b) False


Answer: a
Explanation: A Boolean representation is for giving logical values. It returns either true or false. If a result gives a truth value, it is called tautology whereas if it returns a false term, it is referred to as fallacy.

7. What does FORTRAN stands for?
a) Formula Transfer
b) Formula Transformation
c) Formula Translation
d) Format Transformation


Answer: c
Explanation: FORTRAN is a type of computer language. It was developed for solving mathematical and scientific problems. It is very commonly used among the scientific community.

8. The program written by the programmer in high level language is called _____________
a) Object Program
b) Source Program
c) Assembled Program
d) Compiled Program


Answer: b
Explanation: The program written by the programmer is called a source program. The program generated by the compiler after compilation is called an object program. The object program is in machine language.

9. A standardized language used for commercial applications.
a) C
b) Java
c) COBOL
d) FORTRAN


Answer: c
Explanation: COBOL is a language used in business and commercial applications. It stands for Common Business Oriented Language. It is imperative, procedural as well as object oriented language.

10. ______________ define how the locations can be used.
a) Data types
b) Attributes
c) Links
d) Data Objects


Answer: b
Explanation: Attributes can determine how any location can be used. Attributes can be type, name, component, etc. Data objects are the variables and constants in a program.