Uploaded by Stella CompScie

Data Representation Notes

advertisement
Data Representation Notes
What is Data Representation?
What are the numbering system common in Computer Science?
1. Denary Numbering System
2. Binary Numbering System
 Computers don't understand words or numbers the way humans do.
 Modern software allows the end user to ignore this, but at the lowest levels
of your computer, everything is represented by a binary electrical signal
that registers in one of two states: on or off.
 To make sense of complicated data, your computer has to encode it in
binary.
 Every number in your computer is an electrical signal. It made more sense
to only distinguish between an "on" state.
3. Hexadecimal Numbering System
What are the uses of Hexadecimal?
 The hexadecimal numbering system is often used by programmers to simplify
the binary numbering system.
 Since 16 is equivalent to 24, there is a linear relationship between the numbers
2 and 16.
 This means that one hexadecimal digit is equivalent to four (4) binary digits.
 Computers use binary numbering systems while humans use hexadecimal
numbering systems to shorten binary and make it easier to understand.
Thus Hexadecimal are used in the following:
i.
To define locations in memory.
Hexadecimals can characterise every byte as two hexadecimal digits only
compared to eight digits when using binary.
ii.
To define colours on web pages.
Each primary colour – red, green and blue is characterised by two
hexadecimal digits. The format being used is #RRGGBB. RR stands for
red, GG stands for green and BB stands for blue.
iii.
To represent Media Access Control (MAC) addresses.
MAC addresses consist of 12-digit hexadecimal numbers. The format
being used is either MM:MM:MM:SS:SS:SS or MMMM-MMSS-SSSS.
The first 6 digits of the MAC address represent the ID of the adapter
manufacturer while the last 6 digits represent the serial number of the
adapter.
iv.
To display error messages/ memory dump/ debugging.
Hexadecimals are used to define the memory location of the error. This is
useful for programmers in finding and fixing errors.

IP(v6) address; [1 mark]

ASCII // Unicode; [1 mark]

assembly language; [1 mark]

URL; [1 mark]
Advantages of the Hexadecimal System
Here are some advantages of using the hexadecimal system:
i.
It is very concise and by using a base of 16 means that the number of digits
used to signify a given number is usually less than in binary or decimal. It
allows you to store more information using less space.
ii.
It is fast and simple to convert between hexadecimal numbers and binary.
Hexadecimal can be used to write large binary numbers in just a few digits.
iii.
It makes life easier as it allows grouping of binary numbers which makes
it easier to read, write and understand. It is more human-friendly, as
humans are used to grouping together numbers and things for easier
understanding.
iv.
Writing in less digits lowers the possibility of error occurring.
Download