Ch-3 Data Representation1
Ch-3 Data Representation1
Bits can be organized into large units to make them represent more and
meaningful information. This large unit is called a byte and is the basic “unit of
data representation” in a computer system. The commonly used byte contains 8
bits. Since each bit has two states and there are 8 bits in a byte, the total amount of
data that can be represented using a single byte is 2 8 or 256 possible
combinations. Each byte can represent a character (a character is either a letter, a
number or a special symbol such as +,-,?,*, $, etc).
A byte is then used as a unit of measurement in the computer memory, processing
unit, external storage and during communication. If the computer memory is
WORD:
Word refers the number of bits that a computer process at a time or a transmission
media transmits at a time. Although bytes can store or transmit information, the
process can even be faster if more than one byte is processed at once. A
combination of bytes, then form a “word”. A word can contain one, two, three or
four bytes based on the capacity of the computer. Word length is usually given in
bits. We say that a computer is an 8-bit, a 16 bit, a 32 bit or a 64 bit computer to
indicate that the amount of data it can process at a time. The larger the word length
a computer has the more powerful and faster it is.
Nibble: Group of 4 continuous bits
Computers do not use the ten digits of the decimal system for counting and arithmetic.
Their internal structure (mainly the CPU and memory) are made up of millions of tiny
switches that can be either in an ON or OF states. Two digits, 0 and 1, are used to refer
for these two states.
Binary number system is based on the two different digits; 0 and 1. With binary number
system, it is very easier for the hardware to represent the data. Binary number system is
base two number system.
For example: (01100)2 , (10110.011)2 , etc
110 can be expanded as 1 X 22 + 1 X 21 + 0 X 20 and thus this has a decimal value 4 + 2 +
0=6
Remainder
2 25
2 12 1
2 6 0 The Binary equivalent of 25(10) is 11001(2)
2 3 0
1 1
8 314
8 39 2 The octal equivalent of 314(10) is 472(8)
8 4 7
8 0 4
16 5280
16 330 0 The Hexadecimal representation of
16 20 A (10) 5280(10) is 14A0 (16)
1 4
=(110111101)two =(10011001)two
To convert from Hexadecimal to binary convert each hex. Digit to its equivalent 4-bit
binary starting from right.
Example: Convert 23416 to binary Convert 2AC to binary
23416 =0010 0011 0100 2AC16 =0010 1010 1100
= 10001101002 =10101011002
Octal to hexadecimal and vice versa
To convert from Octal to hexadecimal, first we have to convert to binary and the binary
to hexadecimal. To convert from hexadecimal to Octal, first we have to convert to binary
and then the binary to Octal.
Example: Convert 2358 to hexadecimal Convert (1A)16 to Octal
2388=010 011 101 1A=0001 1010
=0000 1001 1101 =000 011 010
=0 9 13 = 0 3 2
=9D16 =328
.25
X 2
0 .50 The Binary equivalent of .25(10) is .01(2)
X 2
1 .00
Group three/four digits together starting from the last digit of the integer part, and if
there is less number of digits add some zeros in the beginning.
Group three/ four digits together starting from the first digit of the fractional part, and
if there is less number of digits add some zeros to the end.
Covert each group of the integer and the fractional part to their equivalent
Octal/hexadecimal and collect the results by adding point (.) to separate the integer part
from the fractional part.
To convert from Octal/hexadecimal to decimal, first convert to binary and –then the
binary to decimal.