This preview shows pages 1–9. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSE360 1 CSE 360: Introduction to Computer Systems Course Notes Rick Parent ( [email protected] ) http://www.cse.ohiostate.edu/~parent Wayne Heym ( [email protected] ) http://www.cse.ohiostate.edu/~heym Copyright © 19982005 by Rick Parent, Todd Whittaker, Bettina Bair, Pete Ware, Wayne Heym CSE360 2 Information Representation 1 ◆ Positional Number Systems: position of character in string indicates a power of the base (radix). Common bases: 2, 8, 10, 16. (What base are we using to express the names of these bases?) – Base ten (decimal): digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 form the alphabet of the decimal system. ▼ E.g., 316 10 = – Base eight (octal): digits 0, 1, 2, 3, 4, 5, 6, 7 form the alphabet. ▼ E.g., 474 8 = CSE360 3 Information Representation 2 – Base 16 (hexadecimal): digits 09 and AF. ▼ E.g., 13C 16 = – Base 2 (binary): digits (called “ bits ”) 0, 1 form the alphabet. ▼ E.g., 100110 = – In general, radix r representations use the first r chars in {0…9, A. ..Z} and have the form d n1 d n2 … d 1 d . Summing d n1 × r n1 + d n2 × r n2 + … + d × r will convert to base 10. Why to base 10? CSE360 4 Information Representation 3 ◆ Base Conversions – Convert to base 10 by multiplication of powers ▼ E.g., 10012 5 = ( ) 10 – Convert from base 10 by repeated division ▼ E.g., 632 10 = ( ) 8 – Converting base x to base y : convert base x to base 10 then convert base 10 to base y CSE360 5 Information Representation 4 – Special case: converting among binary, octal, and hexadecimal is easier ▼ Go through the binary representation, grouping in sets of 3 or 4. ▼ E.g., 11011001 2 = 11 011 001 = 331 8 11011001 2 = 1101 1001 = D9 16 ▼ E.g., C3B 16 = ( ) 8 CSE360 6 Information Representation 5 ◆ What is special about binary? – The basic component of a computer system is a transistor (tran sfer re sistor): a two state device which switches between logical “1” and “0” (actually represented as voltages on the range 5V to 0V). – Octal and hexadecimal are bases in powers of 2, and are used as a shorthand way of writing binary. A hexadecimal digit represents 4 bits, half of a byte. 1 byte = 8 bits. A bit is a b inary dig it . – Get comfortable converting among decimal, binary, octal, hexadecimal. Converting from decimal to hexadecimal (or binary) is easier going through octal. CSE360 7 Information Representation 6 Binary Hex Decimal Binary Hex Decimal 0000 1000 8 8 0001 1 1 1001 9 9 0010 2 2 1010 A 10 0011 3 3 1011 B 11 0100 4 4 1100 C 12 0101 5 5 1101 D 13 0110 6 6 1110 E 14 0111 7 7 1111 F 15 CSE360 8 Information Representation 7 ◆ Ranges of values – Q: Given k positions in base n , how many values can you represent?...
View
Full
Document
This note was uploaded on 02/27/2012 for the course CSE 360 taught by Professor Sam during the Winter '11 term at Ohio State.
 Winter '11
 SAM

Click to edit the document details