konvertime (binar,octal,hexadecimal)
DESCRIPTION
Shembuj konvertimesh :Decimal -> Binar , Octal,HexadecimalBinar -> Decimal,Octal,HexadecimalOctal->Binar,Decimal,HexadecimalHexadecimal-> Binar,Decimal,OktalTRANSCRIPT
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
1/13
South East European University
Hyrje n shkencat kompjuterikeDetyra 4: Nga 4 shembuj per cdo konvertim
Punoi: Shaban Dibra Mentor: Azir Aliu
ID: 124372
CST, Skopje 12/10/2015
http://www.seeu.edu.mk/sq/faculties/cst/cst-study-programmes?id=10http://www.seeu.edu.mk/sq/faculties/cst/cst-study-programmes?id=10 -
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
2/13
1. Decimal -> Binar
Decimal:1998
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
0 0 1 1 1 1 1 0 0 1 1 1 0
1998-1024=974;
974-512=462;
462-256=206 ;
206-128=78;
78-64=14;
14-8=6;
6-4=2;
2-2=0;
Decimal:3322
0 1 1 0 0 1 1 1 1 1 0 1 0
3322-2048=1274 ;
1274-1024=250;
250-128=122;
122-64=58;
58-32=26;
26-16=10;
10-8=2;
2-2=0
Decimal:1234
0 0 1 0 0 1 1 1 1 1 0 1 0
1234-1024=210; 210-128=82; 2-2=0
82-64=18; 18-16=2;
Decimal:1212
0 0 1 0 0 1 0 1 1 1 1 0 0
1212-1024=188
188-128=60
60-32=28
28-16=12
12-8=4
4-4=0
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
3/13
1.2 Decimal -> Oktal
Decimal:1998
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.OKTAL
1998 8 = 249 6 6
249 8 = 31 1 1
31 8 = 3 7 7
3 8 = / 3 3
1998 8 = 249 ; 249 x 8 = 1992 ; 1998-1992= 6
249 8 = 31 ; 31 x 8 = 248 ; 249-248=1
31 8 = 3; 3 x 8 = 24; 31-24= 7
3 8 = /;
Decimal:3322
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.OKTAL
3322 8 = 415 2 2
415 8 = 51 7 7
51 8 = 6 3 3
6 8 = / 6 6
Decimal:1234
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.OKTAL1234 8 = 154 2 2
154 8 = 19 2 2
19 8 = 2 3 3
2 8 = / 2 2
Decimal:1212
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.OKTAL
1212 8 = 151 4 4151 8 = 18 7 7
18 8 = 2 2 2
2 8 = / 2 2
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
4/13
1.3 Decimal -> Hexadecimal
Decimal: 1998
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.HEXADECIMAL
1998 16 = 124 14 E124 16 = 7 12 C
7 16 = / 7 7
1998 16 = 124; 124 x 16=1984; 1998-1984=14
124 16 =7; 7x16=112; 124-112=12
7 16= /
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal: 3322
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.HEXADECIMAL
3322 16 = 207 10 A
207 16 = 12 15 F
12 16 = / 12 C
Decimal: 1234
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.HEXADECIMAL
1234 16 = 77 2 2
77 16 = 4 13 D
4 16 = / 4 4
Decimal: 1212
NUMRI DECIMAL OPERACIONI HERSI MBETJA N.HEXADECIMAL
1212 16 = 75 12 C
75 16 = 4 11 B
4 16 = / 4 4
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
5/13
2. Binar -> Decimal
Shifra Binare:
Shifra Binare Operacioni Rezulati Decimal Operacioni Rezultati Decimal
+1 1 X 2 2
+1 3 X 2 6
+1 7 X 2 14
+1 15 X 2 30
+1 31 X 2 62
0 62 X 2 124
0 124 X 2 248
+1 249 X 2 498
+1 499 X 2 998
+1 999 X 2 1998
+1 1998 - 1998
Shifra Binare:
12+12+12+12+12+02+12+12+12+12+12 = 2015
1024+512+256+128+64+0+16+8+4+2+1= 2015
Shifra Binare:
1 1 1 0 1 1 0 1 0 1 0 1 1
4096 2048 1024 0 256 128 0 32 0 8 0 2 1
4096+2048+1024+256+128+32+8+2+1= 7595
Shifra Binare:
1 1 1 0 1 1 1 1 0 0 0
1024 512 256 0 64 32 16 8 0 0 0
1024+512+256+64+32+16+8=1912
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
6/13
Binar-> Oktal
Shifra Binare: )
011 111 001 110
421 421 421 4212+1 4+2+1 1 4+2
3 7 1 6
Shifra Binare: )
011 111 011 111
421 421 421 421
2+1 4+2+1 2+1 4+2+13 7 3 7
Shifra Binare: )
001 110 110 101 011
421 421 421 421 4211 4+2 4+2 4+1 2+1
1 6 6 5 3
Shifra Binare: )
011 101 111 000421 421 421 421
2+1 4+1 4+2+1 0
3 5 7 0
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
7/13
Binar->Hexadecimal
Shifra Binare: (0111 1100 1110)
0 1 1 1 1 1 0 0 1 1 1 0
8 4 2 1 8 4 2 1 8 4 2 1
0+4+2+1 8+4+0+0 8+4+2+0
7 12 14
Shifra Binare: (0111 1101 1111)
0 1 1 1 1 1 0 1 1 1 1 1
8 4 2 1 8 4 2 1 8 4 2 1
0+4+2+1 8+4+0+1 8+4+2+1
7 13 15
Shifra Binare: (0001 1101 1010 1011)
0 0 0 1 1 1 0 1 1 0 1 0 1 0 1 1
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
1 8+4+1 8+2 8+2+1
1 13 10 11
Shifra Binare: (0111 0111 1000)
0 1 1 1 0 1 1 1 1 0 0 0
8 4 2 1 8 4 2 1 8 4 2 1
0+4+2+1 0+4+2+1 8+0+0+0
7 7 8
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
8/13
Oktal -> Decimal
Numri :
3 1 1 4
512x3=1536 64x1=64 8x1=8 1x4=4
1536+64+8+4= 1612
Numri :
3 7 1 6
512x3=1536 64x7=448 8x1=8 1x6=6
1536+448+8+6= 1998
Numri :
1 6 6 5 3
4096x1=4096 512x6=3072 64x6=384 8x5=40 1x3=3
4096+3072+384+40+3=7595
Numri :
3 5 7 0
512x3=1536 64x5=320 8x7=56 1x0=0
1536+320+56+0=1912
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
9/13
Oktal->Binar
Numri :
3 1 1 4
421 421 421 421
011 001 001 100
Numri :
3 7 1 6
421 421 421 421
011 111 001 110
Numri :
1 6 6 5 3
421 421 421 421 421
001 110 110 101 011
Numri :
3 5 7 0
421 421 421 421
011 101 111 000
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
10/13
Oktal-> Hexadecimal
Numri : , Ne fillim e kthejm ne binar pastaj ne hexadecimal, ne I kemi kthyer tek
detyra e me siperme ne binar keshtu qe vazhdojm direkt
0 1 1 0 0 1 0 0 1 1 0 0
8 4 2 1 8 4 2 1 8 4 2 1
0+4+2+0 0+4+0+0 8+4+0+0
6 4 12
Numri : (
0 1 1 1 1 1 0 0 1 1 1 0
8 4 2 1 8 4 2 1 8 4 2 1
0+4+2+1 8+4+0+0=12 8+4+2+0=14
7 12 14
Numri : ( )
0 0 0 1 1 1 0 1 1 0 1 0 1 0 1 1
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
1 8+4+1 8+2 8+2+1
1 13 10 13
Numri : (
0 1 1 1 0 1 1 1 1 0 0 0
8 4 2 1 8 4 2 1 8 4 2 1
4+2+1 4+2+1 8
7 7 8
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
11/13
Hexadecimal -> Decimal
Shifra:
9 6 C
256 16 1256x9=2304 16x6=96 12x1=12
2304+96+12=2412
Shifra:
6 4 C
256 16 1
256x6=1536 16x4=64 12x1=12
1536+64+12=1612
Shifra:
7 C E
256 16 1
256x7=1792 16x12=192 14x1=141792+192+14=1998
Shifra:
7 7 8
256 16 1
256x7=1792 16x7=112 8x1=8
1792+112+8=1912
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
12/13
Hexadecimal -> Binar
Shifra:
9 6 C(12)
8 4 2 1 8 4 2 1 8 4 2 1
1 0 0 1 0 1 1 0 1 1 0 0
Shifra:
6 4 C(12)8 4 2 1 8 4 2 1 8 4 2 1
0 1 1 0 0 1 0 0 1 1 0 0
Shifra:
7 C(12) E(14)
8 4 2 1 8 4 2 1 8 4 2 1
0 1 1 1 1 1 0 0 1 1 1 0
Shifra:
7 7 8
8 4 2 1 8 4 2 1 8 4 2 1
0 1 1 1 0 1 1 1 1 0 0 0
-
7/17/2019 Konvertime (Binar,Octal,Hexadecimal)
13/13
Hexadecimal -> Oktal
Shifra:
Ne fillim e kthejm ne binar por ne tashme e kemi kthyer ne binar tek detyra siper qe dmth:
100 101 101 100421 421 421 421
4 4+1=5 4+1=5 4
4 5 5 4
Shifra:
Ne fillim e kthejm ne binar por ne tashme e kemi kthyer ne binar tek detyra siper qe dmth:
011 001 001 100
421 421 421 421
2+1=3 1 1 4
3 1 1 4
Shifra:
Ne fillim e kthejm ne binar por ne tashme e kemi kthyer ne binar tek detyra siper qe dmth:
011 111 001 110
421 421 421 421
2+1=3 4+2+1=7 1 4+2=6
3 7 1 6
Shifra:
011 101 111 000
421 421 421 421
2+1=3 4+1=5 4+2+1=7 0
3 5 7 0