You are on page 1of 96

Computer Systems

MELJUN CORTES,BSCS,ACS

What is this unit about?
• • • • Languages and translators Operating Systems Low-level machine Hardware
– Backing storage – Input devices – Output devices

01010101100001110101011010101101010101011101010010100 10101010101010101101111111101001011010101101010101011 10101001010010101010110111111110100101101010110101010 10111010100101001010101101101111111101001011010101101 01010101110101001010010101011011011111111010010110101 01101010101011101010010100101010110110111111110100101 10101011010101010111010100101001010101101101111111101 00101101010110101010101110101001010010101011011011111 11101001011010101101010101011101010010100101010110110 11111111010010110101011010101010111010100101001010101 10110111111110100101101010110101010101110101001010010 10101101010101011011101011010101101010101011101010010 10010101010101010101010110111010110101011010101010111 01010010100101010101010101011011101011010101101010101 01110101101111111101001011010101101010101011101010010 10010101011010010100101010101010101011011101011010101 10101010101110101001010010101101111111101001011010101 10101010101110101001010010101010101010101010101011011

Machine Code

What does this say?
Je ne parle pas Français ainsi je ne peux pas comprendre ceci ! !

=
I don't speak French so I can't understand this!!

Languages and Translators
• Computers only understand 1s and 0s • This is called machine code. • It is very hard for people to read and understand
Instead of trying to write machine code, we use high level languages to program.

High-level languages
What does a high-level language look like?
Made up of English words
PRINT “PLEASE ENTER YOUR AGE” INPUT AGE PRINT “YOU ARE “: AGE

Short Instructions like sentences

High-level languages
• High-level languages are portable. • They can be translated into many different versions of machine code • Machine code is not portable as it only works for a certain processor
PRINT “PLEASE ENTER YOUR AGE” INPUT AGE PRINT “YOU ARE “: AGE

Translator

Translators
• Translators take the high-level language and translate it into machine code. • They work like human translators

J'aime l’informatique
translate

I like Computing

PRINT “HELLO”

0011 1110 0011

Summary
Computers only understand 1s and 0s, which we call machine code. Humans write programs in high level languages because they are like English, and can be translated into machine code. High level languages can be portable which means they can be translated into different kinds of machine code.

Operating Systems
An operating system controls all the tasks • Loads data into the the computer does for you
memory from the Hard Disk
• Saves your files to disk
Sends text and graphics to the screen

Reads in data from keyboard and mouse

Sends data to your printer

Examples of Operating Systems
• Microsoft Windows • Apple Mac OS X • Linux

But NOT things like: • Microsoft Word • Games • Internet Explorer
– These are programs that run on the Operating System

Types of File
There are two different types of file: Program files, which are files full of instructions that the system runs. Microsoft Word is a program file. Data files, which are used by programs. A Microsoft Word document (like a letter you wrote and saved) is a data file.

uman H

omputer C

I nterface

Human Computer Interface
• The Operating System provides the HCI for the user • User uses mouse to click icons • Operating System translates into instructions
– What was clicked? – What should be done now (load file, save file, load program)?

Types of Operating System
– – Interactive System Computer reacts to user requests immediately and processes the data Example: Internet ticket booking (Travel, Concert) 1. User clicks on link to buy ticket

2. System checks immediately if there is a ticket available
3. Ticket is booked for the user

What would happen if the system wasn’t interactive?

Types of Operating System
– – – Real Time System Real time systems react even faster than interactive systems Designed to always process the right amount of information in time This means the Real Time system is instant every time

Used in spaceship control systems, nuclear reactors…..

Where else would Real Time Systems be used instead of Interactive Systems?

Summary
Operating systems control the tasks the computer does for the user. This includes loading data into memory, reading data from they keyboard and mouse, saving files and sending text and graphics to the screen or printer. There are two types of file - program files (such as Microsoft Word) and data files, that are used by program files (such as a letter your wrote in Microsoft Word) We interact with the OS through the Human Computer Interface (HCI). The OS translates the keyboard and mouse presses into instructions and performs actions such as loading and saving files. Interactive operating systems are used when users need immediate feedback. Real-time operating systems are used when systems always need instant results (such as a control system on a plane).

Check your understanding
What kind of system would you use for the following (choose from background, interactive and real-time): • • • • Flight booking web site Controlling a robot? On a home computer? Running a nuclear reactor

More Checking!
• • • • What jobs does the Operating System do? Give an example of an Operating System? What are the 2 types of file? What does the HCI do?

• •

When would Interactive Processing be used? When would Real-Time Processing be used?

Filing Systems
• • • It is very wise to organise your files! Lots of files in the one place = hard to organise Group them in directories

