120 likes | 154 Views
For recitations Amr Mahmoud amm418@pitt.edu Office Hours: Monday 12-2 pm @ 1142 Benedum Hall. Note 16 bits. Note 17 bits. 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.
E N D
For recitations • Amr Mahmoudamm418@pitt.edu • Office Hours: Monday 12-2 pm @ 1142 Benedum Hall
Note 16 bits Note 17 bits More Binary to Octal 1 011 010 110 101 110 1 3 2 6 5 6 = 1326568 01 001 011 111 101 110 1 1 3 7 5 6 = 1137568
Note 16 bits Note 17 bits More Binary to Hexadecimal 1011 0101 1010 1110 B 5 A E = B5AE16 0 1001 0111 1110 1110 0 9 7 E E = 097EE16
Remainder Note: Read up 1101112 = 5510 More Integer Decimal to Binary
Remainder Note: Read up 2338 = 15510 More Integer Decimal to Octal 15510
Remainder Note: Read up 0x6916 = 10510 More Integer Decimal to Hexadecimal 10510
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
0 0000 -0 1 1111 0001 2 -1 1110 0010 3 -2 0011 1101 4 -3 0100 1100 1011 0101 -4 5 Note logic comp 1010 0110 -5 6 1001 0111 1000 -6 7 -7 One’s Complement Numbers
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
Exercise 10011 10100 110010 110011
Exercise • How to convert fractional numbers into binaries ? • Example: • 0.510 = • 0.110 = • Fill in the table, using a total of 8 bits and 2-bit fractional part
Quiz 1 • Fill in the table, using a total of 16 bits and 2-bit fractional part