Lecture 1
Lecture 1
Data Storage
by
J. Glenn Brookshear
Dennis Brylow
1-2
Data Storage (continued)
1-3
HOW DATA IS REPRESENTED IN A COMPUTER
SYSTEM
1-4
Data as Bit Pattern Representations
• A bit is the smallest unit of data in computing or the
digital world. A bit can only be in one of two ‘binary’
states: ‘0’ or ‘1. The ‘0’ often signifies ‘Off’ or ‘False’
and the ‘1’ signifies ‘On’ or ‘True’ as in Figure 1.1.
1-5
Bits and Bit Patterns
• Computers represent data and instructions with patterns of
bits.
• In most computer documentation, 8 contiguous bits are called a
byte. A bit holds a 0 or a 1, possibly representing the on/off (or
high/low) condition of a switch.
• A series of 0s and 1s is known as a bit pattern.
• Representing data as bit patterns involves using sequences of
0s and 1s (bits) to encode
• different types of data.
1-6
Bits and Bit Patterns
• Bit Patterns are used to represent information
• Numbers
• Text characters
• Images
• Sound
• And others
1-7
Data representation
Integer Representation
When encoding numbers in binary, we are converting
from base-10 (decimal) to
base-2 (binary). In binary/base-2, the place values for
each digit go up in 2s, going
from right to left. Example the first 5 place values
1-8
• Decimal to Binary
• The process of converting decimal numbers to binary (base-2)
notation is shown through two examples. Figure 1.4 converts 13 to
binary and Figure 1.5 converts 25
• to binary.
1-9
1-10
8-bit representation of numbers 0 to 9.
1-11
Binary to Decimal
To convert from binary to decimal, you can use the positional notation system. Each
digit in a binary number represents a power of 2, starting from the rightmost digit ,
then , , and so on.
Firstly, assign powers of 2 to each digit, starting from the rightmost digit.
Example, if you have the binary number 10110, the rightmost digit is 0, followed by
1, then 1, in that order.
1-12
Binary to Decimal
1-13
Binary to Decimal
1-14
Text Representation
Text characters also have their own binary representation. These
are done using ASCII (American Standard Code for Information
Interchange) and Unicode.
1-15
Text Representation (Cont.)
1-16
Image Representation
A pixel is the smallest unit of a digital image or display. Images on a computer are made up of many
pixels, each assigned a binary code to represent its color. When combined, these codes form a
bitmap—a grid of binary data representing an image. This method of image representation is called
bitmapped graphics. Common bitmap file formats include JPEG, PNG, and BMP.
1-17
Image Representation
| 🔴 | 🟢 | 🔵 | 🟡 |
| ⚫ | ⚪ | 🟣 | 🟤 |
1-18
Image Representation
For each of the bitmaps in the Figure below, produce the pixel array that encode them
as a bitmapped graphics with white represented by ‘0’ and black represented by
‘1’. In other words, you are producing the array on the left of Figure above, but for
the images in Figure below.
1-19
AudioOneRepresentation
method of representing sound on a computer is digital audio.
Digital audio is where sound is recorded as a sequence of samples, with each sample
encoding the amplitude of the sound wave at a specific time as seen in Figure below.
The amplitude value is represented using a series of bits.
1-20
Audio Representation
Activities
Share, with your study mate, how sound quality would be affected by adjusting the rate at which
samples are taken. For example, how would an audio file, where samples are recorded every
second, compare to one with samples taken every 0.1s.
Find out, using the internet, what sample rate CDs are typically recorded at, exploring what
unit of measurement is used and how that corresponds to samples per second. As an extension, you
can also find out why that is the standard rate in relation to faithfully recording sound and how
humans hear.
1-21
Video Representation
Digital videos are represented as a series of images (frames), where each frame is
encoded using bit patterns to store the colour of each pixel in the frame. Videos are
essentially a sequence of images played in rapid succession.
1-22
File Representation
Files, such as documents, images, videos, and executables are represented as collections of bits. The
arrangement of these bits follows specific file formats, which dictate how the data should be interpreted
and displayed.
Examples of file formats: JPEG for pictures, DOC or DOCX for Word documents
and XLS or XLSX for Excel spread sheets.
1-23
Data for Transmission
When data is transmitted over networks, the binary representation of
the data is broken into same-sized pieces called packets for
transmission and then reassembled back into its original form at the
destination.
1-24
End of Lecture
1-25