CSC103 How Computers Work
Notes3
Last Update:
- Digitization high-level:
- thing → numbers
- numbers → binary
- binary → bits
- bits → physical bits
- Binary notation
- Abstract number (in Platonic heaven): e.g., twenty seven
- Notated in many "representation systems": unary, binary, octal, decimal, hexidecimal
- Unique representation
- unary: 1111111111111111111111111111
- binary: 110112
- octal: 338
- decimal: 2710
- hexadecimal: 1B16
- Babylonian:
: base 60
- Conversion
- Conversion: binary to decimal: multiplication
- 2710 →
2710
- 110112 →
2710
- Conversion: decimal to binary: division
- two hundred fifty six →
25610
- 256/10 = 25 remainder of 6
- 25/10 = 2 reminder of 5
- 2/10 =0 remainder of 2
- twenty seven →110112
- 27/2 = 13 remainder of 1
- 13/2 = 6 remainder of 1
- 6/2 = 3 remainder of 0
- 3/2 = 1 remainder of 1
- 1/2 = 0 remainder of 1
- divide by base, note remainder
- get digits least-significant to most-significant
- check by converting in other direction
- Bits
- Binary Digit
- Some physical two-state device represents a bit:
- 0/1, False/True→Off/On, low voltage/ high voltage, S/N, pit/no pit,...
- Represent any number via the bits of the binary representation of that number
- Bits & Bytes: abbreviated b and B
- Bits & Bytes: b and B
- K, M, G, T
- Memory size:
- 640MB [CD], 10GB [DVD]: Bytes
- Transmission speed: bits
- Representing Characters (Letters)
- ASCII (1967);
Table
- !=33,"=34,A=65..Z=90, a=97..z=122,..,~=126
- Unicode
- 1 Byte for ASCII chars + up to 4 bytes for others.
- Representing images
- 24 bits = 3 bytes per pixel, 8 bits each RGB.
- 8 bits = 256 shades/intensities of color
- Usually represented as a hex triplet: #000000, #FFFFFF, etc.
- Web colors
- JPEG, GIF, PNG, etc.
- Representing Sound
- sample signal strength thousands of times per second, store strength in binary number
- 44,000 samples per second, each 16 bits.
- WAV, AIFF, RA, MP3, etc.
- Digitization: representing something by discrete samples
- Big idea: essentially anything can be digitized
- (Some philosophical controversy over this)
- Need to convert back again: representation → image, sound, etc.
Return to CSC103 Class Homepage: