Computers and How They Store Data

Hardware and Software

So… um, what's the difference between hardware and software?

Hardware

Major Components of a Computer System

  1. the CPU (Central Processing Unit)
  2. main memory (also called RAM or Random Access Memory)
  3. secondary storage
  4. input devices
  5. output devices

The CPU (Central Processing Unit)

What does it do?

This may just be for the hardware geeks, but what are some examples of microprocessors?

Main Memory

What does it do?

Secondary Storage

What does it do?

What are some examples of non-volatile data stores?

You Know…

Input and Output Devices

These devices allow:

What are some examples of input and output devices?

Software

Hardware is nice and all, but…

Types of Software

Storing Data

It's All 0's and 1's

Bits

How many pieces of information can be encoded into 1 bit?

How about 2 sequential bits?

Bytes

A byte is 8 bits. How many possible combinations of 0's and 1's are there in 8 bits?

Storing Numbers

Using a binary numbering system, a computer can store the numbers 0 through 255 in a single byte.

2^7 | 2^6 | 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0
----+-----+-----+-----+-----+-----+-----+-----
128 | 64  | 32  | 16  |  8  |  4  |  2  |  1 
----+-----+-----+-----+-----+-----+-----+-----
 0  |  0  |  1  |  0  |  1  |  0  |  0  |  0   = 40
----+-----+-----+-----+-----+-----+-----+-----

Storing Numbers Continued

Storing Numbers - Examples

Storing Numbers - Questions

00000001

1

00000010

2

00000011

3

00000100

4

Storing Numbers - Questions Continued

10000101

133

10000001

129

00100000

32

An Addendum to Storing Numbers

Storing Letters and Other Characters

Storing numbers is a breeze - using bits to represent binary numbers works well. How do you think letters and punctuation are stored using bits?

Since it's easy to store numbers, use some sort of encoding scheme that translates numeric values into characters.

ASCII

One encoding scheme is called ASCII.

How many different characters can be stored in 7 bits?

128 characters… see the table on wikipedia

ASCII Continued

ASCII is an older encoding scheme that has some flaws. What do you think ASCII's major shortcoming is?

Unicode

The current standard for consistently representing text through different character sets and encodings is called unicode.

OK… So, How Does a Program Actually Run?

How is a Program Executed?

What part/component of your computer is responsible for executing a program?

The CPU!

The CPU Revisited

The CPU can perform some very basic tasks and operations:

These operations vary from processor to processor by design.

Machine Language

The CPU executes its operations based on instructions specified by a program. However, computers really only understand 0's and 1's

Don't Panic. We Won't be Programming in Machine Language!

Let's Talk Programming Languages