34
CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver [email protected]

CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver [email protected]

Embed Size (px)

Citation preview

Page 1: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

CSE1301 Computer Programming:

Lecture 1Computer Systems Overview

Linda [email protected]

Page 2: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

New Prac Times

• Remember to allocate yourself into pracs and tutes using allocate+ (there’s a link on the courseware page)

• New pracs have been opened (use allocate+ to select them if they suit you better) :– Monday 2-5pm– Thursday 2-5pm

Page 3: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

AlgorithmAlgorithm: A set of instructions describing how to

do a task (or process).

eureka!

ProgrammingProgramming: C: C

Page 4: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Topics

• Hardware components

• Computer Networks

Page 5: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Transistor

Base

Collector

Emitter

“semi-conductor” Binary digit or “bit”:0 off1 on

Page 6: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Transistor

Base

Collector

Emitter

off : 0

Page 7: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Transistor

Base

Collector

Emitter

on : 1

Page 8: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Transistor

Base

Collector

Emitter

Modern-day “chips” (about 3 x 3 mm in size) can contain up to millions of transistors.

Page 9: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Gates

• Gate: a group of transistors

• Types:

AND Gate OR Gate NOT Gate

Page 10: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

A AND B

A (0 or 1)

B (0 or 1)

(0 or 1)

1 AND 1

A (1)

B (1)

(1)

Example: AND Gate

Page 11: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

1 AND 0

A (1)

B (0)

(0)

0 AND 1

A (0)

B (1)

(0)

Example: AND Gate

Page 12: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

A B

0 0

0 1

1 0

1 1

A AND B

0

0

0

1A AND B

A

B

Example: AND Gate

A AND B

A (0 or 1)

B (0 or 1)

(0 or 1)

Page 13: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Gates and Boolean Algebra

A B

0 0

0 1

1 0

1 1

AND Gate

A AND B

0

0

0

1

0

1

1

1

A OR B

OR Gate

Page 14: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Gates and Boolean Algebra

A

0

1

NOT A

1

0

NOT Gate

Page 15: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Gates and Boolean Algebra

A =

A sequence of bits at a time:

1 1 0 0 1 1 0 1

B = 0 1 1 0 0 1 1 0

A AND B = 0 1 0 0 0 1 0 0

• Most PC’s do 32 bits at a time (“32-bit machines”), others as many as 128 bits at a time

Page 16: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

• Gates are the basic building blocks of computers.

0 or 1

Page 17: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Hardware Components of a Typical Computer

Input/OutputDevices

Central Processing

UnitMemory

• "Buses" allow components to pass data to each other.

Page 18: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Hardware Components of a Typical Computer

• Central Processing Unit (CPU) - performs the basic operations.

• consists of two parts:– Arithmetic / Logic Unit (ALU) - data manipulation

– Control Unit - coordinate machine’s activities

Input/OutputDevices

Central Processing

UnitMemory

Page 19: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Main Memory

• Holds programs and data• Stores bits in fixed-sized chunks:

– “word” (8, 16, 32, or 64 bits)• Each word is stored in a cell, which has a unique

address• Cells can be accessed in any order • Thus, random-access memory or “RAM”

Input/OutputDevices

Central Processing

UnitMemory

Page 20: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

"Bits, Bytes, Kilo-, Mega-, Giga-, …"

• A bit: 0 or 1• A word: chunk of bits (8, 16, 32 or 64 bits)

• a byte = 8 bits

• a kilobyte = 1024 bytes = 210 bytes

• a megabyte = 1024 KB = 220 bytes = 1,048,576 bytes

• a gigabyte = 1024 MB = 230 bytes

• a terabyte = 1024 GB = 240 bytes

Page 21: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

I/O Devices (Peripherals)

Input/OutputDevices

Central Processing

UnitMemory

• I/O Devices (Peripherals) - to communicate with the outside world.

• Examples: – Input: keyboard, mouse, microphone, scanner,

sensors (camera, infra-red), punch-cards, "mark sense" cards.

– Output: video, printer, audio speakers, etc.

Page 22: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Other Input/Output Devices

