Computer Number Systems
Number Representation in Computers
Decimal System vs. Binary System
- Decimal System:
- Uses base 10.
- Columns represent powers of 10 (e.g., ones, tens, hundreds).
- Ten possible digits (0-9) for each placeholder.
- Binary System:
- Used by computers.
- Uses base 2.
- Based on transistors, which can be either off (0) or on (1).
- Columns represent powers of 2 (e.g., ones, twos, fours).
Place Values in Binary
- Decimal system columns represent powers of 10: , etc.
- Binary system columns represent powers of 2: , etc.
- Example:
- (ones column)
- (twos column)
- (fours column)
- (eights column)
- (sixteens column)
- (thirty-twos column)
- (sixty-fours column)
- (one-hundred-twenty-eights column)
Converting Binary to Decimal
- Multiply the digit in each binary column by its corresponding power of 2.
- Add the results to get the decimal equivalent.
- Example: Binary
000 - Example: Binary
001 - Example: Binary
010 - Example: Binary
011 - Example: Binary
100 - Example: Binary
101 - Example: Binary
110 - Example: Binary
111
Adding More Bits
- To count higher, add more bits (transistors).
- Each bit doubles the counting capacity.
- Example: Four bits
1000in binary represents 8 in decimal ( ).
Bytes
- A byte is a unit of 8 bits.
- More practical than using only a few bits.
- A byte can represent numbers from 0 to 255.
Byte Representation Example
- Eight bits (one byte):
00000000(decimal 0)
Maximum Value in a Byte
- With eight bits, the highest number you can count to is 255.
- All bits set to one:
11111111 - Including zero, there are 256 total possibilities (0-255).
Significance of Powers of Two
- Numbers like 255 and 256 are common in computer systems because they relate to the units of measure (bytes) that systems use.