Page 29 - DCAP101_BASIC_COMPUTER_SKILLS
P. 29
Basic Computer Skills
Notes bits, called the byte. Most computers implement groupings of two bytes, 4 bytes, and 8
bytes.
2.1 Data Representations
In order to discuss how data is processed by a computer, we should first understand the form
in which data is stored in its memory.
There are two basic types of data which are stored and processed by computers, namely
character and numbers. Characters include letters and special symbols. For example, computer
may be programmed to read a list of names, sort them in alphabetical order and print the
sorted list. A list of names, such as VINEET, PRADIP, GANESH read by an input unit would
be stored in memory, sorted by the program in alphabetical order and printed the strings
being VINEET, PRADIP and GANESH.
The other type of data is decimal numbers such as 1234, 456 etc. Numbers are processed using
arithmetic operations such add, subtract, multiply and divide. In this case, we assign values
to numbers and the processing results in new values.
The characters and numbers fed to a computer, and the output from the computer, must be
in a form which is usable by people. For this purpose natural language symbols and decimal
digit are appropriate. These constitute the external data representation. On the other hand,
the representation of data inside a computer must match the technology used by the
computer to store and process data. Thus we should first determine the most appropriate
internal representation to internal representation and vice versa.
2.1.1 Binary Number System
Binary number system is like decimal number system, except that the base is 2, instead of 10.
We can use only two symbols or digit (0 and 1) in this number system. Note that the largest
single digit is 1(one less than the base) each position in a binary number represents a power
0
of the base (2). Hence, in this system, the rightmost position, is units (2 ) position, the position
1
2
from the right is 2’s (2 ) position, and proceeding in this way, we have 4’s (2 ) position, 8’s
3
4
(2 ) position, 16’s (2 ) position, and so on. Therefore, decimal equivalent of binary number
10101(written as l010l ) is:
2
2
3
0
1
4
(1 x 2 ) + (O x 2 ) + (1 x 2 ) + (0 x 2 ) + (1 x 2 ) = 16 + 0 + 4 + 0 + 1 = 21
In order to be specific about which system we are referring to, it is a common practice to
indicate the base as a subscript. Hence, we write:,
10101 =21
2 10
The short form of “binary digit” is bit. Hence, a “bit” in computer terminology means either
a 0 or 1.
An n-bit number is a binary number consisting of `n’ bits. Figure 1.3 lists all 3-bit numbers along
with their decimal equivalent. Remember that we have only two digits, 0 and 1, in binary
number system and hence, binary equivalent of decimal number 2 has to be stated as 10 (read
3
as one, zero). Another important point to note is that with 3 bits (positions), only 8(2 ) different
patterns of 0s and 1s are possible, and it may be seen from Figure 1.3 that a 3-bit number can
have one of the 8 values in the range 0 to 7. In fact, any decimal number in the range 0 to
2 n-1 can be represented in binary form as an n-bit number.
22 LOVELY PROFESSIONAL UNIVERSITY