Você está na página 1de 12

1.

11 NUMBER
REPRESENTATION
Project MINT
• Show understanding of the basis
of different number system and
use the binary , denary and
hexadecimal number system
[1] Denary/Decimal:
Denary is the number system that you have most probably grown up with. It is also
another way of saying base 10. This means that there are 10 different numbers that you
can use for each digit, namely:
0,1,2,3,4,5,6,7,8,9
• [2] Binary Numbering System:
-Binary is a base-2 number system, this means that there are two numbers that you can
write for each digit 0 and 1.
-Because of their digital nature, a computer's electronics can easily manipulate numbers
stored in binary by treating 1 as "on" and 0 as "off.“
- Making use of positional weight method to find the binary of a decimal:
Example 1: 1610  Binary?
Converting Base-2 to Base-10
(1 0 0 1 1)

OFF

OFF
ON

ON

ON
Exponent:

Calculation:16 0 0 2 1
+ + + + =

(19)10
4
[3]Hexadecimal:
Hexadecimal is a base-16 number system which means we will have 16 different numbers
to represent our digits. The only problem being that we run out of numbers after 9, and
knowing that 10 is counted as two digits we need to use letters instead:
HEX: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Hexadecimal Binary Denary
Table:
0 0000 0 Example 1: Hex  Bin
1 0001 1 98C316 = 1001 1000 1100 0011 2
2 0010 2
3 0011 3
Example 2: Binary  Hex
4 0100 4 11010011101011 2 = 0011 0100 1110 1011 2
5 0101 5 = 34EB 16
6 0110 6
7 0111 7 Example 3: Hex  Denary
8 1000 8
165 164 163 162 161 160
9 1001 9
1 ,048,576 65536 4096 256 16 1
A 1010 10
0 0 3 4 A F
B 1011 11
C 1100 12 Remember that A = 10, B =11, C = 12, D = 13, E = 14, F = 15.
D 1101 13 -----------------------------------------------------------------------
3*4096 + 4*256 + (A)10*16 + (F)15*1 = 13487 10
E 1110 14
F 1111 15
• Why use hexadecimal when we have
binary and denary?
The answer is that it is entirely for human ease.
EXAMPLE:
Error Representation Base:
EFFE11  base-16 hexadecimal
15728145  base-10 denary
111011111111111000010001  base-2 binary

All the numbers are the same and the easiest version to remember/understand for humans is the base-
16. Hexadecimal is used in computers for representing numbers for human consumption, having uses for things such as memory
addresses and error codes.
NOTE: -Hexadecimal is used as it is shorthand for binary and easier for people to remember and It’s easy to debug/identify error(s).
-It DOES NOT take up less space in computer memory, only on paper or in your head! Computers still have to store
everything as binary whatever it appears as on the screen.
-Positive & Negative Numbers
There are two methods for which a computer can represent a negative number into
its binary, namely:
(1) Sign & Magnitude Method
(2) 2’s Compliment
2’s Compliment is usually used in this case.
How does it work?
• Find the positive binary of the denary: Consider: +87 10 = 0 1 0 1 0 1 1 1 2
• Starting from the right, leave all bits unchanged until the first 1 bit. After that,
change all 0’s to 1’s and all 1’s to 0’s
• Result: -87 = 1 0 1 0 1 0 0 1 2
• Show understanding and be able to represent character data in its
internal binary form depending on the character set used.
[Be expected to memorise any character codes but must be familiar
with ASCII and Unicode.]

Many different types of data have to be stored in a computer including numbers and
character data(Alphatbets, special characters like: ! , * , . )
Values are stored in a computer as a series of 0’s and 1’s.
Each character can store 1 byte of data (8-bits). A computer understand particular
character set.
• What is a Character set?
They are all the symbols recognized by the computer.
It often equates to the symbols on the keyboard.
 How is a character represented
on a computer?
• A character is represented by a set of bits [ It is unique to that character]
• The number of bits needed is equal to 1 byte/2 bytes.
• There are two different character encoding system which can be used to represent
characters: 1) ASCII [ American Standard Code For Information Interchange]
2) Unicode
(1)-ASCII
• It uses 8-bits to store each character. 7-bit represents the data with a single parity
bit added in the MSB to help with error detection. This gives ASCII ability to store a
total of 27 = 128 different characters.
• Many characters in other languages cannot be represented.
• In extended ASCII the characters from 128 to 255 may be coded differently in
different system.
~Example: 0 0 0 0 0 0 0 0
(2)~Unicode:
• Unicode can represent a wider range of characters than ASCII
• It uses 16 , 24 or 32-bits to represent each character. Therefore, It is designed to be
a superset of ASCII.
• If you want to represent different set of characters [ For example: Chinese, French,
Vietnamese . Etc. ] then ASCII is limited. Unicode is used to represent all the
different kind of characters because using 16-bits make it able to represent
216 characters.

Você também pode gostar