Lect3 17 3 2022
Lect3 17 3 2022
Intelligence
Year: First Year
Course. Information Technology
system 2
Semester: 2nd Term
Academic Year: 2021/2022
Lecture No.: 3
Instructor: Dr. Nermeen Kamel
NUMBER SYSTEM
4000
300
50
+ 6
435610
Decimal Numbers
Weight origin 103 102 101 100
Weights 1000 100 10 1
Number MSD 6 3 6 4 LSD
6000
300
60
+ 4
636410
Binary Numbers base-2 system
Binary stands for 2
Binary is the base 2 number system
It has two unique symbols
0 and 1
The largest symbol in Binary is the base – 1
2–1=1
1 is the largest symbol in the Binary Number system
Binary Numbers
Weight origin 23 22 21 20
Weights 8 4 2 1
Number 1 0 1 12
8
0
2
+1
1110
Counting in Binary
Weight 8 4 2 1 decimal
0 0 0 0 0
0 0 0 1 1
0 0 1 0 2
0 0 1 1 3
0 1 0 0 4
0 1 0 1 5
0 1 1 0 6
0 1 1 1 7
1 0 0 0 8
1 0 0 1 9
1 0 1 0 10
1 0 1 1 11
1 1 0 0 12
1 1 0 1 13
1 1 1 0 14
1 1 1 1 15
Octal Number System base-8 system
Octal stands for Eight
Octal is the base 8 Number System
It has 8 unique symbols
01234567
The largest symbol is the base – 1
8–1=7
7 is the largest symbol in the Octal number system
The octal system is a positional value system, wherein each
octal digit has its own value expressed as a power of 8.
Octal Number System base-16 system
Weight origin 83 8 2 8 1 8 0
Weights 512 64 8 1
Number 2 1 6 78
1024
64
48
+ 7
114310
Hexadecimal Number System base-16
system
Hex = 6 and Decimal = 10 6+10 = 16
Hex is the base 16 Number System
It has 16 symbols
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
It must have 16 UNIQUE Symbols
0123456789 A B C D E F
The largest symbol is 16 – 1 = 15 or F
Hexadecimal Number System
Weight origin 163 162 161 160
Weights 4096 256 16 1
Number 1 2 A F 16
4096
512
160
+ 15
478310
NUMBER CONVERSIONS
Decimal To Binary
To converting decimal to Binary we use Repeated division
method. In this the no. is successively divide by 2 and its
remainder recorded.
For Example convert decimal to Binary 43 10
2 43
2 21 1 WRITE IN
2 10 1 THIS ORDER
2 5 0 From Down to Up
2 2 1
2 1 0
1 1 Your Answer 4310 = 101011
2
Decimal (Integer) to Binary Conversion
Example: (15)10
Quotient Remainder Coefficient
15/ 2 = 7 1 a0 = 1
7 /2= 3 1 a1 = 1
3 /2= 1 1 a2 = 1
1 /2= 0 1 a3 = 1
Answer: (15)10 = (a3 a2 a1 a0)2 = (1111)2
MSB LSB
CONVERSIONS WITH BINARY
Decimal Fraction To Binary
• To Convert a decimal fraction into binary, multiply the
decimal fraction by the base that’s 2. Do untill you will
get zero at fractional part.
• For Example Convert 0.37510 to Binary Integer Part
Example: (0.625)10
Integer Fraction Coefficient
0.625 * 2 = 1 . 25 a-1 = 1
0.25 * 2 = 0 . 5 a-2 = 0
0.5 *2= 1 . 0 a-3 = 1
Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2
MSB LSB
CONVERSIONS WITH BINARY
Binary To Decimal
• To convert Binary to Decimal, Add positional weights or values with
power of 2 start from right side.
• For Example Convert 11011 to Decimal.
1 1 0 1 1
24 23 22 21 20
1 * 24 + 1 * 2 3 + 0 * 2 2 + 1 * 2 1 + 1 * 2 0
= 16 + 8 + 0 + 2 + 1
= 2710 (decimal)
CONVERSIONS WITH BINARY
Binary Fraction To Decimal
• To find binary fraction, take the sum of products of each digit value (0
– 1) and its positional value. Starts from left side.
• For Example convert 0.0101 to Decimal.
. 0 1 0 1
8 266 2 WRITE IN
8 33 1 THIS ORDER
8 4 4 From Down to Up
0
26610 = 4128
Decimal to Octal Conversion
Example: (173)10
Quotient Remainder Coefficient
173 / 8 = 21 5 a0 = 5
21 / 8 = 2 5 a1 = 5
2 /8= 0 2 a2 = 2
Answer: (175)10 = (a2 a1 a0)8 = (255)8
Example: (0.3125)10
Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 a-1 = 2
0.5 *8= 4 . 0 a-2 = 4
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8
CONVERSIONS WITH
OCTAL
Decimal Fraction To Octal
• To convert Decimal fraction into Octal, multiply fractional part with 8
till you get fractional part 0.
• Example : convert 0.37510 to Octal
Integer Part
Write
0.375 * 8 = 3.0 3 From
Up to
Down
0.37510 = 0.38
CONVERSIONS WITH OCTAL
Octal To Decimal
• It can easily converted into decimal by multiplying each octal digit by its
positional weight.
• For Example 3728 to Decimal
3 7 2
82 81 80
3 * 82 + 7 * 8 1 + 2 * 8 0
= 3 * 64 + 7 * 8 + 2 * 1
= 25010
CONVERSIONS WITH
Octal To Binary
OCTAL
• To convert Octal To Binary is easy. This converting is performed by
converting each octal digit to its 3 bit binary. Possible digits converted
as indicated in Table
Octal 0 1 2 3 4 5 6 7
Digit
Binary 000 001 010 011 100 101 110 111
( 1 1 0 0 1 . 1 1 )2 4 100
5 101
6 110
( 3 1 . 6 )8 7 111
0.0312510 = 0.0816
CONVERSIONS WITH
HEX To Decimal
HEX
• It can easily converted into decimal by multiplying each Hex digit by its
positional weight has power of 16.
• For Example 2AF16 to Decimal
2 A F
Decimal Hex Decimal Hex
0 0 8 8
1 1 16 2
16 1
16 0
9 9
2 2 10 A
3 3 2 * 162 + A * 161 + F * 160 11 B
4 4 12 C
= 2 * 256 + 10 * 8 + 15 * 1
5 5 13 D
6 6 = 60710 14 E
7 7 15 F
CONVERSIONS WITH HEX
HEX To Binary
• To convert Hex To Binary is easy. This converting is performed by
converting each hex digit to its 4 bit binary. Possible digits converted
as indicated in Table
Binary Hex Binary Hex
0000 0 1000 8
Example : 3A616 to binary
0001 1 1001 9
0010 2 From table, 3 = 0011 , 1010 A
0011 3 A = 1010 & 6 = 0110 1011 B
0100 4 1100 C
We get 3A616 = 0011101001102
0101 5 1101 D
0110 6 1110 E
0111 7 1111 F
CONVERSIONS WITH
HEX
Binary To HEX
• Its simply the reverse of Hex to binary. Make the four bits group
starting from LSB. Then convert it with using Table
Add Zero to Make it group
of 4 bit.
Binary Hex • For Example: 10101110102 to HexBinary Hex
0000 0 1000 8
0001 1 Make group of four 0010 1001 9
0010 2 , 1011 & 1010 1010 A
0011 3 1011 B
0010 = 2 , 1011 = B & 1010 = A
0100 4 1100 C
0101 5
10101110102 = 2BA16 1101 D
0110 6 1110 E
0111 7 1111 F
Binary − Hexadecimal Conversion
Hex Binary
• 16 = 24 0 0000
1 0001
• Each group of 4 bits represents a 2 0010
hexadecimal digit 3 0011
4 0100
5 0101
Assume Zeros 6 0110
Example: 7 0111
8 1000
( 1 1 0 0 1 . 0 1 )2 9 1001
A 1010
B 1011
C 1100
D 1101
(1 9 . 4 )16 E 1110
F 1111
( 0 0 1 1 0 1 . 0 1 1 )2
(0 D . 6 )16
\ l
Stanford
June 4, 1996 0 : 38 • 5 r/ r \
(r((\j))I
\
(r((\j))I
.
'
- I
c
Actual Stored Value I n t e p r e t e d
Year Year
1952 52 1952
1984 84 1984
1995 95 1995
2000 00 1900
2001 01 1901
0:38.5
-.
8-bit 11111111
Unsigned + 1
Range:0-
255
0000000
Thanks
Queries
42