Title: CSE 102 Introduction to Computer Engineering
1CSE 102Introduction to Computer Engineering
2Number Systems
- Binary numbers (Base 2) 0,1
- Octal numbers (Base 8) 0,1,2,3,4,5,6,7
- Decimal numbers (Base 10) 0,1,2,3,4,5,6,7,8,9
- Hexadecimal numbers (Base 16) 0,1,2,3,4,5,6,7,8,
9,A,B,C,D,E,F
3Decimal to Binary Conversion
Divide by 2 Remainder
102 2
51 2 0
25 2 1
12 2 1
6 2 0
3 2 0
1 2 1
0 2 1
4Decimal to Binary Conversion
Multiply by 2 Integer part
0.125 2
0.25 2 0
0.5 2 0
1.0 2 1
5Decimal to Binary Conversion
Multiply by 2 Integer part
0.4 2
0.8 2 0
1.6 2 1
1.2 2 1
0.4 2 0
0.8 2 0
1.6 2 1
1.2 2 1
0.4 2 0
- (0.4)10 (?)2
- (0.01100110)2
- (0.0110)2
-
6Binary to Octal and Hexadecimal Conversion
- Octal (1100110)2 (?)8
-
- (001100110)2 (146)8
- 1 4 6
-
- Hexadecimal (1100110)2 (?)16
-
- (01100110)2 (66)16
- 6 6
-
7Binary to Octal and Hexadecimal Conversion
- Octal (0.01100110)2 (?)8
-
- (0.011001100)2 (0.314)8
- 3 1 4
-
- Hexadecimal (0.01100110)2 (?)16
-
- (0.01100110)2 (66)16
- 6 6
-
8Representation of Integers
- Signed-magnitude representation
- 2s complement representation
9Signed-magnitude Representation
sign bit 0-positive 1-negative
integer
0 0 0 0 1 1 0 0 1 1 0
1 0 0 0 1 1 0 0 1 1 0
102s complement Representation
- To find 1s complement of a binary number change
1s to 0s and 0s to 1s - To find 2s complement of a number add 1 to its
1s complement - Ex (102)10 (0001100110)2
- 1s complement 1110011001
- 2s complement 1110011010
112s complement Representation
0 0 0 1 1 0 0 1 1 0
1 1 1 0 0 1 1 0 1 0