Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital...

15
Basic Systems and Software

Transcript of Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital...

Page 1: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Basic Systems and Software

Page 2: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Were we left off

• Computers are programmable (formal) machines.

• Digital information is stored as a series of two states (1 and 0, on and off, yes and no, true and false).

• There are various types of memory in the computer.

Page 3: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

But how does it work?

• How are programs written?

• How do you tell the computer what to do?

• How does the computer follow your commands?

• How does the computer make decisions?

Page 4: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Based on the CPU

• The CPU is the brains of the computer, a tiny chip that gives the computer the ability to follow instructions (and become another machine).

Intel Pentium

Instruction

Page 5: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

What does the CPU do?

CPUInstruction

Input Output

Page 6: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

What is the CPU connected to?

CPU

RA

M

memory

I/ODisksKeyboardMonitorInternetPorts

Page 7: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Where are the instructions?

CPU

RAM

ADD a, bPUT in cMULT c, d.PUT on screen

Programs are stored in RAM and read one

instruction at a time to the CPU

c

5a

2b

8d

Page 8: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

What it really look like…

CPU

RAM

0010 0011 01000011 01010001 0101 0110.0011 1110

Programs are stored in RAM and read one

instruction at a time to the CPU

01010011

0010 01000100 0101 0110

1110

1000

Program counter

Page 9: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

How does the CPU think?

• A list of instructions does not make a computer think unless it can make decisions. Here is an example:

What is the value of d when the program is done, when a = 20 and b = 10?

ADD A,B PUT B TST B,100 IFG 5 MPC 001 PUT D000 001 002 003 004 005

Page 10: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

So what is the operating system?

• The Operating system helps other programs work without so much detail.

• Controls how different programs are allocated memory and CPU time.

• Makes dealing with different hardware components transparent to the programs.

Page 11: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Picture it like this

A Program

B Program…

Print AOpe

rati

ng S

yste

m

CPUProgram counter

Page 12: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Multitasking

• Sometimes your computer wants to do many things at one time to utilize the CPU to its fullest. This is called multitasking.

• The Operating system usually facilitates many programs running at once.

• The Unix operating system allocates a very small amount of time to each program and each is forced to take its turn. It does this with the use of an interrupt.

Page 13: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Problem with Windows

• Early versions of DOS had no multitasking.

• Windows had some, but allowed programs to give up the processor freely.

• Sometimes windows can not force a program to quit.

• Why is this a problem?

Page 14: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

Advantages of Multitasking

• Disk I/O is very slow compared to other work for the CPU, so while it is waiting it can do something else. (microwave example).

• Programs running too long can be stopped.

• You can work on interacting, real-time programs at the same time.

Page 15: Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.

What happens when the computer runs out of memory

• The operating system normally handles something called “virtual memory”.

HARD DISKRAM

Virtual Memory

CPU