• Long term storage: files in secondary (mass) storage devices.– Examples: Hard drive, Floppy disk, Tape,

Cassette, CD-ROM (Compact Disk Read-Only Memory), Flopticals, Cartridges, etc.

• Communications devices– Examples: Modems, Ethernet cards

Page 23: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Speed

CPU clock speed: cycles per second ("hertz")– Pentium 4 1.8 GHz, 733 MHz G4

• BUT different CPU designs do different amounts of work in one clock cycle

– “flops” (floating-point operations per second)– “mips” (million instructions per second)– other benchmarks

Page 24: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Speed (continued)

• System clock/bus speed• communication between CPU, memory and I/O devices

• depends on main board (a.k.a. "motherboard") design

– 50MHz, 60MHz, 66MHz, 100Mhz, 133MHz, ++

– Intel 1.50GHz Pentium-4: 400MHz bus speed

• In common PC's:– system clock speed can be set in the main board

– CPU clock speed is the bus speed times a "multiplier"

» Example: A 150MHz CPU may be running at 2.5 x 60MHz, 3 x 50MHz or 2 x 75Mhz ("overclocked" system bus)

Page 25: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Speed (continued)

• RAM access speed• about 60ns (1 nanosecond = a billionth of a

second), and getting faster• may be rated with respect to "bus speed" (eg. PC-

100)

• Cache memory• faster than main memory (about 20ns access

speed), but more expensive• contains only data which the CPU is likely to use

next

Page 26: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Speed (continued)

• I/O device speed• Mass storage access

» 3.5in 1.4MB floppy disk: about 500kb/sec at 300 rpm (revolutions per minute)

» 3.5in hard disk: average seek time about 8.5 microsecond, and 7,200 rpm

• Communications– Examples: modems at about 56 kilobits per second,

and network cards at 10 or 100 megabits per second.

• Interface– Examples: ISA, PCI, IDE, SCSI, ATA, USB, etc....

Page 27: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Reliability

• Maintenance issues

• Operating conditions• Example: heat, ventilation, "over-clocking,” power

supply

• Error detection• Example: parity check, CRC

Note: Most system failures are due to software (i.e. programming) flaws rather than hardware

Page 28: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Modes of communication

• Parallel communication: – all the bits are transferred at the same time – each bit on a separate line

01

• Serial communication: – one bit at a time.

1

001

Page 29: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Modems (MOdulator-DEModulator)

Remote Computer

ModemHome

Computer

ModemDigitalData

DigitalData

Audio signal (analog)phone lines

Page 30: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Computer Networks

• Types– Local Area Networks (LAN)

• Computers in an organization.

• Example: the PCs in the lab.

– Long Haul Networks • Separated by hundreds or thousands of miles.

• Physical wires, telephone lines, satellites, etc.

• Example: Internet “backbone”

Page 31: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Computer Networks

• Method of communication– Each computer has an address

• IP address of www.monash.edu.au is 130.194.11.4

– A sender computer transmits data through the network in packets

– Each packet is tagged with the destination and return address

• Data too big for one packet is split into several packets, labelled in sequence

Page 32: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Computer Networks

• Method of communication (continued)

– Packets are sent via links from computer to computer (“routing”)

– Each intermediate computer receives and retransmits the message (“hops”)

• Packets may not arrive in the order in which they were sent.

– The recipient computer puts the packets in correct sequence and retrieves the data

Page 33: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Summary

• Transistors, gates, chips, hardware.

• Computer = CPU + Memory + I/O Devices

• Networks, modems

• Jargons and acronyms

Page 34: CSE1301 Computer Programming: Lecture 1 Computer Systems Overview Linda M c Iver Linda.mciver@csse.monash.edu.au

Further Reading

Brookshear:

• 4/e (1994): 1.1, 1.2, 2.6, 3.8

• 5/e (1997): 1.1 - 1.3, 2.6, 3.5

• 6/e (2000): 1.1 - 1.3, 2.5, 3.5

Deitel&Deitel (3/e)

• 1.2 to 1.5

• 1.15 to 1.17