## Binary, Bits, and Bytes

• Binary Numbers

The computer stores and processes information. All information is represented in the computer as binary numbers. Binary numbers are made up of ones and zeros. For example:
Base 10 Number System (Decimal)
Base 2 Number System (Binary)
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111
• Bits

The smallest unit of storage in a computer is a bit. A bit will hold one digit of a binary number. For example, the binary number 0 or 1 would require 1-bit of storage. The binary number 1111 would require 4-bits of storage.

You can quickly determine the amount of distinct numbers that a given amount of bits can store by raising 2 to the power of the number of bits in question. For example,

2number of bits
Distinct numbers
Range of Decimal numbers
21 2 0 to 1
22 4 0 to 3
24 16 0 to 15
28 256 0 to 255
216 65,536 0 to 65,535
232 4,294,967,296 0 to 4,294,967,295
• Bytes

Computers are usually built to process chunks of bits at a time, rather than individual bits. A common chunk size is 8 bits, often referred to as a "byte". As you can see above,with a byte you can store one of 256 distinct numbers, specifically, the binary numbers from 00000000 to 11111111, or in decimal, from 0 to 255.

• Memory and Storage

Information is stored in memory (RAM) when it is being processed. Often, information is stored on a secondary storage device, such as a hard drive, when it is not being processed and to make the information persistent (existing after the computers power is turned off.)

• Units of Measure

Common units of measurement of memory and secondary storage devices:

1 byte = 8 bits

1 kilobyte (KB) = 1024 bytes (210 bytes)

1 megabyte (MB) = 1024 kilobytes (220 bytes)

1 gigabyte (GB) = 1024 megabytes (230 bytes)

1 terabyte (TB) = 1024 gigabytes (240 bytes)

NOTE: Do not confuse KB and MB with Kb and Mb. The former refers to kilobytes and megabytes, while the later refers to kilobits and megabits. Network speeds are often expressed in kilobits or megabits per second. 10 Kb/sec is much smaller than 10 KB/sec!!! (8x smaller to be exact.)

## File Size

File size refers to the amount of memory or secondary storage required to hold the data that makes up a file.

• Image File Size = Dimensions * Color Depth
• Dimensions

Measure: Pixels

Example: 320 x 240

• Color Depth

Measure: Bits

Example: 8 bit = 256 colors, 16 bit = 65536 colors

• Example

File Size = (320*240) * 16 bits

File Size = 1228800 bits

File Size = 1228800/8 = 153600 bytes = 150 KB

• Video File Size = Dimensions * Color Depth * Frame Rate * Duration
• Dimensions

Measure: Pixels

Example: 320 x 240

• Color Depth

Measure: Bits

Example: 8 bit = 256 colors, 16 bit = 65536 colors

• Frame Rate

Measure: Frames per Second

Example: NTSC TV is 29.97 fps

• Example

File Size = (320*240) * 16 bits * 30 fps

File Size = 36864000 bits/sec.

File Size = 36864000 /8 = 4608000 bytes = 4500 KB/sec.

• Sound File Size = Sampling Rate * Sample Size * Tracks * Duration
• Sampling Rate

Measure: kHz

Example: 44.100 kHz

• Sample Size

Measure: Bits

Example: 8 bit = 256 amplification steps, 16 bit = 65536 amplification steps

• Example

File Size = (44100 samples/sec.) * 16 bits * 2 tracks

File Size = 1411200 bits/sec.

File Size = 1411200/8 = 176400 bytes = 172 KB/sec.

• Video and Sound File Size = ((Dimensions * Color Depth * Frame Rate) + (Sampling Rate * Sample Size * Tracks)) * Duration
• Example

File Size = (320*240) * 16 bits * 30 fps + (44100 samples/sec.) * 16 bits * 2 tracks

File Size = 36864000 bits/sec + 1411200 bits/sec

File Size = 38275200/8 = 4784400 bytes/sec. = 4672 KB/sec.

NOTE: For 640x480 dimensions, this grows to over 18172 KB/sec.

• Storage Size
Media
Storage Size
CD-ROM 650 MB
DVD 4-17 GB
Hard Drive (typical today) 9 GB - 75 GB
RAID(typical today) 18 GB - 250 GB
Internet Variable

## Data Rate

Data rate refers to the amount of data that can be transferred from one location to another in a given amount of time.