Filing System
The Operating System sorts our data using directories (often called folders) and files.

Low Level Machine
• We now know about Operating Systems, High Level Languages, and how we access data.
• What‟s next?

Now we are going right inside the computer to look at how the CPU and memory works

The two most important parts of the inside of the computer are the CPU and memory. The CPU (Central Processing Unit) is the “brain” of the computer where the computer works things out. The memory is where the computer “remembers” things for the CPU.

The Computer‟s Memory
Computers use main memory and backing storage to store data. Main memory is the fast memory inside a computer that stores data the CPU is currently using
Backing store is the bigger but slower memory that stores files and programs for the computer Backing store comes in two types – magnetic and optical. Magnetic – Hard Disk and Floppy disk Optical – CDROM and DVD

Main memory
• Inside the computer there is main memory • Main memory is made up of memory chips • There are two kinds of main memory:

RAM – Random Access Memory ROM – Read Only Memory

Random Access Memory
• RAM is where the computer stores data that is it currently using. This includes: – Data from the keyboard as you type – Data from open files and programs you are using • When you turn off your computer, all the data in RAM will be lost. • This is why you must always save files to backing store before turning off a computer!

Read Only Memory
• ROM is READ ONLY – you can‟t change it • It is written in the factory when the computer is made • The computer can read the data in the ROM straight away when the computer is switched on – This is why parts of the OS are sometimes stored on ROM • It isn‟t wiped when the computer is switched off • A good way to remember the difference between RAM and ROM is to think that RAM is like a notebook and ROM is like a textbook. • With RAM you write in what you need to remember • With ROM it is already there and you don’t change it!

How to measure memory
• We said before that everything in a computer is either a 1 or a 0 • This is because computers use binary numbers • The size of memory is usually given in megabytes or gigabytes, but what does that mean?

Bit Byte Kilobyte Megabytes Gigabyte Terabyte

Binary digit: a 1 or 0 8 bits, e.g. 01101100 1024 bytes 1024 Kilobytes 1024 Megabytes 1024 Gigabytes

Memory size
Bit Byte Kilobyte Megabytes Gigabyte Terabyte Binary digit: a 1 or 0 8 bits, e.g. 01101100 1024 bytes 1024 Kilobytes 1024 Megabytes 1024 Gigabytes

So an iPod with 60GB of storage space has: 60 x 1024 x 1024 x 1024 x 8 = 515,396,075,520 bits! (over 515 billion bits…)

The Processor
The processor is the brains of the computer A processor takes data in, processes it and then outputs the data to screen or printer.

calculation mouse

Print out
Input

Process

Output

keyboard
Display on screen

Remember:

Input Process Output
Some real world examples of IPO…..

Check your understanding…
• Give a real life example of IPO • Give a computer example of IPO • Explain why you can not store data in ROM • What happens to RAM when the computer is switched off? Why should this be ok?

B

I
N A R

Y

Binary
• We count in “decimal” • We have 10 fingers, so it makes sense that we group by 10s I.e. 1, 10, 100, 1000, 10 000 etc
• Computers count in binary • They use different columns and group by twos I.e. 1, 2, 4, 8, 16, 32, 64, 128

Numbers
We count to 10: 1,2,3,4,5,6,7,8,9,10 A computer would do this in binary: 1,10,11,100,101,110,111,1000,1001,1010!
Binary numbers have a power of 2, and decimal numbers (that we count with) have a power of 10. Let’s go back in time……

For example:
1000 100 10 1

6 1
128 64 32 16 8

5 5
4 2 1

1

0 0

1 1

0 1

0 1

0 0

0 0

0 1

1 1

Binary Revision Questions
• What is binary for:
48, 20, 128, 7 ?

• What is the decimal for:
00001000, 00001000, 00011000, 00000101 ?

Binary Revision Answers
48 = 00110000 20 = 00010100 128 = 10000000 7 = 00000111

00001000 = 8 00001000 = 9 00011000 = 24 00000101 = 5

Binary recap
128 64 32 16 8 4 2 1

• • • •

65 100 255 129

01000001 01100100 11111111 10000001

Storing Text and Graphics
• If computers can only work with binary numbers, how do they store words and pictures etc?

Storing Text • Since computers only use binary, they have a binary code for each character • This code is called ASCII
– American Standard Code for Information Interchange
Binary 1000001 1000010 1000011 1000100 1000101 1000110 Decimal 65 66 67 68 69 70 Character A B C D E F

Let‟s try some ASCII conversion….

ASCII Table

http://www.ascii.cl/htmlcodes.htm

ASCII TABLE
1 2 3 4 5 6 7 8 9 10 11 12 13 A B C D E F G H I J K L M

