Data Representation

Ace your homework & exams now with Quizwiz!

Representing Numbers

A Computer Represents numbers with the binary numbering system or Base 2 To understand how this works, let's look at the numbering system that we grew up with. The decimal numbering system or Base 10. We represent numbers we string together one or more digits. There are 10 digits (0 - 9). Each digit has a value, and the place it occupies in a string has a value. There's one's place, ten's place, hundred's place, etc. To determine the number value we take the digit value x the place value for each digit and add them together. Example: Take the number 245. In the decimal numbering system the value represented with this string of digits is determined by the following (2 x 100) + (4 x 10) + (5 x 1) All numbering systems work the same way. Each has a base that determines two things. The number of digits Decimal (base 10) has 10 digits (0-9) Binary (base 2) has 2 digits (0-1) How many digits would a base 5 system have? Place Values Place values are determined by the power of the base. The right most digit is one's place which is any base to the zero power. The exponent increases by one as you go to the left. Decimal (base 10) 100 = 1, 101 = 10, 102 = 100 Binary (base 2) 20 = 1, 21 = 2, 22 = 4 Another way to look at it is to start with one's place and multiply by the base as you go left.

Video Example

Assume the same picture in the previous example (100x100). Calculate the storage requirements for 10 seconds of video. Calculation by color palette Monochrome 1250 bytes/frame X 30 frames/second = 37,500 bytes/second 37,500 bytes/second X 10 Seconds = 375,000 bytes 16-Color 5000 bytes/frame X 30 frames/second = 150,000 bytes/second 150,000 bytes/second X 10 Seconds = 1,500,000 bytes 256-Color or 256 Grayscale 10,000 bytes/frame X 30 frames/second = 300,000 bytes/second 300,000 bytes/second X 10 Seconds = 3,000,000 bytes 24-Bit True Color 30,000 bytes/frame X 30 frames/second = 900,000 bytes/second 900,000 bytes/second X 10 Seconds = 9,000,000 bytes

How does a computer represent data

Computers use electronic circuits or switches to represent data. These switches are either on or off, thus having two states. Think of it as millions of light switches The state of these switches are represented using binary digits (bits). 0 for off 1 for on Data is represented using patterns of bits Storage devices are also binary.

Representing Video

Digital video Digital Video is created by displaying several frames (pictures) in rapid succession. Slight changes in each frame creates motion. Typical frame rate is 30 frames per second. The computer processes thirty bitmap pictures every second.

Waveform Audio

Frequency Distance between peaks in the sound wave Indicates tone or note If peaks are close, the sound is high If peaks are far apart, the sound is low Amplitude The height of a sound wave Indicates loudness

Binary Numbers

How many Numbers or combinations of 1's and 0's are there using: 2 bits 4 bits 8 bits (byte) Calculated by: 2n where n is the number of digits Binary Numbers What is the largest number that can be represented with: 2 bits 4 bits 8 bits Calculated by: 2n - 1 where n is number of digits

Switches

Non-mechanical devices in computers that open and close circuits Evolution of electrical switches: Vacuum tubes (a) In the 1940's First Computer was: 1500 sq ft 30 tons Transistors (b) 1960's Took us to the moon Integrated circuits (c) Used today Billions of transistors within a 2 inch square wafer

The Binary Number System

Number systems are organized ways to represent numbers Each number in one system has a corresponding number in another.

Binary Numbers

Represents numbers with the binary numbering system. 100 is a 4 (1 x 4) + (0 x 2) + (0 x 1) 101 is a five (1 x 4) + (0 x 2) + (1 x 1) 1000 is an 8 (1 x 8) + (0 x 4) + (0 x 2) + (0 x 1) 1111 is a 15 (1 x 8) + (1 x 4) + (1 x 2) + (1 x 1) In decimal it is represented as (1 x 10) + (5 x 1)

Switches Representing Data

The on/off state of a switch represents one bit of data Bit (binary digit) On = 1 Off = 0

Bitmap Graphics

The size of a bitmap file is determined by the number of pixels and the Color Palette Common Color Palettes Monochrome Each pixel is either black or white Needs 1 bit per pixel 16-color Each pixel is on of 16 available colors Needs four bits of storage for each pixel 256-color or Grayscale Each pixel is one of 250 available colors or shades of gray. Needs eight bits (1 byte) of storage for each pixel 24 bit or true-color Each pixel is one of approximately 16.7 million available colors Needs 24 bits (3 bytes) of storage for each pixel

Digital Representation of a Sound Wave

The sound wave is digitally represented by recording points on the wave. Sampling rate. The number of points represented Represents the x coordinate Measured in herts (sample points per second) Amplitude value The height of the wave at that point. Represents the y coordinate

Representing Pictures

There are two approaches for storing graphics for computer systems Bitmap graphics This is the most common method The computer stores and processes a color code for each pixel in the picture. The size of the file depends on the number of pixels in the picture and the color palette used for the picture Vector graphics Consist of a set of instructions that recreates a picture. Used primarily in CAD/CAM systems where commons shapes are used. Has limitations in creating typical pictures Requires significantly less storage than Bitmap

Representing Characters Character Coding Schemes

There needs to be a definition of which sequence of 1's and 0's represents which character. Similar to the definition of dots and dashes for the telegraph The definition of which combination of bits represents which character is called a coding scheme. There are two basic coding schemes used on a PC ASCII (American Standard Code for Information Interchange) Uses 1 byte (8 bits) to represent a character or symbol 256 different combinations of 1's and 0's Not enough combinations for all character sets around the world Unicode Uses 2 bytes (16 bits) to represent a character of symbol Approximately 65,000 different combinations, used for all languages ASCII and Unicode is to the PC what Morse Code is to the telegraph

Bitmap Graphics Example

These calculations are based on a native bitmap file and not a compressed format. Assume a picture that is 100 by 100 pixels in size. This is approximately the size of a desktop icon There are 10,000 pixels in the picture Calculation by color palette Monochrome 10,000 pixels X 1 bit/pixel = 10,000 bits = 1250 bytes 16-Color 10,000 pixels X 4bits/pixel = 40,000 bits = 5,000 bytes 256-Color or Grayscale 10,000 pixels X 1 byte/pixel = 10,000 bytes 24-bit True-Color 10,000 pixels X 3 bytes/pixel = 30,000 bytes When creating graphics for a web page, choose the smallest color palette possible.

Representing Characters

To represent text and special characters that are found on a keyboard, the computer first groups bits into groups of 8 called a byte Each unique sequence of eight 1's and 0's represents a different character. An example of how a computer would represent the word "COOL" is below

Representing Sound

Two ways to represent sound: Waveform audio Most common form used on computers Digital representation of sound wave. Use .wav, .mod, .au, or .voc file extensions To play, need music software usually included with a sound card MIDI (Musical Instrument Digital Interface) A music notation system that allows a computer to communicate with music synthesizers.

Storage Requirements

Voice Sampling rate of 11Khz Each value requires 1 byte 1 second of voice requires 11,000 bytes Music Sampling rate of 44.1 Khz Each value requires 2 bytes 1 second of music requires 88,200 bytes Stereo requires twice as much


Related study sets

6th Grade Math-Unit 2 Rate, Ratio, and Proportional Reasoning

View Set

Chapter 8 TCP/IP Internetworking I

View Set

Chapter 2 Statement of Cashflows and Free Cashflow

View Set

Macro Homework Finals Study Guide

View Set