To play 320x240, 16 bit color video at 30 frames per second with a 44.100 kHz, 16 bit, stereo sound, we must be able to transfer at least 4672 KB/sec. from our storage device (CD-ROM, Hard Drive, Internet) into the computer's memory. There are a number of additional transfer and processing steps that take place inside the computer to actually display the video on a monitor and play the sound through a speaker, but let's just focus on the transfer between the storage device and the computers memory because that usually turns out to be the largest bottleneck.

• Hard Drive

Most modern hard drives have transfer rates of between 5 MB/sec. and 10 MB/sec. or faster.

• CD-ROM
Drive
Theoretical Rate
Actual Maximum Rate
Safe Data Rate
Single Speed CD-ROM 150 KB/sec 100 KB/sec. 90 KB/sec.
Double Speed CD-ROM 300 KB/sec 200 KB/sec. 180 KB/sec.
Quad Speed CD-ROM 600 KB/sec 400 KB/sec. 360 KB/sec.
24x CD-ROM 3600 KB/sec 2400 KB/sec. 2160 KB/sec.
48x CD-ROM 7200 KB/sec 4800 KB/sec. 4320 KB/sec.
• Internet

The transfer rate of the Internet is dependent on the type of connection and the amount of other traffic on the network.

Drive
Theoretical Rate (KB/sec)
Safe Data Rate (KB/sec)
14.4 modem 1.8 1
28.8 modem 3.6 2
33.6 modem 4.2 2.5
56K modem 6.6 4
Single ISDN 8 5
Dual ISDN 16 10
DSL 48 30
T1 192.5 50
Cable Modem 750 50
Intranet/LAN 1250 35
100base-T LAN 12500 50

NOTE:
Dual ISDN and below, users connection is limiting factor.
DSL and T1, the server or Internet is limiting factor.
Cable modem and LAN, multiple users share the network is limiting factor.

## Basics of Compression

• Reasons to Compress
• Reduce File Size
• Increase transfer speed of the file at given Data Rates

• Compression Techniques

In the most general terms, compression finds similar patterns in the data and encodes these patterns in a more compact form.

• Spatial Compression
• Finds areas of similar color, repeating patterns, or smooth gradients

• High detail or complex patterns do not compress well spatially

• Temporal (Delta Change) Compression
• Defines image based on how it changed from previous frame

• "Keyframe" stores the complete frame. "Difference frames" store only the changes from the previous frame.

• Rapid motion, frequent cuts, and zooms do not compress well temporally

• Compression Quality
• Lossless
• Information is not lost during compression. Best case scenario usually only reduce file size by 50%.

• Lossy
• Information is lost during compression. Results in the largest reduction of file size. Most video compression techniques are lossy.

• CODECS (Compression/Decompression schemes)

A codec is an algorithm that handles the compression and decompression of media.

• Classes of Codecs
• Transfer Codecs
• High quality, some are lossless
• Great for capturing and editing
• Require lots of hard drive space and possibly special hardware
• Examples:
• Video
• Animation - lossless at high quality
• Motion-JPEG (MJPEG)
• Photo JPEG
• DV
• Audio
• typically no compression for transfer

• Delivery Codecs
• Compress video for delivery over low data rates
• Lossy - Compress for delivery only once!
• Examples:
• Video
• Cinepak
• Sorenson Video
• Intel Indeo
• H.261
• H.263
• MPEG (1, 2, 4)
• RealVideo
• Audio
• IMA 4:1
• MPEG 1 Layer III Audio (MP3)
• QDesign Music
• Qualcomm PureVoice
• RealAudio

• Speed of Codecs
• Symmetrical
• Compress and decompress at equal rate
• Required for video conferencing or live streaming
• Examples:
• H.261
• H.263

• Asymmetric
• Longer to compress than decompress
• Codecs that allow high quality at low data rates are usually asymmetric
• Examples:
• Cinepak
• Sorenson Video
• Intel Indeo
• MPEG (all)
• RealVideo
• Notes:
• Some asymmetric codecs, such as Sorenson, have an alternate "near-symmetrical" versions used for live broadcasts. However the symmetic version does not do as good of job as the asymmetric versions.
• Special hardware can be used to make an asymmetric codec compress in real-time (or at least a lot faster)

# Andrew File System Retirement

Andrew File System, which hosts this address, will be ending service by January 1, 2021. Learn about the retirement process, managing your existing files, and alternative services at the Andrew File System Retirement Information Page.

Dismiss