Bit Permutations 4 bit 0 0 0 8
Bit Permutations - 4 bit 0 0 0 8 1 0 0 0 1 9 1 0 0 1 2 0 0 10 1 0 3 0 0 1 1 11 1 0 1 1 4 0 1 0 0 12 1 1 0 0 5 0 1 13 1 1 0 1 6 0 1 1 0 14 1 1 1 0 7 0 1 15 1 1
Number Systems CMSC 104 Section 301 Olga Ratsimor
1 and 0 0 1 +1 +1 1 10 111 +1 111 1000 10 11 100 +1 +1 11 100 101 +1 110 1001 1010 +1 +1 +1 1001 1010 1011
Bit Permutations - 4 bit (animation) D C B A 1 0 0 1 010 0 10 Done!!!
D B Decmal to Binary p p Decimal number 143 needs to be conberted to binary Decimal number 256 needs to be conberted to binary Remainder 143 ÷ 2 = 71 remainder is 1 256 ÷ 2 = 128 0 71 ÷ 2 = 35 remainder is 1 128 ÷ 2 = 64 0 35 ÷ 2 = 17 remainder is 1 64 ÷ 2 = 32 0 17 ÷ 2 = 8 remainder is 1 32 ÷ 2 = 16 0 8 ÷ 2 = 4 remainder is 0 16 ÷ 2 = 8 0 4 ÷ 2 = 2 remainder is 0 8 ÷ 2 = 4 0 2 ÷ 2 = 1 remainder is 0 4 ÷ 2 = 2 0 1÷ 2 = 0 remainder is 1 2 ÷ 2 = 1 0 1÷ 2 = 0 1 10001111 10000
B D Binary to Decimal p 10101011 needs to be converted to decimal 1 0 1 0 1 1 27 26 25 24 23 22 21 20 20= 1 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 27 = 128 20 x 1 = 1 21 x 1 = 2 22 x 0 = 0 23 x 1 = 8 24 x 0 = 0 25 x 1 = 32 26 x 0 = 0 1 + 2 + 8 + 32 + 128 = 171 7 2 x 1 = 128
Adding Binary Numbers Elements of Binarry Additions 0 + 0 0 1 + 0 1 1 + 1 1 0 0 0 1 + 0 0 10 Elements of Decimal Additions 5 + 5 1 0 99 + 1 1 0 0 B+B
Adding Binary Numbers p B+B 110110110 + 111110011 1 1 1 1 0 +1 1 1 0 0 1 1 1 0 1 0 + 1 = 1 1+1 = 1 0 1+0=1 1+1= 1 0 0+0=0 0+1=1 1+1=1 0 1 + 1 = 1 0 10 + 1 = 1 1 + 1 = 1 0 10 + 1 = 1 1
Decimal to Hexadecimal p Need to convert 1128 into Hexadecimal 1128 ÷ 16 = 70 R 8 70 ÷ 16 = 4 R 6 4 ÷ 16 = 0 R 4 4 6 8 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1 a, 1 b, 1 c, 1 d, 1 e, 1 f, 20 D H
Decimal to Hexadecimal p Need to convert 256 into Hexadecimal 256 ÷ 16 = 16 R 0 16 ÷ 16 = 1 R 0 1 ÷ 16 = 0 R 1 1 0 0 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1 a, 1 b, 1 c, 1 d, 1 e, 1 f, 20 D H
D H Decimal to Hexadecimal p Need to convert 43981 into Hexadecimal 43981 ÷ 16 = 2748 R 13 D 2748 ÷ 16 = 171 R 12 C 171 ÷ 16 = 10 R 11 B 10 ÷ 16 = 0 R 10 A ABCD 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1 a, 1 b, 1 c, 1 d, 1 e, 1 f, 20
Hexadecimal to Decimal p H D Need to convert 1 FA 8 into Decimal 1 F A 8 163 162 161 160 = 1 161 = 16 162 = 16 x 16 =256 163 = 16 x 16= 4096 164 = 16 x 16 x 16 = 65536 160 x 8 = 8 161 x A {10} = 160 162 x F {15} = 256 x 15= 3840 163 x 1 = 4096 8+160+3840+4096= 8104
Adding Hexadecimal Numbers p H+H Add hexadecimals AB 35 + 7 CF 1 1 1 A B 3 5 + 7 C F 1 1 2 8 2 6 5+1=6 3 + F {15} =12 {18} B + C = 17+1 = 18 A + 7 = 11+1 = 12 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1 a, 1 b, 1 c, 1 d, 1 e, 1 f, 20
Adding Hexadecimal Numbers p Add hexadecimals C 0 FFEE+ DECADE 1 1 C 0 F F E E + D E C A D E 19 FC A C C 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1 a, 1 b, 1 c, 1 d, 1 e, 1 f, 20
The Hexadecimal Number System Binary Decimal 0 0 0 1010 10 A 1 2 3 4 5 6 7 8 9 1011 1100 1101 1110 1111 11 12 13 14 15 B C D E F 1 10 11 100 101 110 111 1000 1001 Hexadecimal Binary Decimal Hexadecimal
B H Binary to Hexadeicmal 1111 F F 00 101110101111 2 E B A F
- Slides: 16