Bits & Bytes Why computers use binary
Analog Signals Analog signals : constantly changing values – Difficult to make precise
Digital Digital signals : only allowed to have specific values
Binary Computers are digital systems with 2 possible states: on or off – Called a binary system
Analog Signals Analog values converted to binary with a threshold value
Analog Implementation of Binary Even if actual values are somewhat noisy Correct binary value is preserved
Why Binary 1.Unambiguous signals (easy to tell 1 from 0) – Storing, copying data can be done without errors 2.Simple, easy to build – 1/0 easier to build than 1/2/3/4/5/6/7/8/9/0 3.Anything that can be represented with some sort of pattern can be represented with patterns of bits
Bits Bit : single on/off value Represented as: – A mechanical electrical switch. – Voltage on a wire. – Magnetic field of a small slice of metal. – A hole punched in a card. – A tiny part of the light-reflecting surface of a CD. …
Bit Patterns One bit : 2 possible values: 0 1
Bit Patterns One bit : 2 possible values: 0 1 Two bits : 4 possible values
Bit Patterns Two bits : 4 possible values Three bits : 8 possible values
Bit Patterns Four bits: 16 values Five bits: 32 values … n bits: 2 n values
Bytes 1 bit (1/0) usually not useful on its own Usually work in larger chunks – Byte : 8 bits – Special names for large collections of bytes: NameNumber of Bytespower of 2 byte12020 kilobyte (KB) megabyte (MB)1,048, gigabyte (GB)1,073,741, terabyte (TB)1,099,511,627,