Download presentation
Presentation is loading. Please wait.
Published byHilda Griffith Modified over 9 years ago
1
1 For recitations Amr Mahmoud amm418@pitt.edu amm418@pitt.edu Office Hours: Monday 12-2 pm @ 1142 Benedum Hall
2
2 More Binary to Octal 1 011 010 110 101 110 1 3 2 6 5 6 = 132656 8 01 001 011 111 101 110 1 1 3 7 5 6 = 113756 8 Note 16 bits Note 17 bits
3
3 More Binary to Hexadecimal 1011 0101 1010 1110 B 5 A E = B5AE 16 0 1001 0111 1110 1110 0 9 7 E E = 097EE 16 Note 16 bits Note 17 bits
4
4 More Integer Decimal to BinaryRemainder Note: Read up 110111 2 = 55 10
5
5 More Integer Decimal to OctalRemainder Note: Read up 233 8 = 155 10 155 10
6
6 More Integer Decimal to HexadecimalRemainder Note: Read up 0x69 16 = 105 10 105 10
7
7 Negative Numbers Use MSB - most significant bit “0” is plus+ “1” is minus- Three primary conventions Sign magnitude One’s complement─ covered in recitation Two’s complement
8
8 One’s Complement Numbers 0000 1000 0010 0100 1100 1110 0110 1010 0001 0011 0101 0111 1001 1111 1101 1011 0 2 -7 4 6 -3 -5 1 3 -0 -2 -4 -6 7 5 Note logic comp
9
9 One’s Complement Numbers Pro - Easy to get negative example +4 (0100) » -4 (1011) Con - two zero’s (0000) & (1111) logic slower than 2’s comp requires end around carry
10
10 Exercise One’s ComplementTwo’s Complement -12 -13 1001110100 110011110010
11
11 Exercise How to convert fractional numbers into binaries ? Example: –0.5 10 = –0.1 10 = Fill in the table, using a total of 8 bits and 2-bit fractional part Sign-magnitude1’s compliment 2’s compliment 27 -27 -27.4
12
12 Exercise How to convert fractional numbers into binaries ? Example: –0.5 10 = –0.1 10 = Fill in the table, using a total of 8 bits and 2-bit fractional part Sign-magnitude1’s compliment 2’s compliment 2701 1011. 00 -2711 1011. 0010 0100. 1110 0101. 00 -27.411 1011. 0110 0100. 1010 0100. 11
13
13 Quiz 1 Fill in the table, using a total of 16 bits and 2-bit fractional part DecimalSign-magnitude2’s complimentHexadecimal (2’s compliment) 7.3 -50 -25.75
14
14 Quiz 1 Fill in the table, using a total of 16 bits and 2-bit fractional part DecimalSign-magnitude2’s complimentHexadecimal 7.300 0000 0000 0111. 01 0 0 0 7. 4 -5010 0000 0011 0010. 0011 1111 1100 1110. 003 F C E. 0 -25.7510 0000 0001 1001. 1111 1111 1110 0110. 013 F E 6. 4
15
15 Some Answers and examples
16
16 Some Answers and examples
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.