Topic 2 - Subtopic 2.1
Topic 2 - Subtopic 2.1
Basic number
4 5 710
- 2 6 510 L1 = 7 - 5 = 2
1 9 210 L2 = 5 +10 – 6 =9
L3 = 3 – 2 = 1
BINARY NUMBERING SYSTEM
(2 DIGIT)
• Define Binary numbers
• Binary numbers representing number in which only
digits 0 or 1.
• ADDITION BINARY NUMBERS
Basic binary addition rule :
0+0=0
0+1=1
1+0=1
1 + 1 = 10
• Example : 101 + 101 = 1010
1011 + 1011 = ?
Exercise
• Ex 1:
110112 + 100012 = 1011002
• Ex 2:
• 101112 + 1112 = ________
Subtraction
Four conditions in binary subtraction
• 0-0=0
• 0 - 1 = 1 borrow 1
• 1-0=1
• 1-1=0
Exercise
• Ex 1:
10012 – 102 = 1112
• Ex 2:
• 1010112 – 11112 =__________
OCTAL NUMBERING SYSTEM
( 8 DIGIT )
• The octal number system has a base of eight, meaning that it has eight
possible digits: 0,1,2,3,4,5,6 and 7.
• The digit positions in an octal number have weights as follows :
Basic number
• Ex:
Ex:
3 316 2 0 D 316
• + 4 716 + 1 2 B C16
7 A16
Hexadecimal number - Subtraction
Ex: Ex:
4 416 3 2 5 516
- 1 716 - 3 1 8 216
2 D16
FORMULA CONVERTING BETWEEN
NUMBER BASES
a)2 to10 : a x 2n + b x 2n-1 + c x 2n-2 + …….
10 to 2: base 10 divide 2
b) 2 to 8: 001
100
101
1 4 5
8 to 2: 4 5
100 101
c) 2 to 16 : 1110 1001
14 9
16 to 2: 3 A
0011 1010
d) 10 to 8 : base 10 divide 8
8 to10 : a x 8n + b x 8n-1 + c x 8n-2 + …….
e) 10 to 16 : base 10 divide 16
16 to 10 : a x 16n + b x 16n-1 + c x 16n-2 +…..
f) 8 to 16 : either 8 to 10 to 16 or 8 to 2 to 16
16 to 8 : 16 to 2 to 8 or 16 to 10 to 8
Conversions Between Base Number
Binary (2) to Decimal (10) conversions
• Example : 1 1 0 1 12
• 24 + 23 + 22 + 21 + 20 = 16 + 8 + 2 + 1
= 2710
Decimal (10) to Binary (2) conversions
16 20
16 1 4
2010 = 1416
Hexadecimal (16)-to-Binary(2) Conversion
• Like the octal number system, the hexadecimal number system is used
primarily as a “shorthand” method for representing binary numbers.
• It is a relatively simple matter to convert a hex number to binary .
• Each hex digit is converted to its four-bit binary equivalent.
• Ex:
111010012 = __________
00101101001111002 =___________
Binary(2)-to-Hexadecimal(16) Conversion
• The binary number is grouped into groups of four bits, and each
group is converted to its equivalent hex digit.
• Zero are added, as needed to complete a four-bit group.
• Ex:
1012 = 0101
= 516
Summary
Hexadecimal Decimal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
Summary
Hexadecimal Decimal Binary
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
2.1.4 Describe the coding system
8 7 4 (decimal)
9 6
CSA 10093
Exercise :
1.The following message encode in ASCII code. What the meaning of this
code ?
• a) 54 4F 4C 4F 45 47
• b) 48 45 4C 4C 4F
• c) 41 50 41 4B 48 41 42 41 52
How the character sent from the keyboard
to the computer?
• Step 1: The user presses the letter T key on
the keyboard.
• Step 2: An electronic signed the letter T and
sent to system unit.
• Step 3: The signed for letter T is converted to
its ASCII code and stored in memory
for processing.
• Step 4: The binary code for the letter T is
converted to an image on the output
device.