data representation notes final
data representation notes final
Data refers to the symbols that represent people, events, things, and ideas. Data can be a
name, a number, the colours in a photograph, or the notes in a musical composition.
Data and instructions cannot be entered and processed directly into computers using human
language. Any type of data must first be converted into machine-readable form, that is binary
form. Due to this reason, it is important to understand how a computer together with its
peripheral devices handles data in its electronic circuits, on magnetic media and in optical
devices.
Data representation refers to the methods and formats used to store and encode information in
a computer system.
Computers use binary, the digits 0 and 1, to store data. A binary digit, or bit, is the smallest
unit of data in computing.
Representing (or encoding) a number means to express it in binary form. Representing
numbers in a computer is necessary in order for it to be able to store and manipulate them. To
process real-world data in the computer, we need a way to represent the data in switches.
Computers do this representation using a binary coding system.
Binary digits are the foundation of all data representation in computers. apart from the binary
system, there are several commonly used methods for data representation:
1. Integer Representation
2. Floating-Point Representation
3. Character Representation
4. String Representation
5. Image Representation
6. Audio Representation
7. Video Representation
Data representation is crucial for computers to understand and process information in various
forms. Different data types and representations have different storage requirements, precision,
and computational properties, and understanding these representations is essential for
effective programming and data manipulation.
DATA TYPES AND REPRESENTATION
A data type is an attribute associated with a piece of data that tells a computer system how to
interpret its value. Understanding data types ensures that data is collected in the preferred
format and the value of each property is as expected.
For example, knowing the data type for “Kwaku, Appiah” will help a computer know:
whether the data is referring to someone’s full name (“Kwaku Appiah”) or a list of two names
(“Kwaku” and “Appiah”)
Understanding data types will help you ensure that: the data you collect is always in the right
format (“Kwaku, Appiah” vs. “Kwaku Appiah”) and the value is expected.
Common data types
Bit b 1 or 0
Nibble - 4 bits
Byte B 8 bits
‘A’ is assigned by the denary number 65 (binary 1000001, hexadecimal 41), ‘B’ by 66 (binary
1000010, hexadecimal 42) and so on up to ‘Z’, which is represented by the denary number 90
(binary 1011010, hexadecimal 5A). Similarly, lower-case letters start at denary 97 (binary
1100001, hexadecimal 61) and end at denary 122 (binary 1111010, hexadecimal 7A).
When data is stored or transmitted, code number is used, not the character itself.
Extended ASCII
Extended ASCII uses eight bits, giving a character set of 256 characters. This allows for
special characters such as those with accents in languages such as French and Spanish.
Unicode
While suitable for representing English characters, 256 characters is far too small to hold
every character in other languages, such as Chinese or Arabic. Unicode uses 16 bits, giving a
range of 65,536 characters. It is more suitable for languages with a large number of
characters, but it requires more memory.
Coding Information using a Bit Pattern
With the knowledge on encoding schemes, we can now code using a bit pattern.
Bit patterns can consist of any number of bits. Digital computers, however, are designed to
think of bits as coming in fixed length groups. The fundamental number of bits in a group
varies from computer to computer. There have been computers built using at least the
following numbers of bits in their basic group, which is usually called a word 4, 8, 12, 16, 24,
36, 39, 40, 48, 64
Most current computers come in either 8-bit, 16-bit, or 32-bit lengths. The major exceptions
are some very tiny computers used in, for example, thermostats or toasters, which only have a
4-bit word. Such a small bit pattern, only half of a byte, is often called a nibble.
Using the encoding schemes discussed above, you will note that every character or text has
been assigned a unique bit pattern. The text is then represented as a long string of bits in
which the successive patterns represent the successive symbols in the original script
For example, the word "Computer" would be represented as:
1000011 1101111 1101101 1110000 1110101 1110100 1100101 1110010
Question
What would this message say?
1001000 1100101 1101100 1101100 1101111 0100001
NUMBER SYSTEMS AND THEIR REPRESENTATION
Computers do 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 digits into manageable form. Computer
architecture supports the following number systems so we need to study them and also need
to know the conversion technique between them. Binary number system, octal number
system, Decimal number system, Hexadecimal (Hex) number system
Binary Number System
A Binary number system has only two digits that are 0 and 1. Every number (value)
represents
with 0 and 1 in this number system. The base of binary number system is 2, because it has
only two digits.
Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents
with 0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because
it has only 8 digits.
Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents
with 0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10,
because it has only 10 digits
A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F.
Every number (value) represents with 0,1,2,3,4,5,6, 7, 8, 9, A, B, C, D, E and F in this
number system. The base of hexadecimal number system is 16, because it has 16
alphanumeric values. Here A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
Note:
Write your own notes on how to convert from one base to the other by referring to your
classroom practice.