1 2 3 4 5 6 7 8 9 10 11 12 13

N O P Q R S T U V W X Y Z

The size of a text file • Text is stored in the computer using ASCII codes • Each character‟s ASCII code is 8-bits, i.e. 1 byte in size • So, we can work out the storage requirements of text files
Hello The eagle has landed! 5

21

How many bytes would these files take up?

Storing graphics

A graphic can be a drawing, graph, painting or photograph.
Graphics are made up of a grid of pixels. A pixel is a single point on the screen.

Storing Graphics
• In black and white graphics, the grid of pixels can be represented by binary numbers • 1 stands for a black square, 0 stands for a clear square. • Each pixel takes up 1-bit to store.

The grid is 8 x 8 pixels, so it will take 64 bits to store. 64 bits is 8 bytes.

1 0 0 0 1 1 0 0

0 1 0 0 0 1 0 0

0 0 1 0 0 1 0 0

1 1 1 1 1 1 0 0

1 1 1 1 1 1 1 0

0 0 1 0 0 0 1 0

0 1 0 0 0 0 1 1

1 0 0 0 0 0 0 0

How many bits do you think it will take to store this graphic?

Colour Graphics
• To store colour graphics, we need to assign each colour a different number e.g. red = 1, blue = 2 etc. • These colour codes are stored in binary • The larger the binary number, the more colours we can have. How many do we need? • 32-bit graphics are normal (4.3 billion different colours)

Systems task 9
• 10 minutes on Systems Task 9, page 25
• If finished, go onto Knowledge Check 5

Summary
• Computers store text and graphics in binary. • They use a code called ASCII (American Standard Code for Information Interchange) • Each character has a code in ASCII • Black and white graphics are stored by using 1 bit for each pixel (1 for black, 0 for white). • We can work out the size of these graphics by multiplying the width of the graphic by the height. • Colour graphics use more bits for each pixel depending on how many colours are needed.

Hardware
• We‟ve covered how the CPU works, and what the Operating System software does • Now let us look at hardware for the computer

Microprocessor

The chip is made of layers of silicon crystal wavers on which very small electronic components are installed.

Backing Storage
Backing storage memory is used to store files when the computer is switched off, and are usually removable.

There are two types of backing storage, Optical and Magnetic. We‟ll look at magnetic first.

Tape Drive

Tape drives take large plastic tapes which store data in binary using magnetic „spots‟ to encode the data They have a large capacity, and fast data transfer rates Tapes wear over time so need to be stored in suitable environment and are suited to medium and short term storage DAT tapes can hold up to 200 Gigabytes so are used for backup

Floppy Disks

• Floppy Disks are made from circular plastic plates coated in iron oxide (which is a magnetic chemical).
• Data is stored on the surface as patterns of magnetic spots. • Floppies are small and compact

• They store up to 1.44Mb of data (about 1/3 of an MP3 file)
•They can be damaged easily by dust, dampness, electro/magnetic pulses

Hard Drive

Hard Drive

Hard drives store data by writing magnetic patterns onto metal disks.
The surfaces are divided up into sectors and tracks which allows each part to be accessed directly. •The disk is in a sealed box to prevent dust damage. •The read/write head is just above the surface of the disk •The disk spins between 7,000 and 10,000 rpm •They hold gigabytes of data (most recently up to 750GB in size)

Optical Backing Storage
Optical backing storage uses laser optics to read and write data. Data is stored in binary by using lasers to burn microscopic marks on the disk surface. Data is read by reflecting light off the surface to read the microscopic marks.

CD-ROM

• High Capacity - 650 Megabytes • Stores data in microscopic grooves • Read Only

DVD-ROM

• Works in the same way as CD-ROM • Stores more data because it uses a narrower laser beam to read and write to disk • Ordinary DVDs hold 4.7 Gigabytes • Double-sided, multilayered DVDs store up to 17GB • Enough space for large files such as movies

CD-R

• Stands for Compact Disk Recordable • Uses a layer of dye which laser changes to store data • CD-Rs are WORM - Write Once Read Many
– Once files are written on, they can‟t be deleted or changed – CD-Rs are read-only after they are written

CD-RW
• Stands for Compact Disk Re-writable • Unlike CD-R, these can be rewritten • This is because they use the laser to change the reflective properties of microscopic marks
• CD-ROMS, CD-Rs and CD-RWs are used for:
– backing up large files – Storing large multimedia presentations – Storing large programs, like games

• CD-ROMS, CD-Rs and CD-RWs are slower than hard disks • But they are removable!

DVD-R and DVD-RW

• Works in the same way as CD-R and CD-RW

