Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
COMPUTER CODES
Q#1:) Define the term byte. What is the difference between a bit and a
byte?
ANS:
ANS:
Q#3) Write BCD code of the following words using binary notations?
ANS:
ANS
(a)COMPUTER: 63 46 44 47 24 23 65 51
(b)VIDEO: 25 71 64 65 46
(c)INPUT: 71 45 47 24 23
(d)OUTPUT: 46 24 23 47 24 23
ANS
BCD was extended from a 6 bit code to an 8 bit code .The added two bits are
used as additional zone bits, expanding the zone to four bits. In BCD 4 bit BCD
coding system can be used to represent only decimal numbers because first four
bits are insufficient to represent the various character .Since EBDCIC is an 8 bit
code It can easily be divided into two four bit groups. Each of these 4 bit groups
can be represented by one hexadecimal digit.
ANS
ASCII-8: It is an 8-bit code that can represent 256 (28) different characters.
Q#7) Why are octal and hexadecimal shortcut notations used. Identify
shortcut notations used for each of the following computer codes?
ANS
The use of octal and hexadecimal number system as shortcut notations for
binary. Since BCD Is 6-bit code it can easily be divided into two 3-bit groups.
Each of these 3-bit groups can be represented by one octal digit. Hence octal
number system is used as shortcut notations for memory dump that use BCD
code for internal representation of characters.
Q#8) Why do we have a packed decimal format. How does it differ from
zone decimal format?
ANS
Q#9) A newly designed computer code uses 9 bits. How many different
characters are possible in this code?
ANS
Q#10) Write EBCDIC code for the following words in both binary and
hexadecimal notations. How many bytes are required to store each of
these words using these coding?
ANS
(a)SUN
Hexadecimal: E2 E4 D5
(B)MOON
Hexadecimal: D4 D6 D6 D5
(c)CAT
Hexadecimal: C3 C1 E3
(D)DOG
Hexadecimal: C4 D6 C7
(a)PROGRAMM: D7 D9 D6 C7 D9 C1 D4 D4
(B)OUTPUT: D6 E4 E3 D7 E4 E3
(C)BYTE: C2 E8 E3 C5
(D)OCTAL: D6 C3 E3 C1 D3
Q#12) Write EBCDIC code for the following words in binary notations.
How many bytes are required to store each of these words using these
coding?
ANS
ANS
(a)1256:F1 F2 F5 C6
(c)-63:F6 C3
(d)-786:F7 F8 C9
ANS
(a)12915: F1 F2 F9 F1 D5
(b)+9876: F9 F8 F7 D6
(c)872: F8 F7 D2
(d)-256 :F2 F5 D6
Q:15)List the similarities and difference between ASCII 7 BIT And ASCII
8 BIT?
ANS
Q#16) Write ASCII-7 and ASCII-8 codes for the following words using
binary and hexadecimal notations. How many bytes are required to
store each of these words in ASCII?
ANS
(a)DRY:
D=1000100=44
R=1010010=52
Y=1011010=5A
ASCII 7=1000100 1010010 1011010 3 BYTES
ASCII 7=11295A
ASCII 8=01000100 01010010 01011010 3 BYTES
ASCII 8=44525A
(b)DAMP
D=1000100=44
A=1000001=41
M=1001101=4D
P=1010000=50
ASCII 7= 1000100 1000001 1001101 1010000 4 BYTES
ASCII 7=89066D0
ASCII 8= 01000100 01000001 01001101 01010000 4 BYTES
ASCII 8=44414D50
(c) WET
W=1010111=57
E=1000101=45
T=1010100=54
ASCII 7=1010111 1000101 1010100 3 BYTES
ASCII 7=15E2D4
ASCII 8=01010111 01000101 01010100 3 BYTES
ASCII 8=574554
(d)TERM
T=1010100=54
E=1000101=45
R=1010010=52
M=1001101=4D
ASCII 7= 10100100 1000101 1010010 1001101 4 BYTES
ASCII 7=1191694D
ASCII 8= 01010100 01000101 01010010 01001101 4 BYTES
ASCII 8=5445524D
ANS
(a):PRINT:
P=1010000
R=1010010
I=1001001
N=1001110
T=1010100
ASCII 7=1010000 1010010 1001001 1001110 1010100 5 BYTES
ASCII 8=01010000 01010010 01001001 01001110 01010100 5 BYTES
(B):RUB:
R=1010010
U=1010101
B=1000010
ASCII 7=1010010 1010101 1000010 3 BYTES
ASCII 8=01010010 01010101 01000010 3 BYTES
(C):TYPE:
T=1010100
Y=1011001
P=1010000
E=1000101
ASCII 7=1010100 1011001 1010000 1000101 4 BYTES
ASCII 8=01010100 01011001 01010000 01000101 4 BYTES
(D):GIVE:
G=1000111
I=1001001
V=1010110
E=1000101
ASCII 7=1000111 1001001 1010110 1000101 4 BYTES
ASCII 8=01000111 01001001 01010110 01000101 4 BYTES
ANS
ANS
Different encoding system developed independently of each other obviously
conflicted with one another. That is two encoding system often used the same
code for two different characters or used different codes for the same character.
Due to this problem whenever data transfer took place between Computer
System or software using different encoding systems the data was at the risk of
corruption .As a result it become difficult to exchange text files internationally.
The Unicode was designed to overcome these problems. It is a universal
character encoding standard used for representation of text for computer
processing.
ANS
Unicode was developed to overcome the problems that are happening with
previous encoding system. The problems are
ANS
It defines codes for character used in all major languages of the world
used for written communication.
It reverses a part of the code space for private use to enable users to
assign codes for their own character and symbol.
ANS
ANS
Collating sequence is ordering of symbols in an encoding standard. It may
vary from one computer system to another depending on the type of data
encoding used by particular computer for an internal representation of
characters.
ANS
245>123>ADD>ABC
Q:25)A computer uses ASCII ,in which order will this sort following
strings?
ANS
(a):BED:C1 C5 C4
(B):512:F5 F1 F6
(C):ADD:C1 C4 C4
(D):2GOOD:F2 C7 D6 D6 C4
(E):BAD:C2 C1 C4
(F):A1B2: C1 F1 C2 F2
ANS