Data Representation
 
CS 272
Sam Houston State Univ.
Dr. Tim McGuire


Positional Number Systems

Binary, Octal, & Hexadecimal Numbers Problems with Binary Octal and Hexadecimal
decimal 0  1   2   3   4   5   6   7    8    9   10
binary  0  1  10  11 100 101 110 111 1000 1001 1010
octal   0  1   2   3   4   5   6   7   10   11   12
Hexadecimal
decimal 0  1   2   3   4   5   6   7    8    9   10   11   12
binary  0  1  10  11 100 101 110 111 1000 1001 1010 1011 1100
hex     0  1   2   3   4   5   6   7    8    9    A    B    C
Conversions 2BD416 = 2x163 + Bx162 + Dx161 + 4x160
= 2x4096 + 11x256 + 13x16 + 4x1
= 8192 + 2816 + 208 + 4 = 11,22010
95 ¸ 16 = 5 r 15 --> 9510 = 5F16 3F7416 = 0011 1111 0111 0100
= 0 011 111 101 110 100 = 0375648
Exercise: Addition and Subtraction  2546
+1872
 4418
 5B39
+7AF4
 D62D
 100101111
+000110110
 101100101
A Note on Notation Two's Complement Arithmetic The Fabulous Four-bit Machine (FFM) 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111,
1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111
Unsigned Integers Signed Integers Sign and Magnitude One's Complement Two's Complement   0100
+ 1011
 10000
Complementing the Complements Moving past 4 bits