Click here to load reader
Upload
arnab73
View
105
Download
25
Embed Size (px)
Citation preview
Information and communication tecnology
Information and communication technology
Chapter 3Part-1By Arnab (NSU cse department)
-) )
Arnab (cse department NSU) , ---) ( ) = ) ( ) = ) ( A,B,C,D,E,F) = ) ( ) =
000011112102231133410044510155611066711177810001089100111910101012A11101113B12110014C13110115D14111016E15111117F
Arnab (cse department NSU) ---- -----
off,low,false. on,high,true.
i) +. ii) +. +.
AbduSalamConversion Among BasesThe possibilities:HexadecimalDecimalOctalBinary
AbduSalamQuick Example2510 = 110012 = 318 = 1916Base
AbduSalamBinary to DecimalHexadecimalDecimalOctalBinary
Arnab (cse department NSU)Binary Numeral System - Base-2Binary numbers uses only 0 and 1 digit.Examples:101012= 10101B = 124+023+122+021+120= 16+4+1= 21101112= 10111B = 124+023+122+121+120= 16+4+2+1= 231000112=100011B=125+024+023+022+121+120=32+2+1= 35
Arnab (cse department NSU)
AbduSalamOctal to DecimalHexadecimalDecimalOctalBinary
Arnab (cse department NSU)Octal Numeral System - Base-8Octal numbers uses digits from 0..7.Examples:278= 281+780= 16+7 = 23308= 381+080= 2443078= 483+382+081+780= 2247
Octal to Decimal
AbduSalamHexadecimal to DecimalHexadecimalDecimalOctalBinary
AbduSalamExampleABC16 =>C x 160 = 12 x 1 = 12 B x 161 = 11 x 16 = 176 A x 162 = 10 x 256 = 2560 (+) 274810
Arnab (cse department NSU)Hexadecimal Numeral System - Base-16Hex numbers uses digits from 0..9 and A..F.H denotes hex prefix.Examples:2816= 28H = 2161+8160= 402F16= 2FH = 2161+15160= 47BC1216= BC12H = 11163+12162+1161+2160= 48146
Hexadecimal to Decimal
AbduSalamDecimal to BinaryHexadecimalDecimalOctalBinary
Arnab (cse department NSU)
AbduSalamExample12510 = ?22 125 62 1
2 31 0
2 15 1
2 7 1
2 3 1
2 1 1
2 0 1
12510 = 11111012
Arnab (cse depertment NSU)DECIMAL TO BINARY CONVERSION 600 / 2 = 300 r 0 [least significant bit - lsb] 300 / 2 = 150 r 0 150 / 2 = 75 r 0 75 / 2 = 37 r 1 37 / 2 = 18 r 1 18 / 2 = 9 r 0 9 / 2 = 4 r 1 4 / 2 = 2 r 0 2 / 2 = 1 r 0 (1001011000)B=600D1 / 2 = 0 r 1 [most significant bit - msb]
AbduSalamDecimal to OctalHexadecimalDecimalOctalBinary
Made by Arnab (cse department NSU)Example123410 = ?88 1234 154 2
8 19 2
8 2 3
8 0 2
123410 = 23228
Decimal to Octal
Decimal to Octal
Decimal to Octal
AbduSalamDecimal to HexadecimalHexadecimalDecimalOctalBinary
Arnab (cse department NSU)Decimal to Hexadecimal Conversion 5789 16 = 361 r 13 or D LSB 361 16 = 22 r 9 or 9 22 16 = 1 r 6 or 6 1 16 = 0 r 1 or 1 MSB 5789 in decimal = 169D in hexadecimal.
Arnab (cse department NSU)AbduSalamExample123410 = ?16123410 = 4D216
16 1234 77 2
16 4 13 = D
16 0 4
Decimal to Hexadecimal
Decimal to Hexadecimal
AbduSalamOctal to BinaryHexadecimalDecimalOctalBinary
Example 7 0 5
111 000 101
7058 = 11100010127058 = ?2
AbduSalamHexadecimal to BinaryHexadecimalDecimalOctalBinary
AbduSalamExample10AF16 = ?2 1 0 A F
0001 0000 1010 1111
10AF16 = 00010000101011112
AbduSalamBinary to OctalHexadecimalDecimalOctalBinary
AbduSalamExample10110101112 = ?8001 011 010 111
1 3 2 7
10110101112 = 13278
Binary to Octal
AbduSalamBinary to HexadecimalHexadecimalDecimalOctalBinary
AbduSalamExample10101110112 = ?160010 1011 1011
2 B B
10101110112 = 2BB16
Binary to Hexadecimal
AbduSalamOctal to HexadecimalHexadecimalDecimalOctalBinary
AbduSalamExample10768 = ?16 1 0 7 6
001 000 111 110
2 3 E
10768 = 23E16
AbduSalamHexadecimal to OctalHexadecimalDecimalOctalBinary
AbduSalamExample1F0C16 = ?8 1 F 0 C
0001 1111 0000 1100
1 7 4 1
1F0C16 = 174148
1 7 4 1 4
Exercise Convert ...Dont use a calculator!
DecimalBinaryOctalHexa-decimal3311101017031AF
Answer
Arnab (cse department NSU) = +
=-
Arnab (cse department NSU) ) ) () (+) -5
0000010111111010+111111011
2s ComplementProcess
2s Complement Examples49Example #1Example #2Complement Digits
Add 1
5 = 00000101-5 = 11111011 11111010
+1Complement Digits
Add 1
-13 = 1111001113 = 0000110100001100
+1
Examples of the 2s Complement Process.2's Complement ArithmeticDigital Electronics Lesson 2.4 Specific Comb Circuit & Misc TopicsProject Lead The Way, Inc.Copyright 200949
Arnab (cse department NSU)
17 = 0001 0001(binary 17)=1110 1111 (two's complement 17) NOT(0001 0001)=1110 1110(Invert bits) 1110 1110 + 0000 0001 (Add 1) 1110 1111 2 complement
2's Complement AdditionTwo's complement addition follows the same rules asbinary addition.For example,5 + (-3)=20000 0101=+5 -3= 00000011 + 1111 1101=-3 11111100 0000 0010=+2 +1 11111101
NEG + NEG NEG Answer51Take the 2s complement of both negative numbers and use regular binary addition. 11110111 (-9) + (-5) -14
11111011
+ 2s ComplementNumbers, See Conversion ProcessIn Previous Slides
1]11110010
8th Bit = 1: Answer is NegativeDisregard 9th Bit
1111001000001101+100001110
To Check:Perform 2s ComplementOn Answer
This slide demonstrates the addition of two negative numbers.
2's Complement ArithmeticDigital Electronics Lesson 2.4 Specific Comb Circuit & Misc TopicsProject Lead The Way, Inc.Copyright 200951
POS + NEG NEG Answer52Take the 2s complement of the negative number and use regular binary addition. 11110111 (-9) + 5 -4
00000101
+ 0000100111110110+111110111
2s ComplementProcess11111100
8th Bit = 1: Answer is Negative
1111110000000011+100000100
To Check:Perform 2s ComplementOn Answer
This slide demonstrates the addition of one positive and one negative number. Again, this is is the same a subtracting a positive number from a positive number. In this case the answer happens to be negative.
2's Complement ArithmeticDigital Electronics Lesson 2.4 Specific Comb Circuit & Misc TopicsProject Lead The Way, Inc.Copyright 200952
POS + NEG POS Answer53Take the 2s complement of the negative number and use regular binary addition.00001001 9 + (-5) 4
11111011
+ 0000010111111010+111111011
2s ComplementProcess1]00000100
8th Bit = 0: Answer is PositiveDisregard 9th Bit
This example shows the addition of one positive and one negative numbers. Note that this is done in the same way as subtracting a positive number from a positive number. In this case, the answer is positive.2's Complement ArithmeticDigital Electronics Lesson 2.4 Specific Comb Circuit & Misc TopicsProject Lead The Way, Inc.Copyright 200953
POS + POS POS Answer54If no 2s complement is needed, use regular binary addition.00001001 9 + 5 14
0000111000000101
+
Addition of two Positive numbers.2's Complement ArithmeticDigital Electronics Lesson 2.4 Specific Comb Circuit & Misc TopicsProject Lead The Way, Inc.Copyright 200954
Arnab (cse depertment NSU)
Thank you all for your perticipation
For any help call on 01832388300