Data Representation
Data Representation
DATA REPRESENTATION
Introduction
In the previous topic we learned about Data communication, in that discussion we talked
about the various types of transmission media, and the basic elements of a
communication system. We then finished by talking about networks and classified them
according to their topologies. This topic introduces you to data representation which
refers to the methods used internally to represent information stored in a computer. We
shall also look in depth at the number systems and how one can convert from one number
system to another. The topic has eight sections namely:
Objectives
139
Activity 1
In your own words define data representation
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
Now try and name some number systems you know about
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
Topic Overview
If you are able to answer the questions above, then you have some idea on what data
representation is. It is important however to have an in depth knowledge of the number
systems that the computer system uses to store information. In this topic we will explore
these systems to help you understand.
6.1 Introduction
Computers not only process numbers, letters and special symbols but also complex types
of data such as sound and pictures. However, these complex types of data take a lot of
memory and processor time when coded in binary form. This limitation necessitates the
need to develop better ways of handling long streams of binary digits. Higher number
systems are used in computing to reduce these streams of binary to
140
manageable form. This helps to improve the processing speed and optimize memory
usage. Armed with this introduction let us venture into the number systems used by
computers.
Representing numbers
The storage and processing elements of a computer are two-state (or bi stable) electronic
devices. They are used in computers because they are quick and reliable and take up only
small amounts of space and energy. For this reason, the base two or binary number
system which uses the two digits 0 and 1 (for off and on) is suited to computers. The
binary digits are known as BITS.
141
The magnitude of a number is evaluated using three parameters
Absolute value
Place value or positional value
Base value
The absolute value is magnitude of a digit. For example, the digit 5 in the number 7458
has an absolute value of 5 according to its value in the number line.
The positional/place value of a digit in a number refers to the position of that digit in
that number, that is whether ‘tens’, ‘hundreds’ or ‘thousands’.
The total value of a number is the sum of the place value of each digit making the
number. For example, the total value of the digits in the table above can be worked as
shown N10 = (7*103) + (4*102) + (5*101) + (8*100)
= (7*1000) + (4*100) + (5*10) + (8*1)
= 7000+400+50+8
= 7458
The base number of a number also known as the radix is the type of number system that
is being used. The value of any number depends on the radix.
As we continue let us deal with more examples for better
understanding We count in base (or radix) 10
Tens Units
7
+ 9
6
This simple example illustrates the most important feature of a number system: that the
value of a figure depends on its position or place. For example, the decimal number 267
really means:
267= (2*102) + (6* 101) + (7*100)
142
E.g. 01012 = 0 * 23 +1*22+0*21+1*20
= 0+4+0+1
= 510 (subscript denotes base, i.e. 10)
A decimal number may be represented in a computer by using two state devices 9 such
as semiconductors) to represent its binary equivalent. For example, the decimal number
25 could be.
Device
Position 25 24 23 22 21 20
Value (32) (16)(8)(4)(2)(1)
Code device ‘on’ (1bit)
Device’ off’ (0 bit)
143
2. Octal to
Decimal E.g.1148
Place values 82 81 80
(64) (8) (1)
Octal number 1 1 4
conversion (1*64) +(1*8) +(4*1)=7610
This is fairly straightforward because 8 is the cube of 2; just remember the binary
equivalents for eight octal symbols.
Conversion table
Octal- 0 1 2 3 4 5 6 7
Binary 000 001 010 011 100 101 110 111
There is another numbers system that is important known as the hexadecimal number
system. This is a number system with a radix of 16. It uses sixteen digits ranging from 0
– 9 and the letters A – F, where A is equivalent to 10 and F is equivalent to 15 in
sequence like that. The place value for hexadecimal numbers goes up in factors of
sixteen Digits for base 10 and Base 16.
Base 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
10
144
Base 0 1 2 3 4 5 6 7 8 9 A B C D E F
16
These follows the same pattern used for binary ant octal
(a) Decimal to Hex
Convert 9110 to hex
91/16=5 remainder 11
=B16
5/16=0 remainder 5 Thus;
9110=5B16
(b) Hex to decimal
Convert 6D16 to decimal
Places values 162 161 160
(256) (16) (1)
Hex 0 6 D
Conversion (0*256) +(6*16) +(13*1)
Hex number 5 B
Binary equivalent 0101 1011
Binary to Octal
Binary 001 011 011
Octal 1 3 3
Note
145
The change from 4 bit to 3-bit binary
Convert 11110010102 to hex
First group the bit into 4s from the right and then convert.
Grouped Binary 0011 1100 1010 digits
Hex 333 C A
d)Binary fractions
Examples of binary fractions are shown below
=(0*1/2)+(0*1/4)+0*1/8)+1*1/16) =1/16=0.0625
.0001
When converting a number which has both a whole number part and fractional
part, remember to do the two parts separately.
Activity 2
On your own suggest reasons why we use the octal and hexadecimal number systems
………………………………………………………………………………………………………
……………………………………………………………………………………………………..
Having gone through the number system lets get more involved in data
representation by talking about computer arithmetic
146
6.2 Computer Arithmetic
The arithmetic and logic unit of the central processor in a computer performs all its
arithmetic by addition and shifting rather than having different units for subtraction.
147
6.2.1 Sign and Magnitude Codes
Here one bit represents the sign of the number and the other bit represents the size
(magnitude) of the number. Conventionally 1 is negative and 0 is positive. The sign bit
can be at either end of the binary number.
Example (The sign bit is underlined);
1011=-3
01110=+14
Sign and magnitude fractions have the most significant bits as the sign bits also
Binary subtraction
This has more complicated rules
0-0=0
1-0=1
1-1=0
0-1=0, borrow 1
This could be difficult were it not for simple method of subtracting called
complementation.
148
=1110 001011
The overflow bit must be added to the unit column of the sum to give right answer. This
is known as end –round or wrap –around carry.
Two Complement
Signed number are stored within a micro computer using the twos complement
Using the two complement notation the most significant bit s of each binary number is used
to indicate the sign of the number. Thus with an 8bit system each number as follows
s 6 - - - - - 0
Ms
S=0 positive number and zero
S=1 for negative numbers
For positive numbers the remaining seven digits then indicate the magnitude of the
number for example
S 26 25 24 23 22 21 20 =weighting
0 0 0 1 0 1 0 1
=+21 decimal
0 1 0 0 1 0 1 0
0 1 1 0 0 0 0 1
For negative number the remaining seven digit represent the magnitude of the number
in twos complement form to obtain the two complement of a number the complete binary
number including the sign bit- is first inverted and the resulting binary value incremented
by 1
+21=00010101
Invert
11101010
+1 increment
Therefore +21=11101011
Similarly
+74=01001010
Invert
10110110
+1 increment
Therefore
+74=10110110
Note that after the complement process the most significant bit is automatically a 1. hence
for an 8-bit system the range of possible numbers is +127 and the maximum negative
number is-128
149
It is now possible to add two binary numbers e.g. the addition of two positive number A
&B to produce sum
A=00101011=+43(dec)
] B=00110010=+50(dec)
………………..
Carry in=01000100
Carry out=00100010
A+B=01011101=+39(dec)
Providing negative numbers can be represented in their twos complement format the
addition operation may be performed and the court two complement signed result to be
obtained. This is perhaps best explained by means of an example, the first example illustrate
the addition of a negative and positive number to produce a negative result the second the
addition of a negative & a negative and positive number to produce positive result in the
third the addition of two negatives number to produce a negative result.
A=00101011=+43
B=11001110=-50
___-_________
Carry in =00010100_Cin
Carry out =00001110
_________________
A+B =11111001=-7
________________
A=11010101=-43
B =00110010=+50
_______________
Carry in=11100000
Carry out = 11110000
________________
A + B= 00000111=+7
150
Addition of 2 bit and a carry in bit
bit1 bit2 bit3 SUM carry
out
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
A =11010101=-43
B =11001110=-50
_______________
Carrying =10111000
Carryout=11011100
_______________
A + B =10100011=-93
The decimal equivalent of the negative result can readily but confirmed by performing
the complement process on the binary result.
151
The subtraction of two binary digits and the possible borrow in is therefore shown in the
table above. Bit 2 and the borrow in are first added together and the sum is then
subtracted from bit 1. If this sum is greater than bit1 then a borrow is required. This is
equivalent to two bits in binary system and is in turn added to bit before the subtraction
operation Example
A=00110010=+50
B =00101011=+43
_______________
Borrow in 00011110
Borrow out 00001111
_______________-
A –B= 00000111=+7
_________________
0*0=0
0*1=0
1*0=0
1*1=1
If begin with the most significant bit of the multiplier. We multiply each bit of the
multiplicand one bit at a time and write this result in a line. The result is a partial
product. The process is repeated sequentially until all bits of the multiplier are used. The
partial product is then added to give the final product. Example
110 MULTIPLICAND
* 101 multiplier
_______________________________
110
000 } partial product
110
___________________
11110 products
Each partial product is either an exact duplicate of the multiplicand or a line of 0s
152
a quotient bit 0). Whether a divisor a group of bit depends on whether the divisor is
greater than or equal to dividend.
Since 110 is smaller than the value of the first 3bit of the divided (11), the first quotient bit
is 1. Subtracting 110 from 111 and bringing down the next 1 from the dividend gives 011
which is smaller than 110. We drop 0 and consequently the next quotient bit is 1.
DECIMAL 39 107
153
Decimal 8-4-2-1
Digit BCD Code
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Note that each BCD digit is a weighted code, but multiple coding is not. BCD
representation of number is inefficient as far bit usage is concerned. The reason being that
six patter 1010, 1011,1100,1101,1110 & 1111 are never used i.e. they are redundant; if they
occur then an error has occurred. The advantage of BCD code is that it is easy to convert
to decimal. Another disadvantage is that BCD arithmetic is complex.
8-4-2-1- BCD arithmetic
To add two BCD numbers, we simply add the binary number corresponding to each digit
Example
24=001001000
+13=0000 0011
____________________
37=0011 0111
3 7
A difficult arises when the sum of the two decimal is greater than 9 for in that case one of
the invalid bit patterns is produced.
E.g. 25=00100101
+38=0011 1000
_____________________
63≠010101101
It is also possible that the sum of two 4bit numbers will produce a 5bit number. For
example, 8=1000
+9=1001
____________________
17=10001
5bit, not allowed
154
We recognize in both of these cases that decimal arithmetic required the propagation of a
carry to next higher digit. In the 8-4-2-1 BCD arithmetic, we require to propagate the carry
in, addition we must correct the bit pattern. Thus the rule for BCD addition is as follows
If the sum of two BCD digits is greater than 1001, add 0110 and propagate a carry to the
next most significant sun digit.
The carry is added to the sum bit of the next most significant digit of the sum. The carry
bit is always produced automatically: if the sum bits are 5 bits, the fifth bit is the carry;
otherwise. This bit result when the sum correction is performed. In either case the sum
correction is required. Adding the carry to the next higher order digit may itself produce
a sum greater than 9, requiring that the next correction be repeated.
Example;
a) 25 0010 0101
+17+0000 0111
42 0011 1100 1100>9base 10
+0110 add 6base10
10010
+1
Propagated carry
_________________________________
0100 0010 corrected sum
b) 38 0011 1000
+48 0100 1000
______________________________
86 0111 1000 5bit sum
+1 0110 propagated carry and add 6 base 10
011 0110 corrected sum
155
This code is formed by adding the binary equivalent of decimal three to the pure binary
number. It is referred to as the Xs3 code. It has number of advantages, thus it is easy to
calculate, simple to translate into pure binary, and no number is represented by four 0s.
A feature of the excess three codes is that it is self-complementary.
When the sum of two XS3 number is 9 base 10 or less, the uncorrected sum in the xs3 code
is 3base 10 greater than it should be. This is illustrated below:
Decimal Xs3
3 0110
+3 +0110
________________________________________________
1100
(Uncorrected sum)
The uncorrected Xs3 result is equivalent to 9 base 10 in excess of the correct value. To
compensate for this 3 base 10 is subtracted from the uncorrected sum. When the sum of
the two number is greater than 9 base10, the uncorrected Xs3 sum is 3 base 10 less than
its output to be. To correct the Xs3 result, 3base10 is added to the result as shown below
Decimal Xs3
1011
+9 1100
17 10111
17 + 0011
11010
The simple rule for Xs3 addition is to add 0011 base2 when a carry is generated otherwise
subtract 0011 base 2.
156
The table below gives the fifteen member of the group.
It not possible to carry out arithmetic process in the gray code it must be converted into pure
binary before carrying out mathematical operation on the data. Unit distance code is more
appropriate for position sensing operation. This is because the error can only be one step
(unit) of system e.g. the binary code can cause a large error. Consider a typical transistor
sequence for pure binary coded plate. When change is from 7 base10 to 8 base10
157
Converting Binary to Gray Code
The algorithm any bit is given by gi=bi XOR bi (+1) where is the ith bit and (l+1) is the
next bit (msb).if l=5 then gi=bi XOR bi+1 go =bi XOR bi+1 go =b2 be, gi=bi XOR b2, go=bi
bi.
Convert BCD into Decimal
Take the BCD number and divide it into groups of 4digit each starting from the least
significant bit. If the last group isn’t composed of four digits add 0 to the left, then write
the decimal equivalent.
In case you don’t remember the exact decimal equivalent you may treat the BCD like a
pure gray number of the digit, but this is the only true for the group of four bit not for the
whole number
Converting A Decimal Number into Its Standard BCD
Remember that each decimal digit in BCD represented by four binary bits in BCD, hence
to convert into BCD, write each digit in its equivalent BCD number remembering the
order. For example, 4 5 9
0100 0101 1001
158
When converting a number which has both a whole number part and
Activity 2
On your own suggest reasons why we use the octal and hexadecimal number
systems
……………………………………………………………………………………………………..
……………………………………………………………………………………………………..
Having gone through the number system lets get more involved in data
representation by talking about computer arithmetic
The rules for adding binary numbers are quite simple. There are only four to
remember;
0+0=0
0+1=1
159
1+0=1
1+1=10(0carry 1)
1+1=11(1 carry 1)
0*0=0
0*1=0
1*0=0
1*1=1
Example
101=510 multiplicand
010=210
multiplier
000
101
000
01010 =1010
product
1
Steps
160
Start with the most significant digit (one with the highest place value-on the left) of the
multiplier
The move to the next digit in the multiplier copying the multiplicand row, or entering
0s and then shifting one place to the right
Do this for each digit of the multiplier copying the multiplicand, or entering 0s and
then shifting one place to the right
Binary division
Negative numbers
Sign and magnitude (sm) Ones compliment (1c) Twos compliment (2c)
1011=-3
161
01110=+14
Sign and magnitude fractions have the most significant bits as the sign bits also
Binary subtraction
0-0=0
1-0=1
1-1=0
0-1=0, borrow 1
This could be difficult were it not for simple method of subtracting called
complementation.
One Compliment
The one compliment (1c) of a binary number is found by simplify reversing the same bits
(NOT gates in logic circuit terms). In 1c the bits have the same place values as binary numbers
except that the most significant bits (the left most bits) represents a negative.
162
For example, using six bits
Place -31 16 8 4 2 1
values
-13 1 1 0 0 1 0
Example; 26-15
-31 16 8 4 2 1
Store 15 0 0 1 1 1 1
Reverse bits to 11 0 00 0
Give-15
Store 26 0 1 0 1 0
=1110 001011
The overflow bit must be added to the unit column of the sum to give right
answer. This is known as end –round or wrap –around carry.
163
Two Complement
Signed number are stored within a micro-computer using the twos complement
Using the two complement notation the most significant bit s of each binary number is
used to indicate the sign of the number. Thus with an 8bit system each number as
follows
s 6 - - - - - 0
Ms
For positive numbers the remaining seven digits then indicate the magnitude of the
number for example
S 26 25 24 23
22 21 20
=weighting
0 0 0 1 0 1 0 1
=+21 decimal
0 1 0 0 1 0 1 0
0 1 1 0 0 0 0 1
164
For negative number the remaining seven digit represent the magnitude of the number
in twos complement form to obtain the two complement of a number the complete binary
number including the sign bit- is first inverted and the resulting binary value
incremented by 1
+21=00010101
Invert
11101010
+1 increment
Therefore
+21=11101011
Similarly
+74=01001010
Invert
10110110
+1 increment
Therefore
+74=10110110
Note that after the complement process the most significant bit is automatically a 1, hence
for an 8 bit system the range of possible numbers is +127 and the maximum negative
number is-128.
It is now possible to add two binary numbers e.g. the addition of two positive number A
&B to produce sum
165
A=00101011=+43(dec)
] B=00110010=+50(dec)
A+B=01011101=+39(dec)
Providing negative numbers can be represented in their twos complement format the
addition operation may be performed and the court two complement signed result to be
obtained. This is perhaps best explained by means of an example the first example
illustrates the addition of a negative and positive number to produce a negative result
the second the addition of a negative & a negative and positive number to produce
positive result in the third the addition of two negatives number to produce a negative
result
A=00101011=+43
B=11001110=-50
Carry in =00010100_Cin
A+B =11111001=-7
A=11010101=-43
B =00110010=+50
Carry in=11100000
166
A + B= 00000111=+7
A =11010101=-43
B =11001110=-50
Carrying =10111000
Carryout=11011100
A + B =10100011=-93
The decimal equivalent of the negative result can readily but confirmed by
performing the complement process on the binary result.
A=4
65
167
B=-
173
BORROW=1
00
A-
B=292
When the second digit is less than or equal to the first digit the subtraction can be performed
straight away and no borrow is required *(e.g. 5 minus3). When the second digit is greater
than the first however, (6 minus 7) it is necessary to borrow a digit from the next higher
position. This is called a borrow in and in the decimal system the borrow is equal to ten times
the magnitude of the other digits in that column. The subtraction operation in that column
become (10+6)-7 which is equal to a difference of 9 with a borrow to be carried over to the
next column. This is called a borrow out and in turn must be added to the second digit before
the latter is subtracted from the first digit.
The subtraction of two binary digits and the possible borrow in is therefore shown in the
table above. Bit 2 and the borrow in are first added together and the sum is then
subtracted from bit 1. If this sum is greater than bit1 then a borrow is required. This is
equivalent to two bits in binary system and is in turn added to bit before the subtraction
operation
Example,
A=00110010=+50
B =00101011=+43
Borrow in 00011110
168
Borrow out 00001111
A –B= 00000111=+7
0*0=0
0*1=0
1*0=0
1*1=1
If begin with the most significant bit of the multiplier. We multiply each bit of the
multiplicand one bit at a time and write this result in a line. The result is a partial product.
The process is repeated sequentially until all bits of the multiplier are used. The partial
product is then added to give the final product.
Example
110
MULTIPLIC AND
*
101
multiplier
110
169
0 } partial product
110
11110 products
Example;
Divided 11110 by110
Long division
110 11
11110
-110
110
110
000
Since 110 is smaller than the value of the first 3bit of the divided (11), the first quotient bit is
1. Subtracting 110 from 111 and bringing down the next 1 from the dividend gives 011 which
is smaller than 110. We drop 0 and consequently the next quotient bit is 1
170
6.3 Binary Codes
Digital data is presented, stored and transmitted in groups of binary bits. To convey
information, it’s important to code these bits so that they can also represent numbers,
alphabet and special characters. This codes are referred to as binary codes and can be
grouped into two:
DECIMAL 39 107
8-4-2-1 BCD 0011 1001 0001 0000 0111
Note that each BCD digit is a weighted code, but multiple coding is not. BCD
representation of number is inefficient as far bit usage is concerned. The reason being
that six patter 1010,
171
1011,1100,1101,1110 & 1111 are never used i.e. they are redundant; if they occur then an
error has occurred. The advantage of BCD code is that it is easy to convert to decimal.
Another disadvantage is that BCD arithmetic is complex.
To add two BCD numbers, we simply add the binary number corresponding to each
digit
Example,
24=001001000
+13=0000 0011
37=0011 0111
3 7
A difficult arises when the sum of the two decimal is greater than 9 for in that case
one of the invalid bit patterns is produced.
E.g. 25=00100101
+38=0011 1000
63≠010101101
It is also possible that the sum of two 4bit numbers will produce a 5bit number. For
example
8=1000
+9=1001
____________________
17=10001
172
5bit, not allowed
We recognize in both of these cases that decimal arithmetic required the propagation of
a carry to next higher digit. In the 8-4-2-1 BCD arithmetic, we require to propagate the
carry in, addition we must correct the bit pattern. Thus the rule for BCD addition is as
follows
If the sum of two BCD digits is greater than 1001, add 0110 and propagate a carry to the
next most significant sun digit
The carry is added to the sum bit of the next most significant digit of the sum. The carry
bit is always produced automatically: if the sum bits are 5 bits, the fifth bit is the carry;
otherwise. This bit result when the sum correction is performed. In either case the sum
correction is required. Adding the carry to the next higher order digit may itself produce
a sum greater than 9, requiring that the next correction be repeated.
Example,
a) 25 0010 0101
+17+0000 0111
42 0011 1 1 0 0 1100>9base 10
10010 +1
Propagated carry
_________________________________
173
b) 38 0011 1000
This code is formed by adding the binary equivalent of decimal three to the pure binary
number. It is referred to as the Xs3 code. It has number of advantages, thus it is easy to
calculate, simple to translate into pure binary, and no number is represented by four 0s.
A feature of the excess three codes is that it is self-complementary.
174
Addition in excess-three code
When the sum of two XS3 number is 9 base 10 or less, the uncorrected sum in the xs3
code is
3base 10 greater than it should be. This is illustrated below
Decimal Xs3
3 0110
+3 +0110
________________________________________________
1100
(Uncorrected sum)
The uncorrected Xs3 result is equivalent to 9 base 10 in excess of the correct value. To
compensate for this 3 base 10 is subtracted from the uncorrected sum. When the sum of the
two number is greater than 9 base10, the uncorrected Xs3 sum is 3 base 10 less than its output
to be. To correct the Xs3 result, 3base10 is added to the result as shown below
Decimal Xs3
10
11
+9 1100
17 10111
17 +0011
1101
0
175
The simple rule for Xs3 addition is to add 0011 base2 when a carry is generated
otherwise subtract 0011 base 2.
The first two numbers in the gray code are 0000 and 0001, representing 0 and unity
respectively. The next two numbers are obtained by reflecting the combination, shown
dotted below and adding a’1’ in the next higher digit.
00:00:
00:01
00:11
00:10
176
The table below gives the fifteen member of the group.
It not possible to carry out arithmetic process in the gray code it must be converted into
pure binary before carrying out mathematical operation on the data. Unit distance code
is more appropriate for position sensing operation. This is because the error can only be
one step (unit) of system e.g. the binary code can cause a large error. Consider a typical
transistor sequence for pure binary coded plate. When change is from 7 base10 to 8 base10
177
Hence if it was a position indicated instrument instead of changing from 7 bases 10 to
8base 10 it could have momentary change from 15 base10 a pronounced error. In gray
code only digit change and hence the error can be of only one digit.
The gray code conversion algorithm gives by bi=gibi+I where bi the ith bit. The
conversion proceeds from left (l=n) to the right (l=0) ex. convert 11101100 from gray to
binary
The algorithm any bit is given by gi=bi XOR bi (+1) where is the ith bit and (l+1) is the
next bit (msb).if l=5 then gi=bi XOR bi+1 go =bi XOR bi+1 go =b2 be, gi=bi XOR b2, go=bi
bi
Take the BCD number and divide it into groups of 4digit each starting from the least
significant bit. If the last group isn’t composed of four digits add 0 to the left, then write
the decimal equivalent.
In case you don’t remember the exact decimal equivalent you may treat the BCD like a
pure gray number of the digit, but this is the only true for the group of four bit not for
the whole number
Remember that each decimal digit in BCD represented by four binary bits in BCD, hence to
convert into BCD, write each digit in its equivalent BCD number remembering
the order. For example, 4 5 9
178
6.3.4 Alphanumeric Codes
Digital computers handle both alphabetical and numerical data, hence the need to have
code to represent these characters, numeral and special characters. In order to transmit
a complete text in the English language the letters to be translated could be:
Codes both capital and small letters of the alphabet (52 codes). Codes for digits 0-9(10
codes)
Codes for typewriter instruction (this required for the purposes of electronic type writer
to function properly, they include but not limited to instruction such as carriage return,
linefeed, and space (3 codes).
Code for any other special character such as division, addition, subtraction, (4
multiplication codes).
2n = 74
, n log22=log10 74
From the above it can be seen that if we have to print then we require more than 6 bits.
A range of codes have to been developed for the purpose of text transmission popular
one being the ASCII teleprompter code. It makes use of the seven bits to code the
character and hence the total number of codes is128 an extra bit is added for evenly parity
checking.
However, to take care of the Japanese and Chinese code as be adopted that makes use of
16 bits with ASCII code being a subset of the UNICODE.
179
Summary
In this topic you have learnt about data representation methods and how to represent
the data using various number systems. We have also covered the steps of converting
from one number system to another. We then concluded this topic by practicing in
computer arithmetic.
As we finish this module, let us see how well you have understood topic 6.
Self-Check
c). Convert the following binary numbers to their decimal equivalents (6marks)
d). Convert the following decimal numbers to their binary equivalents (6 marks)
e). Convert the octal numbers 3218 and 14138 to its binary equivalent (6marks)
180
f). Convert the following hexadecimal numbers into their binary equivalent (6marks)
CDFF3116 24716
Scoreboard
Marks Remarks
25–30 Excellent
20–25 Very Good
15–20 Good
10–15 Fair
0- 10 Go through the topic again
Further Reading
Tanen –baum, A.S. (1996). Computer networks. New Delhi: Prentice Hall
Mburu, S., & Chemwa, G. (2010). Computer Studies: Book 3. London: Longhorn
publishers
Learning Outcomes
You have now completed topic six, the learning outcomes are listed below;
Check (√) the column which reflects your understanding of the various concepts about
writing.
181
S/No Learning Outcome Sure Not Sure
1 I can now explain what data
representation is
2. I can discuss the various number systems
for representing data
3. I can carry out conversions of data in various
number systems
7.0 References
Abou-Nasr, M. (Ed), Lessmann, S. (ed), Stahlbock, R. (ed), Weiss, G. M. (ed) (2015). Real
World Data Mining Applications.
Benbya, H. (2015). Exploring the Design and Effects of Internal Knowledge Markets.
Bongiorno, G. (Ed), Rizzo, D. (Ed) and Vaia, G. (Ed) (2016). CIOs and the Digital
Transformation.
Kassel, S. (Ed) and Wu, B. (Ed) (2016). Software Engineering Education Going Agile.
182
Kordha T, E., Sevrani, K. and Gorica, K. (2015). Information Society Developmentthrough
ICT Market Strategies.
Mancini, D. (Ed), Dameri, R. P. (Ed) and Bonollo, E. (Ed) (2016). Agile Software
Development Teams.
Mburu, S., and Chemwa, G. (2010). Computer Studies: Book 4. London: Longhorn
publishers
Shi, Y., Zhang, L., Tian, Y. and Li, X. (2015). Intelligent Knowledge
Strang, K. (Ed) (2015). The Palgrave Handbook of Research Design in Business and
Management.
Tanen –baum, A.S. (1996). Computer Networks. New Delhi: Prentice Hall.
183
Wang, W and Parker, R. C. (2002) Office 2000 for Windows. New York: Microsoft
184