• Stores more data because of narrower laser • Can store up to 4.7GB

USB Flash drive

• • • • •

USB Flash drives are rewritable memory chips Store data just like a disk Used as backup and plugs into USB ports on a computer Very small and portable Sizes from 64MB to 2 Gigabytes

Input Devices
Input devices are pieces of hardware that let you control a computer by sending data to the computer from your device.

Mouse
A mouse lets you control the pointer on screen, and click to select icons.
Mice usually have 2 buttons and sometimes a scroll wheel.

Trackball
A trackball is similar to a mouse except the ball is on top. The trackball does not move around the desk like a mouse. They are useful when a user does not have desk space to move a mouse, and for people who find it hard to use their arms to move objects around.

Trackpad
A trackpad is a small pad that senses the movement of your finger. It lets you control the mouse by moving your finger across the pad. You can click by tapping the trackpad.

Graphics Tablet

A flat plastic panel with electronic sensors below the surface detect the movements of a pointing device. Very accurate – used by graphic artists / designers / Computer Aided Design (CAD)

Touch Sensitive Screen

Simple to operate
Useful for public information systems Tiring to use after a while Not precise

Keyboard

Input text and numbers
Function keys QUERTY layout Very common, nearly every computer has one

Scanner

Input drawing, photographs from paper.

Light beam passes over page and a sensor detects the reflection
Optical Character Recognition (OCR) software can recognise writing

Digital Cameras

Digital Cameras
Captures light coming through the lens and stores a digital image

Allows instant review of picture taken
Delete photos you don‟t like

Takes a memory card – can be various capacities.

Choosing a camera
Look at the accuracy (resolution) – measured in Megapixels. 5 Mpx is enough

Does it have a zoom lens? Digital zoom is worthless because it produces poor pictures
What capacity is the memory card?

Digital Video cameras
Same principle as still digital cameras Need a large storage capacity – video takes up a lot of space (15 frames per second) Some have a small LCD screen to view your video Features: zoom, focus, lighting, infrared recording, onboard editing

Webcams
Same principle as digital video camera Connected directly to computer via USB Can put a webcam in a website Useful for video calls via MSN Messenger

Laser Printer
Uses a laser beam to copy image of a page onto light-sensitive drum Ink (toner) attracted to the drum then transferred to paper  Laser printers are fast

 The output is high quality
 They are expensive to buy but relatively cheap to maintain.

Sprays ink onto the paper Printout quality is high Cheap to buy, can be expensive to maintain (expensive ink) Slower than Laser Printer

Inkjet Printer

Plotter

Uses inkjet technology to produce large, accurate and complex drawings Used by architects / designers Quicker than drawing by hand

Monitor
Screen used to display computer output
Different monitors have different resolutions The higher the resolution, the more detailed the picture will be High resolution needed for CAD and art work

LCD / TFT Displays
LCD = Liquid Crystal Display These screens have the following advantages: Flat, light, needing little power, can be run from a laptop battery The one disadvantage is that sometimes they are not bright enough and can cause eye strain

LCD / TFT Displays
TFT = Thin Film Transistor

Same advantages as LCD.
Uses a tiny transistor to form each pixel

Can update the image very quickly, allowing it to handle complex graphics and animation which LCD displays cannot

Computer Speakers

Produce sound from the computer

Allow you to do multimedia presentations, videoconferencing, games, music etc
Computer speaker systems vary in quality and number of speakers depending on output wattage (RMS) or surround sound capability etc

Desktop VS Laptop

Desktop VS Laptop
• Desktop computers stay in the same place. Laptop computers are portable • Because of this, the components used need to be light and consume less power (run off battery) • This means that a laptop with the same specification (CPU speed, RAM) will cost more than a same spec desktop.

Laptop
• Laptop computers are small and compact • They weigh a lot less than a desktop – usually 1.5 – 3 kg • Runs off battery, charges from mains • Has a flat screen (LCD or TFT) • Has a normal keyboard and trackpad

Palmtop Computer
• Is about the size of your hand • Small keyboard or a stylus with handwriting recognition • Stores data on a memory card • Useful for ultra-portable computing on the move • Store contacts, calendar, editing documents, email etc

Mainframe computer
• Large and powerful • Lots of processing power (multiple CPUs) and RAM • Many users connected using terminals • Used by banks and other large businesses to process and store data

Multimedia Systems
• Multimedia systems integrate sound, animation, video and graphics • Most modern computers have these capabilities • Interactive learning, information systems, multimedia web pages, games

Multimedia systems
A good system for viewing and creating multimedia might include: • A fast CPU and lots of RAM and storage • Quality TFT display • Scanner • Digital camera (video) • Surround sound speakers • Data projector